Без опису
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. ---
  2. # Installs the ownCloud personal cloud software.
  3. - name: Install ownCloud dependencies
  4. apt: pkg={{ item }} state=present
  5. with_items:
  6. - postgresql
  7. - libapache2-mod-php5
  8. - php-apc
  9. - python-psycopg2
  10. tags:
  11. - dependencies
  12. - name: Set postgres password
  13. command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with password '{{ db_admin_password }}';"
  14. - name: Create database user for ownCloud
  15. postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ owncloud_db_username }} password="{{ owncloud_db_password }}" state=present
  16. - name: Create database for ownCloud
  17. postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ owncloud_db_database }} state=present owner={{ owncloud_db_username }}
  18. - name: Ensure repository key for ownCloud is in place
  19. apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_8.0/Release.key state=present
  20. tags:
  21. - dependencies
  22. - name: Add ownCloud OpenSuSE repository
  23. apt_repository: repo='deb http://download.opensuse.org/repositories/isv:/ownCloud:/community/Debian_8.0/ /'
  24. tags:
  25. - dependencies
  26. - name: Install ownCloud
  27. apt: pkg=owncloud update_cache=yes
  28. tags:
  29. - dependencies
  30. - name: Ensure ownCloud directory is in place
  31. file: state=directory path=/var/www/owncloud
  32. - name: Move ownCloud data to encrypted filesystem
  33. command: mv /var/www/owncloud/data /decrypted/owncloud-data creates=/decrypted/owncloud-data
  34. - file: src=/decrypted/owncloud-data dest=/var/www/owncloud/data owner=www-data group=www-data state=link
  35. - name: Enable Apache rewrite module
  36. command: a2enmod rewrite creates=/etc/apache2/mods-enabled/rewrite.load
  37. notify: restart apache
  38. - name: Enable Apache headers module
  39. command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
  40. notify: restart apache
  41. - name: Enable Apache expires module
  42. command: a2enmod expires creates=/etc/apache2/mods-enabled/expires.load
  43. notify: restart apache
  44. - name: Rename existing Apache owncloud virtualhost
  45. command: mv /etc/apache2/sites-available/owncloud /etc/apache2/sites-available/owncloud.conf removes=/etc/apache2/sites-available/owncloud
  46. - name: Remove old sites-enabled/owncloud symlink (new one will be created by a2ensite)
  47. file: path=/etc/apache2/sites-enabled/owncloud state=absent
  48. - name: Configure the Apache HTTP server for ownCloud
  49. template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud.conf group=root owner=root
  50. - name: Enable the owncloud site
  51. command: a2ensite owncloud.conf creates=/etc/apache2/sites-enabled/owncloud.conf
  52. notify: restart apache
  53. - name: Install ownCloud cronjob
  54. cron: name="ownCloud" user="www-data" minute="*/5" job="php -f /var/www/owncloud/cron.php > /dev/null"