Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

limesurvey.yml 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. - name: Install LimeSurvey dependencies
  2. apt:
  3. name: "{{ packages }}"
  4. state: present
  5. vars:
  6. packages:
  7. - php
  8. - libapache2-mod-php
  9. - unzip
  10. tags:
  11. - dependencies
  12. - name: Create temporary LimeSurvey directory
  13. file: state=directory path=/root/limesurvey
  14. - name: Create temporary LimeSurvey extract directory
  15. file: state=directory path=/root/limesurvey/limesurvey-{{ limesurvey_version }}
  16. - name: Download LimeSurvey {{ limesurvey_version }} release
  17. get_url:
  18. url="{{ limesurvey_url }}"
  19. dest=/root/limesurvey/limesurvey-{{ limesurvey_version }}.zip
  20. - name: Extract LimeSurvey {{ limesurvey_version }} release
  21. unarchive:
  22. src: /root/limesurvey/limesurvey-{{ limesurvey_version }}.zip
  23. dest: /root/limesurvey/limesurvey-{{ limesurvey_version }}
  24. remote_src: yes
  25. - name: Copy LimeSurvey to web server directory
  26. shell: cp -R /root/limesurvey/limesurvey-{{ limesurvey_version }}/limesurvey/. /var/www/limesurvey/
  27. - name: Ensure proper LimeSurvey permissions
  28. file:
  29. path=/var/www/limesurvey
  30. state=directory
  31. recurse=yes
  32. owner=www-data
  33. group=www-data
  34. - name: Add LimeSurvey postgres user
  35. postgresql_user:
  36. login_host=localhost
  37. login_user={{ db_admin_username }}
  38. login_password="{{ db_admin_password }}"
  39. name={{ limesurvey_db_username }}
  40. password="{{ limesurvey_db_password }}"
  41. encrypted=yes
  42. state=present
  43. - name: Create LimeSurvey database
  44. postgresql_db:
  45. login_host=localhost
  46. login_user={{ db_admin_username }}
  47. login_password="{{ db_admin_password }}"
  48. name={{ limesurvey_db_database }}
  49. state=present
  50. owner={{ limesurvey_db_username }}
  51. - name: Create the Apache LimeSurvey sites config files
  52. template:
  53. src=etc_apache2_sites-available_limesurvey.j2
  54. dest=/etc/apache2/sites-available/limesurvey_{{ item.name }}.conf
  55. owner=root
  56. group=root
  57. with_items: "{{ virtual_domains }}"
  58. notify: restart apache
  59. - name: Enable Apache sites (creates new sites-enabled symlinks)
  60. command: a2ensite limesurvey_{{ item }}.conf creates=/etc/apache2/sites-enabled/limesurvey_{{ item }}.conf
  61. notify: restart apache
  62. with_items: "{{ virtual_domains | json_query('[*].name') }}"