File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ azure_blob_storage_absent: false # Allow to delete Azure Blob Storage when delet
6262
6363digital_ocean_spaces_create : true # if 'cloud_provider=digitalocean'
6464digital_ocean_spaces_name : " {{ patroni_cluster_name }}-backup" # Name of the Spaces Object Storage (S3 bucket).
65- digital_ocean_spaces_region : " nyc3" # The region to create the Space in.
65+ digital_ocean_spaces_region : " {{ (server_location in ['nyc1', 'nyc2']) | ternary(' nyc3', server_location) }} " # The region to create the Space in.
6666digital_ocean_spaces_access_key : " " # (required) Spaces Object Storage ACCESS KEY
6767digital_ocean_spaces_secret_key : " " # (required) Spaces Object Storage SECRET KEY
6868digital_ocean_spaces_absent : false # Allow to delete Spaces Object Storage when deleting a cluster servers using the 'state=absent' variable.
Original file line number Diff line number Diff line change 158158 - { option: "repo1-s3-bucket", value: "{{ pgbackrest_s3_bucket | default(digital_ocean_spaces_name | default(patroni_cluster_name + '-backup')) }}" }
159159 - {
160160 option : " repo1-s3-endpoint" ,
161- value : " {{ pgbackrest_s3_endpoint | default('https://' + (digital_ocean_spaces_region | default(server_location )) + '.digitaloceanspaces.com') }}" ,
161+ value : " {{ pgbackrest_s3_endpoint | default('https://' + (digital_ocean_spaces_region | default(default_region )) + '.digitaloceanspaces.com') }}" ,
162162 }
163- - { option: "repo1-s3-region", value: "{{ pgbackrest_s3_region | default(digital_ocean_spaces_region | default(server_location )) }}" }
163+ - { option: "repo1-s3-region", value: "{{ pgbackrest_s3_region | default(digital_ocean_spaces_region | default(default_region )) }}" }
164164 - { option: "repo1-s3-uri-style", value: "{{ pgbackrest_s3_uri_style | default('path') }}" }
165165 - { option: "repo1-retention-full", value: "{{ pgbackrest_retention_full | default('4') }}" }
166166 - { option: "repo1-retention-archive", value: "{{ pgbackrest_retention_archive | default('4') }}" }
180180 - { option: "log-level-console", value: "info" }
181181 - { option: "recovery-option", value: "recovery_target_action=promote" }
182182 - { option: "pg1-path", value: "{{ postgresql_data_dir }}" }
183+ vars :
184+ default_region : " {{ (server_location in ['nyc1', 'nyc2']) | ternary('nyc3', server_location) }}"
183185 no_log : true # do not output contents to the ansible log
184186 when : cloud_provider | default('') | lower == 'digitalocean'
185187
Original file line number Diff line number Diff line change 110110 - { option: "AWS_SECRET_ACCESS_KEY", value: "{{ wal_g_aws_secret_access_key | default(digital_ocean_spaces_secret_key | default(AWS_SECRET_ACCESS_KEY | default(''))) }}" }
111111 - {
112112 option : " AWS_ENDPOINT" ,
113- value : " {{ wal_g_s3_endpoint | default('https://' + (digital_ocean_spaces_region | default(server_location )) + '.digitaloceanspaces.com') }}" ,
113+ value : " {{ wal_g_s3_endpoint | default('https://' + (digital_ocean_spaces_region | default(default_region )) + '.digitaloceanspaces.com') }}" ,
114114 }
115- - { option: "AWS_REGION", value: "{{ wal_g_s3_region | default(digital_ocean_spaces_region | default(server_location )) }}" }
115+ - { option: "AWS_REGION", value: "{{ wal_g_s3_region | default(digital_ocean_spaces_region | default(default_region )) }}" }
116116 - { option: "AWS_S3_FORCE_PATH_STYLE", value: "{{ AWS_S3_FORCE_PATH_STYLE | default(true) }}" }
117117 - { option: "WALG_S3_PREFIX", value: "{{ wal_g_s3_prefix | default('s3://' + (digital_ocean_spaces_name | default(patroni_cluster_name + '-backup'))) }}" }
118118 - { option: "WALG_COMPRESSION_METHOD", value: "{{ wal_g_compression_method | default('brotli') }}" }
125125 - { option: "PGHOST", value: "{{ postgresql_unix_socket_dir | default('/var/run/postgresql') }}" }
126126 - { option: "PGPORT", value: "{{ postgresql_port | default('5432') }}" }
127127 - { option: "PGUSER", value: "{{ patroni_superuser_username | default('postgres') }}" }
128+ vars :
129+ default_region : " {{ (server_location in ['nyc1', 'nyc2']) | ternary('nyc3', server_location) }}"
128130 no_log : true # do not output contents to the ansible log
129131 when : cloud_provider | default('') | lower == 'digitalocean'
130132
You can’t perform that action at this time.
0 commit comments