File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ # This playbook uploads MariaDB backups to an AWS S3 object store.
3+ # Can be linked as a post hook for overcloud-database-backup.
4+
5+ - hosts : controllers[0]
6+ vars :
7+ backup_directory : " /var/lib/docker/volumes/mariadb_backup/_data"
8+ kayobe_venv : " /opt/kayobe/venvs/kayobe"
9+ tasks :
10+ - name : Ensure AWS S3 module prerequisities are available
11+ pip :
12+ name :
13+ - boto3
14+ - botocore
15+ virtualenv : " {{ kayobe_venv }}"
16+
17+ - name : Build backup file list
18+ find :
19+ paths : " {{ backup_directory }}"
20+ become : True
21+ register : backups
22+
23+ - name : Upload backup files to S3
24+ amazon.aws.aws_s3 :
25+ s3_url : " {{ s3_url }}"
26+ access_key : " {{ secrets_s3_access_key }}"
27+ secret_key : " {{ secrets_s3_secret_key }}"
28+ bucket : " {{ s3_mariadb_mysql_backup_bucket }}"
29+ object : " {{ item.path | basename }}"
30+ src : " {{ item.path }}"
31+ mode : put
32+ overwrite : different
33+ validate_certs : False
34+ become : True
35+ with_items : " {{ backups.files }}"
You can’t perform that action at this time.
0 commit comments