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 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. - python-psycopg2
  8. tags:
  9. - dependencies
  10. - name: Set postgres administrator password
  11. command: sudo -u {{ db_admin_username }} psql -c "ALTER USER postgres with password '{{ db_admin_password }}';"
  12. - name: Create database user for ownCloud
  13. postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ owncloud_db_username }} password="{{ owncloud_db_password }}" role_attr_flags=CREATEDB state=present
  14. - name: Ensure repository key for ownCloud is in place
  15. apt_key: url=https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key state=present
  16. tags:
  17. - dependencies
  18. - name: Add ownCloud repository
  19. apt_repository: repo='deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /'
  20. tags:
  21. - dependencies
  22. - name: Install ownCloud
  23. apt: pkg=owncloud update_cache=yes
  24. tags:
  25. - dependencies
  26. - name: Ensure ownCloud directory is in place
  27. file: state=directory path=/var/www/owncloud
  28. - name: Move ownCloud data to encrypted filesystem
  29. command: mv /var/www/owncloud/data /decrypted/owncloud-data creates=/decrypted/owncloud-data
  30. - file: src=/decrypted/owncloud-data dest=/var/www/owncloud/data owner=www-data group=www-data state=link
  31. - name: Remove conf-enabled/owncloud symlink
  32. file: path=/etc/apache2/conf-enabled/owncloud.conf state=absent
  33. notify: restart apache
  34. - name: Configure the Apache HTTP server for ownCloud
  35. template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud.conf group=root
  36. - name: Enable the owncloud site
  37. command: a2ensite owncloud.conf creates=/etc/apache2/sites-enabled/owncloud.conf
  38. notify: restart apache
  39. - name: Install ownCloud cronjob
  40. cron: name="ownCloud" user="www-data" minute="*/5" job="php -f /var/www/owncloud/cron.php > /dev/null"