No Description
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.1KB

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