diff --git a/roles/setup_pgbackrest/README.md b/roles/setup_pgbackrest/README.md index e14aad126..95ef56647 100644 --- a/roles/setup_pgbackrest/README.md +++ b/roles/setup_pgbackrest/README.md @@ -31,13 +31,13 @@ The rest of the variables can be configured and are available in the: Below is the documentation of the rest of the main variables: -### `replication_user` +### `pg_replication_user` Dedicated replication user used in WAL streaming replication. Default: `repuser` Example: ```yaml -replication_user: 'repuser' +pg_replication_user: 'repuser' ``` ### `pgbackrest_spool_directory` diff --git a/roles/setup_pgbackrest/defaults/main.yml b/roles/setup_pgbackrest/defaults/main.yml index d747e9302..c68731ccc 100644 --- a/roles/setup_pgbackrest/defaults/main.yml +++ b/roles/setup_pgbackrest/defaults/main.yml @@ -3,11 +3,10 @@ pgbackrest_package_name: "pgbackrest" # replication user setup in postgresql.conf -replication_user: "repuser" +pg_replication_user: "repuser" # spool directory - only used with archive-async pgbackrest_spool_directory: "/var/spool/pgbackrest" -use_patroni: false # number of parallel processes to be used during backup and recovery # recommended to not use more than 25% of available CPU for the backup command @@ -18,6 +17,7 @@ process_max_recovery: 3 etc_hosts_lists: [] use_hostname: true update_etc_file: true +use_patroni: false # setting validate_only to true allows you to validate setup on an existing node # use_validation flag applies to deployment configuration and validation after setup diff --git a/roles/setup_pgbackrest/tasks/configure_pg_backup.yml b/roles/setup_pgbackrest/tasks/configure_pg_backup.yml index cb9c865c7..f7c38fad3 100644 --- a/roles/setup_pgbackrest/tasks/configure_pg_backup.yml +++ b/roles/setup_pgbackrest/tasks/configure_pg_backup.yml @@ -9,9 +9,9 @@ when: - _pgbackrest_server_info|length == 0 -- name: Set _pgbackrest_server_public_ip +- name: Set _pgbackrest_server_private_ip ansible.builtin.set_fact: - _pgbackrest_server_public_ip: "{{ _pgbackrest_server_info[0].ansible_host }}" + _pgbackrest_server_private_ip: "{{ _pgbackrest_server_info[0].private_ip }}" # only need to be run when standby_present is defined because they have already been done on just the primary node - name: Initialize the Postgres parameters list @@ -45,7 +45,7 @@ ansible.builtin.command: cmd: "pgbackrest --stanza={{ pg_instance_name }} --type=full backup" become_user: "{{ pgbackrest_user }}" - delegate_to: "{{ _pgbackrest_server_public_ip }}" + delegate_to: "{{ _pgbackrest_server_private_ip }}" become: true run_once: true changed_when: true @@ -53,5 +53,5 @@ - name: Reset local variables ansible.builtin.set_fact: _pgbackrest_server_info: "" - _pgbackrest_server_public_ip: null + _pgbackrest_server_private_ip: "" _pg_postgres_conf_params: "" diff --git a/roles/setup_pgbackrest/tasks/configure_pgbackrest.yml b/roles/setup_pgbackrest/tasks/configure_pgbackrest.yml index ded396fc4..2ee0aebed 100644 --- a/roles/setup_pgbackrest/tasks/configure_pgbackrest.yml +++ b/roles/setup_pgbackrest/tasks/configure_pgbackrest.yml @@ -3,24 +3,6 @@ ansible.builtin.set_fact: _pgbackrest_server_info: "{{ lookup('edb_devops.edb_postgres.pgbackrest_server', wantlist=True) }}" -- name: Fail if pgbackrest server informations are not found - ansible.builtin.fail: - msg: "Unable to find pgBackRest server informations" - when: - - _pgbackrest_server_info|length == 0 - -- name: Set _pgbackrest_host when not using hostname - ansible.builtin.set_fact: - _pgbackrest_host: "{{ _pgbackrest_server_info[0].ansible_host }}" - when: - - "not use_hostname|bool" - -- name: Set _pgbackrest_host when using hostname - ansible.builtin.set_fact: - _pgbackrest_host: "{{ _pgbackrest_server_info[0].inventory_hostname }}" - when: - - use_hostname|bool - - name: Set _standby_index_var for each standby node ansible.builtin.set_fact: _standby_index_var: "{{ item.index_var }}" @@ -28,7 +10,7 @@ when: - standby_present is defined - "'standby' in group_names" - - item.inventory_hostname == inventory_hostname + - item.inventory_hostname == inventory_hostname - name: Ensure lock directory pgbackrest_lock_path exists ansible.builtin.file: @@ -61,10 +43,14 @@ mode: "0700" become: true vars: - pgbackrest_host: "{{ _pgbackrest_host }}" + pgbackrest_host: >- + {% if use_hostname %} + {{ _pgbackrest_server_info[0].inventory_hostname }} + {% else %} + {{ _pgbackrest_server_info[0].private_ip }} + {% endif %} - name: Reset local variables ansible.builtin.set_fact: _pgbackrest_server_info: "" - _pgbackrest_host: null - _standby_index_var: null + _standby_index_var: "" diff --git a/roles/setup_pgbackrest/tasks/define_node_variables.yml b/roles/setup_pgbackrest/tasks/define_node_variables.yml index b4cda93c7..f130271e6 100644 --- a/roles/setup_pgbackrest/tasks/define_node_variables.yml +++ b/roles/setup_pgbackrest/tasks/define_node_variables.yml @@ -20,7 +20,7 @@ - name: Get primary node informations ansible.builtin.set_fact: - primary_node_hostname: "{{ pgbackrest_node_info | selectattr('node_type', 'equalto', 'primary') | map(attribute='ansible_host') }}" + primary_node_hostname: "{{ pgbackrest_node_info | selectattr('node_type', 'equalto', 'primary') | map(attribute='private_ip') }}" when: - "not use_hostname|bool" @@ -33,7 +33,7 @@ - name: Get standby node informations ansible.builtin.set_fact: - standby_node_hostname: "{{ pgbackrest_node_info | selectattr('node_type', 'equalto', 'standby') | map(attribute='ansible_host') | list | flatten }}" + standby_node_hostname: "{{ pgbackrest_node_info | selectattr('node_type', 'equalto', 'standby') | map(attribute='private_ip') | list | flatten }}" when: - "not use_hostname|bool" - standby_present is defined @@ -41,31 +41,3 @@ - name: Get primary node inventory hostname informations ansible.builtin.set_fact: primary_node_inventory_hostname: "{{ pgbackrest_node_info | selectattr('node_type', 'equalto', 'primary') | map(attribute='inventory_hostname') }}" - -- name: Define postgres user on primary node when pg_type = PG - ansible.builtin.set_fact: - primary_host_user: "postgres" - when: pg_type == 'PG' - -- name: Define postgres user on primary node when pg_type = EPAS - ansible.builtin.set_fact: - primary_host_user: "enterprisedb" - when: pg_type == 'EPAS' - -- name: Define EPAS DB information - ansible.builtin.set_fact: - pg_unix_socket_epas: "/var/run/edb/as{{ pg_version }}" - pg_port_epas: "5444" - pg_database_name: "edb" - when: - - pg_type == 'EPAS' - - ansible_os_family == 'RedHat' - -- name: Define EPAS DB information - ansible.builtin.set_fact: - pg_unix_socket_epas: "/var/run/edb-as" - pg_port_epas: "5444" - pg_database_name: "postgres" - when: - - pg_type == 'EPAS' - - ansible_os_family == 'Debian' diff --git a/roles/setup_pgbackrest/tasks/generate_ssh_keys.yml b/roles/setup_pgbackrest/tasks/generate_ssh_keys.yml index e2801d398..897f3cb1b 100644 --- a/roles/setup_pgbackrest/tasks/generate_ssh_keys.yml +++ b/roles/setup_pgbackrest/tasks/generate_ssh_keys.yml @@ -1,5 +1,4 @@ --- - - name: Ensure the directory pg_user_home/.ssh exists ansible.builtin.file: state: directory diff --git a/roles/setup_pgbackrest/tasks/post_configure_pgbackrest.yml b/roles/setup_pgbackrest/tasks/post_configure_pgbackrest.yml index fc63a8d6b..a46a68768 100644 --- a/roles/setup_pgbackrest/tasks/post_configure_pgbackrest.yml +++ b/roles/setup_pgbackrest/tasks/post_configure_pgbackrest.yml @@ -9,17 +9,14 @@ when: - _pgbackrest_server_info|length == 0 -- name: Set _pgbackrest_host when not using hostname +- name: Set _pgbackrest_host ansible.builtin.set_fact: - _pgbackrest_host: "{{ _pgbackrest_server_info[0].ansible_host }}" - when: - - "not use_hostname|bool" - -- name: Set _pgbackrest_host when using hostname - ansible.builtin.set_fact: - _pgbackrest_host: "{{ _pgbackrest_server_info[0].inventory_hostname }}" - when: - - use_hostname|bool + _pgbackrest_host: >- + {% if use_hostname %} + {{ _pgbackrest_server_info[0].inventory_hostname }} + {% else %} + {{ _pgbackrest_server_info[0].private_ip }} + {% endif %} # get a list of nodes to update backup-standby setting in pgbackrest.conf # only pgbackrest and standby nodes set backup-standby=y @@ -58,6 +55,5 @@ - name: Reset local variables ansible.builtin.set_fact: _pgbackrest_server_info: "" - _pgbackrest_server_public_ip: null - _pgbackrest_host: Null - _update_config: Null + _pgbackrest_host: "" + _update_config: "" diff --git a/roles/setup_pgbackrest/tasks/setup_pgbackrest.yml b/roles/setup_pgbackrest/tasks/setup_pgbackrest.yml index 75194bc11..71e8c7955 100644 --- a/roles/setup_pgbackrest/tasks/setup_pgbackrest.yml +++ b/roles/setup_pgbackrest/tasks/setup_pgbackrest.yml @@ -21,8 +21,8 @@ - name: Check pgbackrest_archive_method value ansible.builtin.fail: msg: "pgBackRest archive method {{ pgbackrest_archive_method }} not supported." - when: > - pgbackrest_archive_method not in ['standard', 'async'] + when: + - pgbackrest_archive_method not in ['standard', 'async'] - name: Update /etc/hosts based on use_hostname become: true diff --git a/roles/setup_pgbackrest/tasks/validate_setup_pgbackrest.yml b/roles/setup_pgbackrest/tasks/validate_setup_pgbackrest.yml index 8328b266d..4a8eb882f 100644 --- a/roles/setup_pgbackrest/tasks/validate_setup_pgbackrest.yml +++ b/roles/setup_pgbackrest/tasks/validate_setup_pgbackrest.yml @@ -1,15 +1,19 @@ --- -- name: Get pgBackRest node informations +- name: Get pgBackRest server informations ansible.builtin.set_fact: - pgbackrest_server_node_info: "{{ lookup('edb_devops.edb_postgres.pgbackrest_server', wantlist=True) }}" + _pgbackrest_server_info: "{{ lookup('edb_devops.edb_postgres.pgbackrest_server', wantlist=True) }}" + +- name: Set _pgbackrest_server_private_ip + ansible.builtin.set_fact: + _pgbackrest_server_private_ip: "{{ _pgbackrest_server_info[0].private_ip }}" # validate command for configuration validation is successful - name: Run command to check if pgbackrest server has been configured correctly ansible.builtin.command: - cmd: pgbackrest --stanza={{ pg_instance_name }} check - become: true + cmd: "pgbackrest --stanza={{ pg_instance_name }} check" become_user: "{{ pgbackrest_user }}" - delegate_to: "{{ pgbackrest_server_node_info[0].inventory_hostname }}" + delegate_to: "{{ _pgbackrest_server_private_ip }}" + become: true run_once: true register: pgbackrest_config_check_res changed_when: pgbackrest_config_check_res.rc == '0' @@ -25,10 +29,10 @@ # validate backup exists on pgbackrest - name: Run command to check if backup for pgbackrest cluster was successful ansible.builtin.command: - cmd: pgbackrest --stanza={{ pg_instance_name }} info + cmd: "pgbackrest --stanza={{ pg_instance_name }} info" become: true become_user: "{{ pgbackrest_user }}" - delegate_to: "{{ pgbackrest_server_node_info[0].inventory_hostname }}" + delegate_to: "{{ _pgbackrest_server_private_ip }}" run_once: true register: pgbackrest_config_info_res changed_when: pgbackrest_config_info_res.rc == '0' @@ -44,10 +48,10 @@ # test archive repo for pgbackrest exists - name: Run command to check if pgbackrest archive repo was successfully configured ansible.builtin.command: - cmd: pgbackrest repo-ls + cmd: "pgbackrest repo-ls" become: true become_user: "{{ pgbackrest_user }}" - delegate_to: "{{ pgbackrest_server_node_info[0].inventory_hostname }}" + delegate_to: "{{ _pgbackrest_server_private_ip }}" run_once: true register: pgbackrest_config_repo_res changed_when: pgbackrest_config_repo_res.rc == '0' @@ -62,6 +66,8 @@ - name: Reset variables ansible.builtin.set_fact: + _pgbackrest_server_info: "" + _pgbackrest_server_private_ip: "" pgbackrest_config_check_res: null pgbackrest_config_info_res: null pgbackrest_config_repo_res: null diff --git a/roles/setup_pgbackrest/templates/pgbackrest_primary.async.conf.template b/roles/setup_pgbackrest/templates/pgbackrest_primary.async.conf.template index 2d8650b95..95db1adfa 100644 --- a/roles/setup_pgbackrest/templates/pgbackrest_primary.async.conf.template +++ b/roles/setup_pgbackrest/templates/pgbackrest_primary.async.conf.template @@ -7,10 +7,10 @@ repo1-host-user={{ pgbackrest_user }} repo1-host-type=ssh repo1-cipher-type={{ repo_cipher_type }} repo1-cipher-pass={{ repo_cipher_password }} -start-fast=y log-level-console={{ pgbackrest_log_level_console }} log-level-file={{ pgbackrest_log_level_file }} lock-path={{ pgbackrest_lock_path }} +start-fast=y [global:archive-get] process-max={{ process_max_recovery }} @@ -19,4 +19,4 @@ process-max={{ process_max_recovery }} process-max={{ process_max_backup }} [{{ pg_instance_name }}] -pg1-path={{ pg_data }} +pg1-path={{ pg_default_data }} diff --git a/roles/setup_pgbackrest/templates/pgbackrest_primary.standard.conf.template b/roles/setup_pgbackrest/templates/pgbackrest_primary.standard.conf.template index 3614a0b46..20b7b4166 100644 --- a/roles/setup_pgbackrest/templates/pgbackrest_primary.standard.conf.template +++ b/roles/setup_pgbackrest/templates/pgbackrest_primary.standard.conf.template @@ -11,4 +11,4 @@ lock-path={{ pgbackrest_lock_path }} start-fast=y [{{ pg_instance_name }}] -pg1-path={{ pg_data }} +pg1-path={{ pg_default_data }} diff --git a/roles/setup_pgbackrest/templates/pgbackrest_standby.async.conf.template b/roles/setup_pgbackrest/templates/pgbackrest_standby.async.conf.template index 009da6018..764996b64 100644 --- a/roles/setup_pgbackrest/templates/pgbackrest_standby.async.conf.template +++ b/roles/setup_pgbackrest/templates/pgbackrest_standby.async.conf.template @@ -18,12 +18,11 @@ process-max={{ process_max_recovery }} [global:archive-push] process-max={{ process_max_backup }} - [{{ pg_instance_name }}] -pg{{ _standby_index_var }}-path={{ pg_data }} +pg{{ _standby_index_var }}-path={{ pg_default_data }} {% if pg_type == 'PG' %} -recovery-option=primary_conninfo=host={{ primary_node_hostname[0] }} user={{ replication_user }} +recovery-option=primary_conninfo=host={{ primary_node_hostname[0] }} user={{ pg_replication_user }} {% endif %} {% if pg_type == 'EPAS' %} -recovery-option=primary_conninfo=host={{ primary_node_hostname[0] }} port={{ pg_port_epas }} user={{ replication_user }} +recovery-option=primary_conninfo=host={{ primary_node_hostname[0] }} port={{ pg_port }} user={{ pg_replication_user }} {% endif %} diff --git a/roles/setup_pgbackrest/templates/pgbackrest_standby.standard.conf.template b/roles/setup_pgbackrest/templates/pgbackrest_standby.standard.conf.template index c220869f0..98f91bb2e 100644 --- a/roles/setup_pgbackrest/templates/pgbackrest_standby.standard.conf.template +++ b/roles/setup_pgbackrest/templates/pgbackrest_standby.standard.conf.template @@ -11,10 +11,10 @@ lock-path={{ pgbackrest_lock_path }} start-fast=y [{{ pg_instance_name }}] -pg{{ _standby_index_var }}-path={{ pg_data }} +pg{{ _standby_index_var }}-path={{ pg_default_data }} {% if pg_type == 'PG' %} recovery-option=primary_conninfo=host={{ primary_node_hostname[0] }} user={{ replication_user }} {% endif %} {% if pg_type == 'EPAS' %} -recovery-option=primary_conninfo=host={{ primary_node_hostname[0] }} port={{ pg_port_epas }} user={{ replication_user }} +recovery-option=primary_conninfo=host={{ primary_node_hostname[0] }} port={{ pg_port }} user={{ replication_user }} {% endif %} diff --git a/roles/setup_pgbackrestserver/defaults/main.yml b/roles/setup_pgbackrestserver/defaults/main.yml index 2549afc2a..c5859e6f4 100644 --- a/roles/setup_pgbackrestserver/defaults/main.yml +++ b/roles/setup_pgbackrestserver/defaults/main.yml @@ -49,9 +49,12 @@ primary_pgbr_config_file: "/etc/pgbackrest.conf" # postgres instance name pg_instance_name: "main" +pg_replication_user: "repuser" + etc_hosts_lists: [] use_hostname: true update_etc_file: true +use_patroni: false supported_os: - CentOS7 diff --git a/roles/setup_pgbackrestserver/tasks/define_node_variables.yml b/roles/setup_pgbackrestserver/tasks/define_node_variables.yml index a3b16d74b..24742f7f9 100644 --- a/roles/setup_pgbackrestserver/tasks/define_node_variables.yml +++ b/roles/setup_pgbackrestserver/tasks/define_node_variables.yml @@ -20,48 +20,20 @@ - name: Get primary node informations if not use_hostname ansible.builtin.set_fact: - primary_node_hostname: "{{ pgbackrest_node_info | selectattr('node_type', 'equalto', 'primary') | map(attribute='ansible_host') }}" + primary_node_hostname: "{{ pgbackrest_node_info | selectattr('node_type', 'equalto', 'primary') | map(attribute='private_ip') }}" when: - "not use_hostname|bool" - name: Get standby node informations if any, if use_hostname ansible.builtin.set_fact: - standby_node_hostname: "{{ pgbackrest_node_info | selectattr('node_type', 'equalto', 'standby') | map(attribute='inventory_hostname') }}" + standby_node_hostname: "{{ pgbackrest_node_info | selectattr('node_type', 'equalto', 'standby') | map(attribute='inventory_hostname') | list | flatten }}" when: - use_hostname|bool - standby_present is defined - name: Get standby node informations if any, if not use_hostname ansible.builtin.set_fact: - standby_node_hostname: "{{ pgbackrest_node_info | selectattr('node_type', 'equalto', 'standby') | map(attribute='ansible_host') }}" + standby_node_hostname: "{{ pgbackrest_node_info | selectattr('node_type', 'equalto', 'standby') | map(attribute='private_ip') | list | flatten }}" when: - "not use_hostname|bool" - standby_present is defined - -- name: Define postgres user on primary node when pg_type = PG - ansible.builtin.set_fact: - primary_host_user: "postgres" - when: pg_type == 'PG' - -- name: Define postgres user on primary node when pg_type = EPAS - ansible.builtin.set_fact: - primary_host_user: "enterprisedb" - when: pg_type == 'EPAS' - -- name: Define EPAS DB information if RedHat - ansible.builtin.set_fact: - pg_unix_socket_epas: "/var/run/edb/as{{ pg_version }}" - pg_port_epas: "5444" - pg_database_name: "edb" - when: - - pg_type == 'EPAS' - - ansible_os_family == 'RedHat' - -- name: Define EPAS DB information if Debian - ansible.builtin.set_fact: - pg_unix_socket_epas: "/var/run/edb-as" - pg_port_epas: "5444" - pg_database_name: "postgres" - when: - - pg_type == 'EPAS' - - ansible_os_family == 'Debian' diff --git a/roles/setup_pgbackrestserver/tasks/generate_config.yml b/roles/setup_pgbackrestserver/tasks/generate_config.yml index e7520760a..447532e22 100644 --- a/roles/setup_pgbackrestserver/tasks/generate_config.yml +++ b/roles/setup_pgbackrestserver/tasks/generate_config.yml @@ -1,117 +1,71 @@ --- -- name: Build lines about standby's +- name: Build lines about standby's when PG ansible.builtin.set_fact: pgbackrest_standby_configuration: >- {{ pgbackrest_standby_configuration | default([]) + [ { 'key': 'pg' + standby_node.index_var + '-host' | string, - 'value': standby_node.inventory_hostname + 'value': _standby_pg_host_var }, { 'key': 'pg' + standby_node.index_var + '-path' | string, - 'value': pg_data + 'value': pg_default_data } ] }} loop: "{{ standby_node_info }}" loop_control: loop_var: standby_node + vars: + _standby_pg_host_var: >- + {% if use_hostname %} + {{ standby_node.inventory_hostname }} + {% else %} + {{ standby_node.private_ip }} + {% endif %} when: - - use_hostname|bool - pg_type == 'PG' - standby_present is defined -- name: Build lines about standby's +- name: Build lines about standby's when EPAS ansible.builtin.set_fact: pgbackrest_standby_configuration: >- {{ pgbackrest_standby_configuration | default([]) + [ { 'key': 'pg' + standby_node.index_var + '-host' | string, - 'value': standby_node.private_ip + 'value': _standby_pg_host_var }, { 'key': 'pg' + standby_node.index_var + '-path' | string, - 'value': pg_data - } - ] }} - loop: "{{ standby_node_info }}" - loop_control: - loop_var: standby_node - when: - - "not use_hostname|bool" - - pg_type == 'PG' - - standby_present is defined - -- name: Build lines about standby's - ansible.builtin.set_fact: - pgbackrest_standby_configuration: >- - {{ pgbackrest_standby_configuration | default([]) + [ - { - 'key': 'pg' + standby_node.index_var + '-host' | string, - 'value': standby_node.inventory_hostname - }, - { - 'key': 'pg' + standby_node.index_var + '-path' | string, - 'value': pg_data - }, - { - 'key': 'pg' + standby_node.index_var + '-host-user' | string, - 'value': 'enterprisedb' - }, - { - 'key': 'pg' + standby_node.index_var + '-database' | string, - 'value': pg_database_name - }, - { - 'key': 'pg' + standby_node.index_var + '-port' | string, - 'value': '5444' - }, - { - 'key': 'pg' + standby_node.index_var + '-socket-path' | string, - 'value': pg_unix_socket_epas - } - ] }} - loop: "{{ standby_node_info }}" - loop_control: - loop_var: standby_node - when: - - use_hostname|bool - - pg_type == 'EPAS' - - standby_present is defined - -- name: Build lines about standby's - ansible.builtin.set_fact: - pgbackrest_standby_configuration: >- - {{ pgbackrest_standby_configuration | default([]) + [ - { - 'key': 'pg' + standby_node.index_var + '-host' | string, - 'value': standby_node.private_ip - }, - { - 'key': 'pg' + standby_node.index_var + '-path' | string, - 'value': pg_data + 'value': pg_default_data }, { 'key': 'pg' + standby_node.index_var + '-host-user' | string, - 'value': 'enterprisedb' + 'value': pg_owner }, { 'key': 'pg' + standby_node.index_var + '-database' | string, - 'value': pg_database_name + 'value': pg_database }, { 'key': 'pg' + standby_node.index_var + '-port' | string, - 'value': '5444' + 'value': pg_port }, { 'key': 'pg' + standby_node.index_var + '-socket-path' | string, - 'value': pg_unix_socket_epas + 'value': pg_unix_socket_directories[0] } ] }} loop: "{{ standby_node_info }}" loop_control: loop_var: standby_node + vars: + _standby_pg_host_var: >- + {% if use_hostname %} + {{ standby_node.inventory_hostname }} + {% else %} + {{ standby_node.private_ip }} + {% endif %} when: - - "not use_hostname|bool" - pg_type == 'EPAS' - standby_present is defined @@ -148,6 +102,8 @@ when: - standby_present is defined -- name: Reset pgbackrest_conf_lines +- name: Reset variables ansible.builtin.set_fact: + pgbackrest_standby_configuration: "" + _standby_pg_host_var: "" pgbackrest_conf_lines: [] diff --git a/roles/setup_pgbackrestserver/templates/pgbackrest.conf.template b/roles/setup_pgbackrestserver/templates/pgbackrest.conf.template index 55356eb51..8cbed1cab 100644 --- a/roles/setup_pgbackrestserver/templates/pgbackrest.conf.template +++ b/roles/setup_pgbackrestserver/templates/pgbackrest.conf.template @@ -17,10 +17,10 @@ start-fast=y [{{ pg_instance_name }}] pg1-host={{ primary_node_hostname[0] }} -pg1-path={{ pg_data }} -pg1-host-user={{ primary_host_user }} +pg1-path={{ pg_default_data }} +pg1-host-user={{ pg_owner }} {% if pg_type == 'EPAS' %} -pg1-database={{ pg_database_name }} -pg1-port={{ pg_port_epas }} -pg1-socket-path={{ pg_unix_socket_epas }} +pg1-database={{ pg_database }} +pg1-port={{ pg_port }} +pg1-socket-path={{ pg_unix_socket_directories[0] }} {% endif %}