mirror of https://github.com/zulip/zulip.git
puppet: Default s3_region to the current ec2 region.
This commit is contained in:
parent
bfdc547b00
commit
19beed2709
|
@ -169,7 +169,7 @@ data includes:
|
|||
PostgreSQL server to add:
|
||||
|
||||
```ini
|
||||
s3_region = # region to write to S3
|
||||
s3_region = # region to write to S3; defaults to EC2 host's region
|
||||
s3_backups_key = # aws public key
|
||||
s3_backups_secret_key = # aws secret key
|
||||
s3_backups_bucket = # name of S3 backup
|
||||
|
|
|
@ -4,7 +4,14 @@ if [ -z "$ZULIP_SECRETS_CONF" ]; then
|
|||
fi
|
||||
|
||||
export PGHOST=/var/run/postgresql/
|
||||
AWS_REGION=$(crudini --get "$ZULIP_SECRETS_CONF" secrets s3_region)
|
||||
AWS_REGION=$(crudini --get "$ZULIP_SECRETS_CONF" secrets s3_region 2>/dev/null)
|
||||
if [ "$AWS_REGION" = "" ]; then
|
||||
# Fall back to the current region, if possible
|
||||
AZ=$(ec2metadata --availability-zone || true)
|
||||
if [ -n "$AZ" ] && [ "$AZ" != "unavailable" ]; then
|
||||
AWS_REGION=$(echo "$AZ" | sed 's/.$//')
|
||||
fi
|
||||
fi
|
||||
export AWS_REGION
|
||||
AWS_ACCESS_KEY_ID=$(crudini --get "$ZULIP_SECRETS_CONF" secrets s3_backups_key)
|
||||
export AWS_ACCESS_KEY_ID
|
||||
|
|
Loading…
Reference in New Issue