vitabaks / postgresql_cluster

PostgreSQL High-Availability Cluster (based on Patroni). Automating with Ansible.
https://postgresql-cluster.org
MIT License
1.69k stars 410 forks source link

add_pgnode.yml: Fix the list of hosts to configure pgbackrest #517

Closed vitabaks closed 11 months ago

vitabaks commented 11 months ago

Issue: https://github.com/vitabaks/postgresql_cluster/issues/516

If PgBackrest is configured as dedicated repository host in SSH mode, the SSH key exchange with the nodes of the "postgres_cluster" group is required.

Previously, only the 'new_replica' group was specified, which led to an error when exchanging keys.

Fixed:

TASK [pgbackrest : ssh_keys | Add database ssh keys in "~postgres/.ssh/authorized_keys" on pgbackrest server] ***************
fatal: [10.10.X.X]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'postgres_cluster_sshkey'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'postgres_cluster_sshkey'\n\nThe error appears to be in '/home/deployer/supplier_connect_dev/postgresql_cluster/roles/pgbackrest/tasks/ssh_keys.yml': line 63, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: ssh_keys | Add database ssh keys in \"~{{ pgbackrest_repo_user }}/.ssh/authorized_keys\" on pgbackrest server\n  ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n    with_items:\n      - {{ foo }}\n\nShould be written as:\n\n    with_items:\n      - \"{{ foo }}\"\n"}