From 6c41b074627833fa322252be8fb09fc17b7d6c02 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Jan 2021 11:48:00 -0500 Subject: [PATCH 1/6] Initialize vars in network/defaults/main.yml e.g. 'prior_gw_device: unset' --- roles/network/defaults/main.yml | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 186eb08c5..247a2f1f1 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -17,7 +17,7 @@ # Wi-Fi - IF NECESSARY, CUSTOMIZE THESE 6 VARIABLES IN /etc/iiab/local_vars.yml # host_country_code: US -# host_ssid: "Internet in a Box" +# host_ssid: Internet in a Box # host_wifi_mode: g # host_channel: 6 # hostapd_secure: False @@ -53,28 +53,28 @@ wireless_lan_present: False strict_networking: False iiab_demo_mode: False gui_static_wan: False -wan_cidr: +wan_cidr: "" virtual_network_devices: "-e ap0 -e lo -e br0 -e tun -e br- -e docker -e bridge0 -e veth" # Set defaults for discovery process as strings wifi1: "not found-1" wifi2: "not found-2" -exclude_devices: "none" -device_gw: "none" -prior_gw_device: "" +exclude_devices: none +device_gw: none +prior_gw_device: unset -iiab_wan_iface: "none" -iiab_lan_iface: "none" -discovered_lan_iface: "none" -discovered_wired_iface: "none" -discovered_wireless_iface: "none" +iiab_wan_iface: none +iiab_lan_iface: none +discovered_lan_iface: none +discovered_wired_iface: none +discovered_wireless_iface: none # Red Hat #iiab_wired_lan_iface: "none" #iiab_wireless_lan_iface: "none" has_WAN: False -has_ifcfg_gw: "none" -has_wifi_gw: "none" +has_ifcfg_gw: none +has_wifi_gw: none # Debian dhcpcd_result: "" @@ -83,10 +83,10 @@ network_manager_active: False systemd_networkd_active: False # The values here are default local variables -gui_wan_iface: "unset" -gui_static_wan_ip: "unset" -wondershaper_dspeed: "4096" -wondershaper_upspeed: "1024" +gui_wan_iface: unset +gui_static_wan_ip: unset +wondershaper_dspeed: 4096 +wondershaper_upspeed: 1024 # netplan fix_dispatcher: True @@ -105,7 +105,7 @@ fix_dispatcher: True # Above 2 vars set in /etc/iiab/local_vars.yml # captive_portal_port: "9090" # Above var set in /opt/iiab/iiab/vars/default_vars.yml -py_captive_portal_port: "9090" -py_captive_portal_username: "Admin" -py_captive_portal_password: "changeme" +py_captive_portal_port: 9090 +py_captive_portal_username: Admin +py_captive_portal_password: changeme # In a pinch, disable it by running: systemctl disable captive-portal From a53b0752b4865a2cb0dea607224d8fc30c4155ac Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Jan 2021 16:03:36 -0500 Subject: [PATCH 2/6] Ansible boolean/var types doc in validate_vars.yml --- roles/0-init/tasks/validate_vars.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/0-init/tasks/validate_vars.yml b/roles/0-init/tasks/validate_vars.yml index 5c79cc537..bded743e7 100644 --- a/roles/0-init/tasks/validate_vars.yml +++ b/roles/0-init/tasks/validate_vars.yml @@ -36,6 +36,11 @@ # 2020-07-08 - Excellent analysis & summary by Jon Spriggs: "In Ansible, # determine the type of a value, and casting those values to other types" # https://jon.sprig.gs/blog/post/1801 +# +# 2021-01-29 - ansible-base 2.10.5 (1) is more strict about empty string vars +# (2) no longer supports "when: myvar is boolean", "is integer" & "is float" +# (3) brings yet more "Ansible collection" dependency changes (undocumented!) +# Details: https://github.com/iiab/iiab/pull/2672 (see also #2669) # 3. "How do i fail a task in Ansible if the variable contains a boolean value? # I want to perform input validation for Ansible playbooks" From e4a0fab889bfc6100e15a69fd8fa83a7e54ccdc2 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Jan 2021 16:33:04 -0500 Subject: [PATCH 3/6] Mention "Ansible Collections" dep changes --- roles/0-init/tasks/validate_vars.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/0-init/tasks/validate_vars.yml b/roles/0-init/tasks/validate_vars.yml index bded743e7..25b0fda19 100644 --- a/roles/0-init/tasks/validate_vars.yml +++ b/roles/0-init/tasks/validate_vars.yml @@ -39,7 +39,7 @@ # # 2021-01-29 - ansible-base 2.10.5 (1) is more strict about empty string vars # (2) no longer supports "when: myvar is boolean", "is integer" & "is float" -# (3) brings yet more "Ansible collection" dependency changes (undocumented!) +# (3) brings yet more "Ansible Collections" dependency changes (undocumented!) # Details: https://github.com/iiab/iiab/pull/2672 (see also #2669) # 3. "How do i fail a task in Ansible if the variable contains a boolean value? From c3aa051770a9b5367f5c2c64eb3acc67c35fb078 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Jan 2021 18:47:20 -0500 Subject: [PATCH 4/6] Rename calibre-install-packages.sh.unusued to calibre-install-packages.sh.unused --- ...all-packages.sh.unusued => calibre-install-packages.sh.unused} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{calibre-install-packages.sh.unusued => calibre-install-packages.sh.unused} (100%) diff --git a/scripts/calibre-install-packages.sh.unusued b/scripts/calibre-install-packages.sh.unused similarity index 100% rename from scripts/calibre-install-packages.sh.unusued rename to scripts/calibre-install-packages.sh.unused From 0e7169cf1ff627aea1c568dd85a1e7b2cd07f3f0 Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Jan 2021 19:03:28 -0500 Subject: [PATCH 5/6] Update local_facts.fact --- scripts/local_facts.fact | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/local_facts.fact b/scripts/local_facts.fact index 311a00136..2a6458a35 100755 --- a/scripts/local_facts.fact +++ b/scripts/local_facts.fact @@ -92,9 +92,9 @@ tmp=$(ansible --version) && ANSIBLE_VERSION=$(echo "$tmp" | head -n 1 | cut -f 2 -d " ") -# THESE LAST 3 ARE DIFFEENT as "systemctl is-enabled" unhelpfully returns the -# same rerror code (i.e. 1) REGARDLESS whether service is (A) disabled or -# (B) doesn't exist. SO WE TEST THE STRING OUTPUT INSTEAD OF THE RETURN CODE. +# THE LAST 3 BELOW ARE DIFFERENT as "systemctl is-enabled" unhelpfully returns +# the same error code (i.e. 1) REGARDLESS whether the service is (A) disabled +# or (B) doesn't exist. SO WE TEST THE STRING OUTPUT INSTEAD OF THE RETURN CODE tmp=$(systemctl is-enabled dhcpcd) [[ $tmp != "" ]] && From b8311af03ab2d5e51f7c4f1a0af1ef0c89aa0cfb Mon Sep 17 00:00:00 2001 From: A Holt Date: Fri, 29 Jan 2021 20:56:24 -0500 Subject: [PATCH 6/6] Fix comment in network/defaults/main.yml --- roles/network/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 247a2f1f1..93e416cad 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -103,7 +103,7 @@ fix_dispatcher: True # captive_portal_install: False # captive_portal_enabled: False # Above 2 vars set in /etc/iiab/local_vars.yml -# captive_portal_port: "9090" +# captive_portal_port: 9090 # Above var set in /opt/iiab/iiab/vars/default_vars.yml py_captive_portal_port: 9090 py_captive_portal_username: Admin