mirror of
https://gitea.0xace.cc/ansible-galaxy/wal-g.git
synced 2025-02-19 18:44:45 +00:00
add proxy support
This commit is contained in:
parent
6ce8b488c8
commit
e1c5f252ed
@ -17,6 +17,10 @@ wal_g_backup_retention_schedule: ""
|
||||
wal_g_backup_retention_number: 7
|
||||
wal_g_backup_permanent_schedule: ""
|
||||
|
||||
# If backuping through proxy
|
||||
#wal_g_http_proxy: ''
|
||||
#wal_g_https_proxy: ''
|
||||
|
||||
wal_g_postgresql_supported_versions:
|
||||
- 13
|
||||
- 14
|
||||
|
@ -3,8 +3,9 @@ flock -x 200
|
||||
|
||||
role=$(curl -k -s http://127.0.0.1:8008 || curl -k -s https://127.0.0.1:8008 | jq '.role')
|
||||
|
||||
|
||||
if [ "${role}" == "\"master\"" ] ; then
|
||||
{{ wal_g_pg_binary_name }} --config {{ wal_g_pg_home_dir }}/{{ wal_g_config_name }} backup-push {{ wal_g_pg_data_dir }} --full --permanent 2>&1 | tee -a /var/log/postgresql/backup-permanent.log
|
||||
{% if wal_g_http_proxy is defined %}http_proxy={{ wal_g_http_proxy }} {% else %}{% endif %}{% if wal_g_https_proxy is defined %}https_proxy={{ wal_g_https_proxy }} {% else %}{% endif %}{{ wal_g_pg_binary_name }} --config {{ wal_g_pg_home_dir }}/{{ wal_g_config_name }} backup-push {{ wal_g_pg_data_dir }} --full --permanent 2>&1 | tee -a /var/log/postgresql/backup-permanent.log
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
|
@ -4,7 +4,7 @@ flock -x 200
|
||||
role=$(curl -k -s http://127.0.0.1:8008 || curl -k -s https://127.0.0.1:8008 | jq '.role')
|
||||
|
||||
if [ "${role}" == "\"master\"" ] ; then
|
||||
{{ wal_g_pg_binary_name }} --config {{ wal_g_pg_home_dir }}/{{ wal_g_config_name }} retain {{ wal_g_backup_retention_number }} --confirm --use-sentinel-time 2>&1 | tee -a /var/log/postgresql/backup-retention.log
|
||||
{% if wal_g_http_proxy is defined %}http_proxy={{ wal_g_http_proxy }} {% else %}{% endif %}{% if wal_g_https_proxy is defined %}https_proxy={{ wal_g_https_proxy }} {% else %}{% endif %} {{ wal_g_pg_binary_name }} --config {{ wal_g_pg_home_dir }}/{{ wal_g_config_name }} retain {{ wal_g_backup_retention_number }} --confirm --use-sentinel-time 2>&1 | tee -a /var/log/postgresql/backup-retention.log
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
|
@ -4,7 +4,7 @@ flock -x 200
|
||||
role=$(curl -k -s http://127.0.0.1:8008 || curl -k -s https://127.0.0.1:8008 | jq '.role')
|
||||
|
||||
if [ "${role}" == "\"master\"" ] ; then
|
||||
{{ wal_g_pg_binary_name }} --config {{ wal_g_pg_home_dir }}/{{ wal_g_config_name }} backup-push {{ wal_g_pg_data_dir }} --full 2>&1 | tee -a /var/log/postgresql/backup.log
|
||||
{% if wal_g_http_proxy is defined %}http_proxy={{ wal_g_http_proxy }} {% else %}{% endif %}{% if wal_g_https_proxy is defined %}https_proxy={{ wal_g_https_proxy }} {% else %}{% endif %}{{ wal_g_pg_binary_name }} --config {{ wal_g_pg_home_dir }}/{{ wal_g_config_name }} backup-push {{ wal_g_pg_data_dir }} --full 2>&1 | tee -a /var/log/postgresql/backup.log
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user