-
Notifications
You must be signed in to change notification settings - Fork 0
/
backup.yml
39 lines (36 loc) · 858 Bytes
/
backup.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
- name: Backup postgres
hosts: maas_postgres_primary
become: true
gather_facts: true
tags:
- maas_postgres_primary
tasks:
- name: Backup Postgres
ansible.builtin.include_role:
name: maas_postgres
tasks_from: backup
- name: Archive Backups
hosts:
- maas_postgres_primary
- maas_region_controller
- maas_rack_controller
tasks:
- name: Archive and Download Backups
ansible.builtin.include_role:
name: common
tasks_from: backup
become: true
gather_facts: true
- name: Remove temporary database dump
hosts:
- maas_postgres_primary
tasks:
- name: Remove DB dump
ansible.builtin.file:
path: "{{ item }}"
state: absent
with_items:
- "{{ maas_postgres_backup_path }}"
- "{{ maas_postgres_backup_dir }}"
become: true