Add AWS backups bucket

Joining the big boy club oh yeah
This commit is contained in:
Salt 2020-06-08 08:45:17 -05:00
parent f8549a6ad4
commit e59ecf33ea
2 changed files with 8 additions and 0 deletions

View File

@ -10,6 +10,8 @@ acme_directory: "https://acme-v02.api.letsencrypt.org/directory"
acme_version: 2
acme_webroot: "/var/www/acme"
aws_backup_bucket: "9iron-backups-general"
# MySQL
mysql_root_password: !vault |
$ANSIBLE_VAULT;1.1;AES256

View File

@ -52,4 +52,10 @@ for file in "$MODULESDIR"/*; do
log "Error executing module: $file"
}
done
# If we have a fancy schmancy bucket, use it
s3bucket="{{ aws_backup_bucket }}"
if command -v aws > /dev/null 2>&1 && aws s3 ls "s3://$s3bucket"; then
log "Moving files to S3 bucket $s3bucket"
aws s3 mv "$BACKUPSDIR" "s3://$s3bucket" --storage-class STANDARD_IA --recursive
fi