Use bash HOSTNAME var for backup scripts
This commit is contained in:
parent
f683c16f85
commit
b54710a72e
@ -63,7 +63,7 @@ backup() {
|
|||||||
{% if backup_s3_aws_endpoint_url is defined %}
|
{% if backup_s3_aws_endpoint_url is defined %}
|
||||||
--endpoint-url="{{ backup_s3_aws_endpoint_url }}" \
|
--endpoint-url="{{ backup_s3_aws_endpoint_url }}" \
|
||||||
{% endif %}
|
{% 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
|
# 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 %}
|
{% if backup_s3_aws_endpoint_url is defined %}
|
||||||
--endpoint-url="{{ backup_s3_aws_endpoint_url }}" \
|
--endpoint-url="{{ backup_s3_aws_endpoint_url }}" \
|
||||||
{% endif %}
|
{% 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
|
done
|
||||||
fi
|
fi
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
# Please make any configuration changes in the main repo
|
# Please make any configuration changes in the main repo
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
url="s3://{{ backup_s3_bucket}}/{{ inventory_hostname }}/"
|
url="s3://{{ backup_s3_bucket}}/$HOSTNAME/"
|
||||||
|
|
||||||
# AWS S3 configuration
|
# AWS S3 configuration
|
||||||
# NOTE: THIS IS SECRET INFORMATION
|
# NOTE: THIS IS SECRET INFORMATION
|
||||||
|
Loading…
Reference in New Issue
Block a user