From 1aba1e56067a777724a67d5c6169d3d689e07e18 Mon Sep 17 00:00:00 2001 From: Jeltz Date: Sat, 7 Jan 2023 08:56:12 +0100 Subject: [PATCH] dhcpd: remove dhcpd__failover_peer --- playbooks/dhcpd.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 ...