diff --git a/roles/backup/templates/s3backup.sh b/roles/backup/templates/s3backup.sh index 5492582..9b373c2 100644 --- a/roles/backup/templates/s3backup.sh +++ b/roles/backup/templates/s3backup.sh @@ -63,7 +63,7 @@ backup() { {% if backup_s3_aws_endpoint_url is defined %} --endpoint-url="{{ backup_s3_aws_endpoint_url }}" \ {% endif %} - "s3://{{ backup_s3_bucket }}/{{ inventory_hostname }}/$dir/$(date "+{{ backup_dateformat }}").tar.gz" + "s3://{{ backup_s3_bucket }}/$HOSTNAME/$dir/$(date "+{{ backup_dateformat }}").tar.gz" } # Tar up all items in the backup list, recursively, and pipe them straight @@ -111,6 +111,6 @@ if command -v psql > /dev/null 2>&1; then {% if backup_s3_aws_endpoint_url is defined %} --endpoint-url="{{ backup_s3_aws_endpoint_url }}" \ {% endif %} - "s3://{{ backup_s3_bucket }}/{{ inventory_hostname }}/pgdump/$db/$(date "+{{ backup_dateformat }}").pgsql.gz" + "s3://{{ backup_s3_bucket }}/$HOSTNAME/pgdump/$db/$(date "+{{ backup_dateformat }}").pgsql.gz" done fi diff --git a/roles/backup/templates/s3restore.sh b/roles/backup/templates/s3restore.sh index 0217ec0..2244be3 100644 --- a/roles/backup/templates/s3restore.sh +++ b/roles/backup/templates/s3restore.sh @@ -20,7 +20,7 @@ # Please make any configuration changes in the main repo set -e -url="s3://{{ backup_s3_bucket}}/{{ inventory_hostname }}/" +url="s3://{{ backup_s3_bucket}}/$HOSTNAME/" # AWS S3 configuration # NOTE: THIS IS SECRET INFORMATION