From dc52392ebbeefc5f3e1217897d7b43f79dcaaff3 Mon Sep 17 00:00:00 2001 From: Salt Date: Thu, 14 Jan 2021 17:56:00 -0600 Subject: [PATCH] Put backups in a folder labeled after full inventory hostname, not short We were having conflicts with psql1.9iron.club and psql1.desu.ltd --- roles/backup/templates/s3backup.sh | 3 +-- roles/backup/templates/s3pgdump.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/roles/backup/templates/s3backup.sh b/roles/backup/templates/s3backup.sh index be6ae5e..d8af91b 100644 --- a/roles/backup/templates/s3backup.sh +++ b/roles/backup/templates/s3backup.sh @@ -4,7 +4,6 @@ # General-purpose, Ansible-managed backup script to push directories to # an S3 bucket # - # NOTICE: THIS FILE CONTAINS SECRETS # This file may contain the following secrets depending on configuration: # * An AWS access key @@ -57,5 +56,5 @@ nice -n 10 tar {{ backup_s3backup_tar_args }}{{ backup_s3backup_tar_args_extra } {% endfor %} "${DIRS[@]}" \ | aws s3 cp - \ - "s3://{{ backup_s3_bucket }}/{{ inventory_hostname_short }}/$(date "+{{ backup_dateformat }}").tar.gz" + "s3://{{ backup_s3_bucket }}/{{ inventory_hostname }}/$(date "+{{ backup_dateformat }}").tar.gz" diff --git a/roles/backup/templates/s3pgdump.sh b/roles/backup/templates/s3pgdump.sh index 31f3c44..dfee2bd 100644 --- a/roles/backup/templates/s3pgdump.sh +++ b/roles/backup/templates/s3pgdump.sh @@ -42,6 +42,6 @@ for db in "${DATABASES[@]}"; do sudo -u postgres pg_dump "$db" \ | gzip -v9 \ | aws s3 cp - \ - "s3://{{ backup_s3_bucket }}/{{ inventory_hostname_short }}/$db-$(date "+{{ backup_dateformat }}").pgsql.gz" + "s3://{{ backup_s3_bucket }}/{{ inventory_hostname }}/$db-$(date "+{{ backup_dateformat }}").pgsql.gz" done