-
Notifications
You must be signed in to change notification settings - Fork 1
/
backup.yml
101 lines (90 loc) · 3.45 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
- name: Backup of Mongo data
# by default run the backup on the last mongo instance defined in the inventory
hosts: mongo_docker_servers[-1]
become: True
gather_facts: True
tasks:
- debug:
msg: Backing up OpenEdx MongoDB
when: backup_mongo | default(true)
- import_role:
name: backups
vars:
backup_mongo: True
when: backup_mongo | default(true) | bool
- name: Backup OpenEdx Mysql data
# by default run the backup on the instance that should be a read replica
hosts: openedx_mysql_docker_servers[-1]
become: True
gather_facts: True
tasks:
- debug:
msg: Backing up OpenEdx Mysql Database
when: backup_openedx_mysql | default(true)
- name: Backup OpenEdx Mysql Database
import_role:
name: backups
vars:
openedx_backup_mysql_container_name: openedx_mysql
openedx_backup_mysql_login_user: root
openedx_backup_mysql_login_password: "{{ EDXAPP_MYSQL_PASSWORD_ADMIN }}"
backup_mysql: True
backup_mysql_container_name: "{{ openedx_backup_mysql_container_name }}"
backup_mysql_login_user: "{{ openedx_backup_mysql_login_user }}"
backup_mysql_login_password: "{{ openedx_backup_mysql_login_password }}"
backup_mysql_port: "{{ openedx_mysql_docker_port }}"
when: backup_openedx_mysql | default(true) | bool
- name: Backup Richie Mysql data
# by default run the backup on the instance that should be a read replica
hosts: richie_mysql_docker_servers[-1]
become: True
gather_facts: True
tasks:
- debug:
msg: Backing up Richie Mysql Database
when: backup_richie_mysql | default(true)
- name: Backup Richie Mysql Database
import_role:
name: backups
vars:
richie_backup_mysql_container_name: richie_mysql
richie_backup_mysql_login_user: root
richie_backup_mysql_login_password: "{{ richie_MYSQL_ROOT_PASSWORD }}"
richie_backup_mysql_port:
backup_mysql: True
backup_mysql_container_name: "{{ richie_backup_mysql_container_name }}"
backup_mysql_login_user: "{{ richie_backup_mysql_login_user }}"
backup_mysql_login_password: "{{ richie_backup_mysql_login_password }}"
backup_mysql_port: "{{ richie_mysql_docker_port }}"
when: backup_richie_mysql | default(true) | bool
- name: Backup Percona XtraDB Cluster with Percona XtraBackup
hosts: xtradb_servers[-1]
become: True
gather_facts: True
tasks:
- name: Backup Percona XtraDB Cluster Database
import_role:
name: percona_xtrabackup
vars:
backup_mysql_login_user: root
backup_mysql_login_password: "{{ xtradb_mysql_root_password }}"
- name: Backup Financial Manager Mysql data
# by default run the backup on the instance that should be a read replica
hosts: financial_manager_mysql_docker_servers[-1]
become: True
gather_facts: True
tasks:
- debug:
msg: Backing up Financial Manager Mysql Database
when: backup_financial_manager_mysql | default(true)
- name: Backup Financial Manager Mysql Database
import_role:
name: backups
vars:
backup_mysql: True
backup_mysql_container_name: financial_manager_mysql
backup_mysql_login_user: root
backup_mysql_login_password: financial_manager_mysql_root_password
backup_mysql_port: "{{ financial_manager_mysql_docker_port }}"
when: backup_financial_manager_mysql | default(true) | bool