Няма описание
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. ---
  2. # Installs the ownCloud personal cloud software
  3. # as per http://www.debiantutorials.com/how-to-install-owncloud-on-wheezy/
  4. - name: Install Postgres 9.1 on distributions other than Ubuntu Trusty
  5. apt: pkg=postgresql-9.1 state=present
  6. when: ansible_distribution_release != 'trusty'
  7. - name: Install Postgres 9.3 on Ubuntu Trusty
  8. apt: pkg=postgresql-9.3 state=present
  9. when: ansible_distribution_release == 'trusty'
  10. - name: Install ownCloud dependencies
  11. apt: pkg={{ item }} state=present
  12. with_items:
  13. - libapache2-mod-php5
  14. - php-apc
  15. - python-psycopg2
  16. - name: Set postgres password
  17. command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with password '{{ db_admin_password }}';"
  18. - name: Create database user for ownCloud
  19. 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
  20. - name: Create database for ownCloud
  21. 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 }}
  22. - name: Ensure repository key for ownCloud is in place for Debian 7
  23. apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key state=present
  24. when: ansible_distribution_release == 'wheezy'
  25. - name: Add ownCloud OpenSuSE repository for Debian 7
  26. apt_repository: repo='deb http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/ /'
  27. when: ansible_distribution_release == 'wheezy'
  28. - name: Ensure repository key for ownCloud is in place for Ubuntu 14.04
  29. apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/Release.key state=present
  30. when: ansible_distribution_release == 'trusty'
  31. - name: Add ownCloud OpenSuSE repository for Ubuntu 14.04
  32. apt_repository: repo='deb http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_14.04/ /'
  33. when: ansible_distribution_release == 'trusty'
  34. - name: Ensure repository key for ownCloud is in place for Ubuntu 12.04
  35. apt_key: url=http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/Release.key state=present
  36. when: ansible_distribution_release == 'precise'
  37. - name: Add ownCloud OpenSuSE repository for Ubuntu 12.04
  38. apt_repository: repo='deb http://download.opensuse.org/repositories/isv:ownCloud:community/xUbuntu_12.04/ /'
  39. when: ansible_distribution_release == 'precise'
  40. - name: Install ownCloud (possibly from OpenSuSE repository)
  41. apt: pkg=owncloud update_cache=yes
  42. - name: Owncloud www directory
  43. file: state=directory path=/var/www/owncloud
  44. - name: Store ownCloud data securely
  45. command: mv /var/www/owncloud/data /decrypted/owncloud-data creates=/decrypted/owncloud-data
  46. - file: src=/decrypted/owncloud-data dest=/var/www/owncloud/data owner=www-data group=www-data state=link
  47. - name: Enable Apache rewrite module
  48. command: a2enmod rewrite creates=/etc/apache2/mods-enabled/rewrite.load
  49. notify: restart apache
  50. - name: Enable Apache headers module
  51. command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
  52. notify: restart apache
  53. - name: Enable Apache expires module
  54. command: a2enmod expires creates=/etc/apache2/mods-enabled/expires.load
  55. notify: restart apache
  56. - name: Rename existing Apache owncloud virtualhost
  57. command: mv /etc/apache2/sites-available/owncloud /etc/apache2/sites-available/owncloud.conf removes=/etc/apache2/sites-available/owncloud
  58. - name: Remove old sites-enabled/owncloud symlink (new one will be created by a2ensite)
  59. command: rm /etc/apache2/sites-enabled/owncloud removes=/etc/apache2/sites-enabled/owncloud
  60. - name: Configure the Apache HTTP server for ownCloud
  61. template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud.conf group=root owner=root
  62. - name: Enable the owncloud site
  63. command: a2ensite owncloud.conf creates=/etc/apache2/sites-enabled/owncloud.conf
  64. notify: restart apache
  65. - name: Install ownCloud cronjob
  66. cron: name="ownCloud" user="www-data" minute="*/5" job="php -f /var/www/owncloud/cron.php > /dev/null"