vitabaks / postgresql_cluster

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

Change to avoid the error "AnsibleUndefinedVariable: 'ansible_hostname'" #483

Closed TommasoDb closed 1 year ago

TommasoDb commented 1 year ago

This commit fixes the error "AnsibleUndefinedVariable: 'ansible_hostname'". This error only occurs when the playbook balancers.yml is executed directly using the command

ansible-playbook balancers.yml

Host postgres_cluster is not part of this playbook, but their facts are needed in the template haproxy.cfg.j2

vitabaks commented 1 year ago

ok, thanks @TommasoDb