diff --git a/playbooks/dhcpd.yml b/playbooks/dhcpd.yml index 2a33e19..b283d6f 100755 --- a/playbooks/dhcpd.yml +++ b/playbooks/dhcpd.yml @@ -58,11 +58,13 @@ dhcpd__failover: dhcp-1.isp.infra.auro.re: 10.210.1.1 dhcp-2.isp.infra.auro.re: 10.210.1.2 - dhcpd__failover_peer: "{{ dhcpd__failover.keys() - | select('!=', inventory_hostname) - | first }}" - dhcpd__failover_address: "{{ dhcpd__failover[dhcpd__failover_peer] }}" - dhcpd__failover_peer_address: "{{ dhcpd__failover[inventory_hostname] }}" + dhcpd__failover_address: "{{ dhcpd__failover[inventory_hostname] }}" + dhcpd__failover_peer_address: "{{ dhcpd__failover + | dict2items + | selectattr('key', '!=', + inventory_hostname) + | map(attribute='value') + | first }}" roles: - dhcpd ...