Geen omschrijving
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.

owncloud.yml 3.7KB

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