From fb3849e390a057c6bf4e76f1e9fe4778d9657e76 Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 2 Sep 2019 21:50:37 -0400 Subject: [PATCH] remove quotes from boolean logic in Ansible jinja2 template --- roles/network/templates/network/dhcpcd.conf.j2 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/network/templates/network/dhcpcd.conf.j2 b/roles/network/templates/network/dhcpcd.conf.j2 index 5763df7ca..383e34d4c 100644 --- a/roles/network/templates/network/dhcpcd.conf.j2 +++ b/roles/network/templates/network/dhcpcd.conf.j2 @@ -57,20 +57,20 @@ static ip_address={{ lan_ip }}/19 static domain_name_servers=127.0.0.1 {% endif %} -# IIAB static IP configuration: +# IIAB static IP configuration, alongside optional DHCP & link-local: {% if wan_ip != "dhcp" %} profile {{ wan_gateway }} static ip_address={{ wan_ip }}/24 static routers={{ wan_gateway }} static domain_name_servers={{ wan_nameserver }} +{% if wan_can_use_dhcp_ip %} -{% if wan_can_use_dhcp_ip == "true" %} interface {{ iiab_wan_iface }} -{% if wan_link_local == "false" %} -arping 192.0.2.1 # Set Ethernet IP per "cablemodem" DHCP, if DHCP's on wire (after arp request to non-existent IP 192.0.2.1 intentionally fails, per RFC5737) -fallback {{ wan_gateway }} # If DHCP not detected after seconds, set Ethernet Static IP per "profile " +{% if not wan_link_local %} +arping 192.0.2.1 # Set Ethernet IP per "cablemodem" DHCP, if DHCP's on wire (after arp request to non-existent IP 192.0.2.1 fails on purpose, per RFC5737) +fallback {{ wan_gateway }} # If DHCP not detected after {{ dhcp_timeout }} seconds, set Ethernet Static IP per above "profile {{ wan_gateway }}" {% else %} -arping {{ wan_gateway }} # Perform up to 3 steps: 1. arp (if detected, set Ethernet Static IP per "profile ") 2. Set Ethernet IP per "cablemodem" DHCP, if DHCP's on wire 3. If nec, set Ethernet IP to a link-local address (169.254.x.y) +arping {{ wan_gateway }} # Perform up to 3 steps: 1. arp (if detected, set Ethernet Static IP per "profile {{ wan_gateway }}") 2. Set Ethernet IP per "cablemodem" DHCP, if DHCP's on wire 3. If nec, set Ethernet IP to a link-local address (169.254.x.y) {% endif %} {% endif %} {% endif %}