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.

commento.yml 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. - name: Create temporary commento directories
  2. file: state=directory path={{ item }}
  3. with_items:
  4. - /root/commento
  5. - /root/commento/commento-{{ commento_version }}
  6. - name: Download commento {{ commento_version }} release
  7. get_url:
  8. url="{{ commento_release }}"
  9. dest=/root/commento/commento-{{ commento_version }}.tar.gz
  10. - name: Decompress commento release
  11. unarchive: src=/root/commento/commento-{{ commento_version }}.tar.gz
  12. dest=/root/commento/commento-{{ commento_version }} copy=no
  13. creates=/root/commento/commento-{{ commento_version }}/commento
  14. - name: Create commento working directory
  15. file: state=directory path=/home/{{ main_user_name }}/commento
  16. - name: Stop old commento instance
  17. service: name=commento state=stopped
  18. ignore_errors: True
  19. - name: Copy commento data to working directory
  20. shell: cp -r commento/commento-{{ commento_version }}/* /home/{{ main_user_name }}/commento/ chdir=/root
  21. - name: Setup permissions for commento
  22. file: path=/home/{{ main_user_name }}/commento owner={{ main_user_name }} group=www-data recurse=yes
  23. - name: Add commento postgres user
  24. postgresql_user:
  25. login_host=localhost
  26. login_user={{ db_admin_username }}
  27. login_password="{{ db_admin_password }}"
  28. name={{ commento_db_username }}
  29. password="{{ commento_db_password }}"
  30. encrypted=yes
  31. state=present
  32. - name: Create commento database
  33. postgresql_db:
  34. login_host=localhost
  35. login_user={{ db_admin_username }}
  36. login_password="{{ db_admin_password }}"
  37. name={{ commento_db_database }}
  38. state=present
  39. owner={{ commento_db_username }}
  40. - name: Add systemd service to start commento automatically
  41. template:
  42. src=etc_systemd_system_commento.j2
  43. dest=/etc/systemd/system/commento.service
  44. owner=root
  45. group=root
  46. - name: Register new commento service
  47. systemd: name=commento daemon_reload=yes enabled=yes
  48. - name: Start new commento instance
  49. service: name=commento state=started
  50. - name: Create the Apache Commento sites config files
  51. template:
  52. src=etc_apache2_sites-available_commento.j2
  53. dest=/etc/apache2/sites-available/commento_{{ item.name }}.conf
  54. owner=root
  55. group=root
  56. notify: restart apache
  57. with_items: "{{ virtual_domains }}"
  58. - name: Enable Apache sites (creates new sites-enabled symlinks)
  59. command: a2ensite commento_{{ item }}.conf creates=/etc/apache2/sites-enabled/commento_{{ item }}.conf
  60. notify: restart apache
  61. with_items: "{{ virtual_domains | json_query('[*].name') }}"