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.

backup.yaml 949B

1234567891011121314151617181920212223242526
  1. ---
  2. - name: backup directory
  3. file:
  4. path: "{{nextcloud_backup_directory}}/{{_nextcloud_actual_version}}"
  5. state: directory
  6. - name: backup old nextcloud directory
  7. command: mv
  8. "{{nextcloud_directory}}/"
  9. "{{nextcloud_backup_directory}}/{{_nextcloud_actual_version}}/nextcloud"
  10. - name: dump mysql database
  11. shell: mysqldump "{{nextcloud_database_name}}"
  12. -h "{{nextcloud_database_host}}"
  13. -u "{{nextcloud_database_user}}"
  14. -p
  15. > "{{nextcloud_backup_directory}}/{{_nextcloud_actual_version}}/database.mysql"
  16. args:
  17. stdin: "{{nextcloud_database_pass}}"
  18. when: nextcloud_database_type == "mysql"
  19. - name: drop postgresql database
  20. shell: sudo -u postgres pg_dump -O
  21. > "{{nextcloud_backup_directory}}/{{_nextcloud_actual_version}}/database.pgsql"
  22. delegate_to: "{{ (nextcloud_database_host != 'localhost') | ternary(nextcloud_database_host,inventory_hostname) }}"
  23. when: nextcloud_database_type == "postgresql"