Skip to content

Commit

Permalink
Change to avoid the error "AnsibleUndefinedVariable: 'ansible_hostnam…
Browse files Browse the repository at this point in the history
…e'" (#483)
  • Loading branch information
TommasoDb authored Oct 5, 2023
1 parent 3f64e32 commit e65abf1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions roles/haproxy/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---

- name: Gather facts for hosts postres_cluster
ansible.builtin.setup:
delegate_to: "{{ item }}"
delegate_facts: true
loop: "{{ groups['postgres_cluster'] }}"
when: hostvars[groups['postgres_cluster'][0]].ansible_hostname is not defined

# Install HAProxy from rpm/deb packages
# from repo
- block:
Expand Down

0 comments on commit e65abf1

Please sign in to comment.