Use bash HOSTNAME var for backup scripts

This commit is contained in:
Salt 2024-06-10 22:35:58 -05:00
parent f683c16f85
commit b54710a72e
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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