mirror of
				https://gitea.0xace.cc/ansible-playbooks/postgresql.git
				synced 2025-11-03 21:07:25 +00:00 
			
		
		
		
	update vars
This commit is contained in:
		@@ -1,30 +1,33 @@
 | 
			
		||||
pgbouncer_client_tls_key_file: "{{ pgbouncer_postgresql_ssl_path }}/cert.key"
 | 
			
		||||
pgbouncer_client_tls_cert_file: "{{ pgbouncer_postgresql_ssl_path }}/cert.crt"
 | 
			
		||||
postgresql_wal_g_install: true
 | 
			
		||||
 | 
			
		||||
pgbouncer_client_tls_key_file: "{{ pgbouncer_postgresql_ssl_path }}/{{ inventory_hostname }}.key"
 | 
			
		||||
pgbouncer_client_tls_cert_file: "{{ pgbouncer_postgresql_ssl_path }}/{{ inventory_hostname }}.crt"
 | 
			
		||||
pgbouncer_systemd_user: "postgres"
 | 
			
		||||
pgbouncer_systemd_group: "postgres"
 | 
			
		||||
pgbouncer_postgresql_major_version: "{{ postgresql_major_version }}"
 | 
			
		||||
pgbouncer_postgresql_superuser_username: "{{ postgresql_superuser_username }}"
 | 
			
		||||
pgbouncer_postgresql_superuser_password: "{{ postgresql_superuser_password }}"
 | 
			
		||||
pgbouncer_max_client_conn: 100000
 | 
			
		||||
pgbouncer_max_db_connections: 10000
 | 
			
		||||
pgbouncer_default_pool_size: 1000
 | 
			
		||||
 | 
			
		||||
postgresql_backup_parameters:
 | 
			
		||||
  archive_command: "{{ postgresql_archive_command if postgresql_wal_g_install else 'cd .' }}"
 | 
			
		||||
  restore_command: "{{ postgresql_restore_command if postgresql_wal_g_install else 'cd .' }}"
 | 
			
		||||
  archive_command: "{{ postgresql_archive_command if postgresql_wal_g_backup_enable else 'cd .' }}"
 | 
			
		||||
  restore_command: "{{ postgresql_restore_command if postgresql_wal_g_backup_enable else 'cd .' }}"
 | 
			
		||||
  archive_mode: "on"
 | 
			
		||||
  archive_timeout: "1800s"
 | 
			
		||||
 | 
			
		||||
postgresql_archive_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ wal_g_pg_binary_name ~ ' --config ' ~ wal_g_pg_home_dir ~ '/' ~ wal_g_config_name ~ ' wal-push %p' if postgresql_wal_g_install else '' }}"
 | 
			
		||||
postgresql_archive_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ wal_g_pg_binary ~ ' --config ' ~ wal_g_pg_home_dir ~ '/' ~ wal_g_config_name ~ ' wal-push %p' if postgresql_wal_g_backup_enable else '' }}"
 | 
			
		||||
# "restore_command" written to recovery.conf when configuring follower (create replica)
 | 
			
		||||
postgresql_restore_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ wal_g_pg_binary_name ~ ' --config ' ~ wal_g_pg_home_dir ~ '/' ~ wal_g_config_name ~ ' wal-fetch %f %p' if postgresql_wal_g_install else '' }}"
 | 
			
		||||
postgresql_restore_dbs_from_backup_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ postgresql_wal_g_binary_name ~ ' --config ' ~ postgresql_home_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' backup-fetch ' ~ postgresql_data_dir ~ ' ' ~ postgresql_wal_g_restore_backup_name }}"
 | 
			
		||||
postgresql_restore_wals_from_backup_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ postgresql_wal_g_binary_name ~ ' --config ' ~ postgresql_home_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' wal-fetch %f %p' }}"
 | 
			
		||||
postgresql_restore_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ wal_g_pg_binary ~ ' --config ' ~ wal_g_pg_home_dir ~ '/' ~ wal_g_config_name ~ ' wal-fetch %f %p' if postgresql_wal_g_backup_enable else '' }}"
 | 
			
		||||
postgresql_restore_dbs_from_backup_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ wal_g_pg_binary ~ ' --config ' ~ postgresql_home_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' backup-fetch ' ~ postgresql_data_dir ~ ' ' ~ postgresql_wal_g_restore_backup_name }}"
 | 
			
		||||
postgresql_restore_wals_from_backup_command: "{{ 'http_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ 'https_proxy=' ~ wal_g_https_proxy ~ ' ' if wal_g_https_proxy is defined else 'https_proxy=' ~ wal_g_http_proxy ~ ' ' if wal_g_http_proxy is defined else '' }}{{ wal_g_pg_binary ~ ' --config ' ~ postgresql_home_dir ~ '/' ~ postgresql_wal_g_restore_config_name ~ ' wal-fetch %f %p' }}"
 | 
			
		||||
 | 
			
		||||
# postgresql_restore_command: "wal-g wal-fetch %f %p"  # restore WAL-s using WAL-G
 | 
			
		||||
# postgresql_restore_command: "pgbackrest --stanza={{ pgbackrest_stanza }} archive-get %f %p"  # restore WAL-s using pgbackrest
 | 
			
		||||
# postgresql_restore_command: "pg_probackup-{{ pg_probackup_version }} archive-get -B {{ pg_probackup_dir }} --instance {{ pg_probackup_instance }} --wal-file-path=%p --wal-file-name=%f"  # restore WAL-s using pg_probackup
 | 
			
		||||
 | 
			
		||||
# WAL-G
 | 
			
		||||
wal_g_pg: "{{ postgresql_wal_g_install }}"
 | 
			
		||||
wal_g_pg_binary_name: "wal-g-pg"
 | 
			
		||||
wal_g_config_name: ".walg.json"
 | 
			
		||||
wal_g_restore_config_name: ".walg-restore.json"
 | 
			
		||||
wal_g_backup_enable: "{{ postgresql_wal_g_backup_enable }}"
 | 
			
		||||
wal_g_backup_retention_enable: "{{ wal_g_backup_enable }}"
 | 
			
		||||
wal_g_pg_home_dir: "{{ postgresql_home_dir }}"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user