-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_backups.yml
79 lines (74 loc) · 3.29 KB
/
setup_backups.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
- hosts: localhost
name: "Creates or Update the AxonOps service checks"
become: false
connection: local
gather_facts: false
pre_tasks:
- name: Get the Org name
tags: always
ansible.builtin.set_fact:
org: "{{ lookup('env', 'AXONOPS_ORG') }}"
when: org is not defined
- name: Get the cluster name
tags: always
ansible.builtin.set_fact:
cluster: "{{ lookup('env', 'AXONOPS_CLUSTER') }}"
when: cluster is not defined
- name: Fail if no org
ansible.builtin.assert:
that:
- org is defined
- org | length > 1
- cluster is defined
- name: Include the default configs
tags: always
ansible.builtin.include_vars: "{{ item }}"
with_fileglob:
- "config/{{ org }}/{{ cluster }}/backups.yml"
- name: Apply Backup on {{ org }}/{{ cluster }}
axonops.configuration.backup:
org: "{{ org }}"
cluster: "{{ item.cluster }}"
present: "{{ item.present|default(true) }}"
local_retention: "{{ item.local_retention|default('10d') }}"
remote_path: "{{ item.remote_path }}"
remote_retention: "{{ item.remote_retention|default('60d') }}"
remote_type: "{{ item.remote_type }}"
timeout: "{{ item.timeout|default('10h') }}"
transfers: "{{ item.transfers|default('1') }}"
remote: "{{ item.remote|default(True) }}"
tps_limit: "{{ item.tps_limit|default('50') }}"
bw_limit: "{{ item.bw_limit|default('') }}"
tag: "{{ item.tag|default('') }}"
datacenters: "{{ item.datacenters }}"
# nodes: {'type': 'list', 'default': []},
# tables_keyspace': {'type': 'list'},
# tables: {'type': 'list'},
keyspaces: "{{ item.keyspaces|default([]) }}"
schedule: "{{ item.schedule|default(True) }}"
schedule_expr: "{{ item.schedule_expr|default('0 1 * * *') }}"
azure_account: "{{ item.azure_account | default(omit) }}"
azure_endpoint: "{{ item.azure_endpoint | default(omit)}}"
azure_key: "{{ item.azure_key | default(omit)}}"
azure_use_msi: "{{ item.azure_use_msi | default(omit)}}"
azure_msi_object_id: "{{ item.azure_msi_object_id | default(omit)}}"
azure_msi_client_id: "{{ item.azure_msi_client_id | default(omit)}}"
azure_msi_mi_res_id: "{{ item.azure_msi_mi_res_id | default(omit)}}"
s3_region: "{{ item.s3_region |default('')}}"
s3_access_key_id: "{{ item.s3_access_key_id|default(none) }}"
s3_secret_access_key: "{{ item.s3_secret_access_key|default(none) }}"
s3_storage_class: "{{ item.s3_storage_class|default('STANDARD') }}"
s3_acl: "{{ item.s3_acl|default('private') }}"
s3_encryption: "{{ item.s3_encryption|default('AES256') }}"
s3_no_check_bucket: "{{ item.s3_no_check_bucket|default('False') }}"
s3_disable_checksum: "{{ item.s3_disable_checksum|default('False') }}"
host: "{{ item.host |default('')}}"
ssh_user: "{{ item.ssh_user |default(omit)}}"
ssh_pass: "{{ item.ssh_pass |default(omit)}}"
key_file: "{{ item.key_file |default(omit)}}"
with_items:
"{{ axonops_backups }}"
no_log: "{{ false if enable_logging is defined and enable_logging else true }}"
tags:
- backups
# code: language=ansible