Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

owncloud.yml 2.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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: Install ownCloud (possibly from OpenSuSE repository)
  15. apt: pkg=owncloud update_cache=yes
  16. - name: Install PHP dependencies
  17. apt: pkg={{ item }} state=present
  18. with_items:
  19. - php-apc
  20. - libapache2-mod-php5
  21. - name: Owncloud www directory
  22. file: state=directory path=/var/www/owncloud
  23. - name: Store ownCloud data securely
  24. command: mv /var/www/owncloud/data /decrypted/owncloud-data creates=/decrypted/owncloud-data
  25. - file: src=/decrypted/owncloud-data dest=/var/www/owncloud/data owner=www-data group=www-data state=link
  26. - name: Enable Apache rewrite module
  27. command: a2enmod rewrite creates=/etc/apache2/mods-enabled/rewrite.load
  28. notify: restart apache
  29. - name: Enable Apache headers module
  30. command: a2enmod headers creates=/etc/apache2/mods-enabled/headers.load
  31. notify: restart apache
  32. - name: Enable Apache expires module
  33. command: a2enmod expires creates=/etc/apache2/mods-enabled/expires.load
  34. notify: restart apache
  35. - name: Rename existing Apache owncloud virtualhost
  36. command: mv /etc/apache2/sites-available/owncloud /etc/apache2/sites-available/owncloud.conf removes=/etc/apache2/sites-available/owncloud
  37. - name: Remove old sites-enabled/owncloud symlink (new one will be created by a2ensite)
  38. command: rm /etc/apache2/sites-enabled/owncloud removes=/etc/apache2/sites-enabled/owncloud
  39. - name: Configure the Apache HTTP server for ownCloud
  40. template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud.conf group=root owner=root
  41. - name: Enable the owncloud site
  42. command: a2ensite owncloud.conf creates=/etc/apache2/sites-enabled/owncloud.conf
  43. notify: restart apache
  44. - name: Install ownCloud cronjob
  45. cron: name="ownCloud" user="www-data" minute="*/5" job="php -f /var/www/owncloud/cron.php > /dev/null"