Sin descripción
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 1.9KB

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 password for PostgreSQL admin user
  11. become: true
  12. become_user: postgres
  13. postgresql_user: name={{ db_admin_username }} password={{ db_admin_password }} encrypted=yes
  14. - name: Create database user for ownCloud
  15. 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
  16. - name: Ensure repository key for ownCloud is in place
  17. apt_key: url=https://download.owncloud.org/download/repositories/stable/Debian_8.0/Release.key state=present
  18. tags:
  19. - dependencies
  20. - name: Add ownCloud repository
  21. apt_repository: repo='deb http://download.owncloud.org/download/repositories/stable/Debian_8.0/ /'
  22. tags:
  23. - dependencies
  24. - name: Install ownCloud
  25. apt: pkg=owncloud-files update_cache=yes
  26. tags:
  27. - dependencies
  28. - name: Ensure ownCloud directory is in place
  29. file: state=directory path=/var/www/owncloud
  30. - name: Move ownCloud data to user-data filesystem
  31. command: mv /var/www/owncloud/data /data/owncloud-data creates=/data/owncloud-data
  32. - file: src=/data/owncloud-data dest=/var/www/owncloud/data owner=www-data group=www-data state=link
  33. - name: Configure Apache for ownCloud
  34. template: src=etc_apache2_sites-available_owncloud.j2 dest=/etc/apache2/sites-available/owncloud.conf group=root
  35. notify: restart apache
  36. - name: Enable 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"