From 09d49841fb34dd035ba9343bc79f41d0c42f4534 Mon Sep 17 00:00:00 2001 From: alecsandru Date: Fri, 3 May 2024 17:05:48 +0000 Subject: [PATCH] apend hosts --- haproxy.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/haproxy.yml b/haproxy.yml index 51229f5..17af1b7 100644 --- a/haproxy.yml +++ b/haproxy.yml @@ -33,4 +33,12 @@ service: name: haproxy enabled: true - state: started \ No newline at end of file + state: started + - name: append hosts to etc_hosts + blockinfile: + state: present + dest: /etc/hosts + content: | + {% for host in groups.all %} + {{ host }} {{ hostvars\[host\]\['hostname'\] }} + {% endfor %} \ No newline at end of file