You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hetzner-ansible/roles/postgres/tasks/_create_database_backup.yml

19 lines
569 B
YAML

---
- name: "Creating backup directory <{{ backup_directory }}>"
ansible.builtin.file:
path: "{{ backup_directory }}"
state: directory
owner: "postgres"
group: "postgres"
mode: '0755'
- name: "Handle backup state <{{ database_backup_state }}> with suffix <{{ custom_backup_name }}>"
community.postgresql.postgresql_db:
name: "{{ item.name }}"
state: "{{ database_backup_state }}"
target: "{{ backup_directory }}/{{ item.name }}__{{ custom_backup_name }}.sql.gz"
loop: "{{ postgres_acls }}"
become_user: postgres
become: true