From bb6b3c2ab252791b25ea0ad0ba2cd3f85bd1b440 Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Tue, 9 Oct 2018 11:48:40 -0500 Subject: [PATCH 1/5] Explicitly disable dnsmasq when in Appliance mode otherwise dnsmasq will become active upon reboot because enable_services.yml would still be acting upon local_vars.yml where dnsmasq_enabled is set to True while there is not LAN interface available to bind the service to. --- roles/network/defaults/main.yml | 2 -- roles/network/tasks/computed_services.yml | 11 ++++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index 017a268f0..b1917cca2 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -65,8 +65,6 @@ services_externally_visible: False # DNS / name resolution dhcpd_install: True dhcpd_enabled: True -#dhcp_service: ???? # Set in individual OS's /opt/iiab/iiab/vars/.yml for use in roles/network/tasks/dhcpd.yml -dhcp_service2: disabled # Proposed by @jvonau to solve #1184 -> PR #1185 during transition from named to dnsmasq, as required by roles/network/tasks/computed_services.yml named_install: True named_enabled: False dnsmasq_enabled: True diff --git a/roles/network/tasks/computed_services.yml b/roles/network/tasks/computed_services.yml index 9baa95dd1..e0e3470a4 100644 --- a/roles/network/tasks/computed_services.yml +++ b/roles/network/tasks/computed_services.yml @@ -37,8 +37,17 @@ set_fact: named_enabled: False dhcpd_enabled: False + dnsmasq_enabled: True dhcp_service2: "dnsmasq" - when: dnsmasq_install and dnsmasq_enabled and iiab_network_mode != "Appliance" + when: dnsmasq_install and iiab_network_mode != "Appliance" + +- name: LAN not configured - dnsmasq + set_fact: + named_enabled: False + dhcpd_enabled: False + dnsmasq_enabled: False + dhcp_service2: "dnsmasq" + when: dnsmasq_install and iiab_network_mode == "Appliance" - name: Add 'network' variable values (from computed_services.yml) to /etc/iiab/iiab.ini ini_file: From 9d616cf3018bf7ec2ea7891fca8fdc04ca5907dc Mon Sep 17 00:00:00 2001 From: Jerry Vonau Date: Tue, 9 Oct 2018 12:19:42 -0500 Subject: [PATCH 2/5] explicitly identify which primary dhcp server is being disabled dhcp_service2 is used in restart.yml when not in Appliance mode --- roles/network/tasks/computed_services.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/network/tasks/computed_services.yml b/roles/network/tasks/computed_services.yml index e0e3470a4..ada13d6ab 100644 --- a/roles/network/tasks/computed_services.yml +++ b/roles/network/tasks/computed_services.yml @@ -23,7 +23,7 @@ set_fact: named_enabled: True dhcpd_enabled: False - dhcp_service2: "dhcpd" + dhcp_service2: "dhcpd disabled" when: not dnsmasq_enabled and iiab_network_mode == "Appliance" - name: LAN configured - non-dnsmasq @@ -46,7 +46,7 @@ named_enabled: False dhcpd_enabled: False dnsmasq_enabled: False - dhcp_service2: "dnsmasq" + dhcp_service2: "dnsmasq disabled" when: dnsmasq_install and iiab_network_mode == "Appliance" - name: Add 'network' variable values (from computed_services.yml) to /etc/iiab/iiab.ini From 65972dafbce17873ef3f2d88bbce7cfb1550318d Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 9 Oct 2018 16:40:54 -0400 Subject: [PATCH 3/5] Update main.yml --- roles/network/defaults/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/network/defaults/main.yml b/roles/network/defaults/main.yml index b1917cca2..3188dc160 100644 --- a/roles/network/defaults/main.yml +++ b/roles/network/defaults/main.yml @@ -64,7 +64,9 @@ services_externally_visible: False # DNS / name resolution dhcpd_install: True -dhcpd_enabled: True +dhcpd_enabled: False +#dhcp_service: ???? # Set in individual OS's /opt/iiab/iiab/vars/.yml for use in roles/network/tasks/dhcpd.yml +#dhcp_service2: "dhcpd disabled" # Moved to roles/network/tasks/computed_services.yml as community transitions from named/BIND to dnsmasq (PR #1202) named_install: True named_enabled: False dnsmasq_enabled: True From eaf81d0d6be5cce027883247e489d43ae6bf197d Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 9 Oct 2018 16:52:20 -0400 Subject: [PATCH 4/5] Update computed_services.yml --- roles/network/tasks/computed_services.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/roles/network/tasks/computed_services.yml b/roles/network/tasks/computed_services.yml index ada13d6ab..73f9cfa61 100644 --- a/roles/network/tasks/computed_services.yml +++ b/roles/network/tasks/computed_services.yml @@ -56,11 +56,21 @@ option: "{{ item.option }}" value: "{{ item.value }}" with_items: - - option: iiab_network_mode_applied + - option: dansguardian_enabled + value: "{{ dansguardian_enabled }}" + - option: squid_enabled + value: "{{ squid_enabled }}" + - option: wondershaper_enabled + value: "{{ wondershaper_enabled }}" + - option: iiab_network_mode(applied) value: "{{ iiab_network_mode }}" + - option: dhcpd_enabled + value: "{{ dhcpd_enabled }}" - option: dhcp_service2 value: "{{ dhcp_service2 }}" + - option: named_enabled + value: "{{ named_enabled }}" - option: dnsmasq_enabled value: "{{ dnsmasq_enabled }}" - - option: no_net_restart - value: "{{ no_net_restart }}" +# - option: no_net_restart +# value: "{{ no_net_restart }}" From 15df488fcea0114ab6ce1f00512b9ef850c6f221 Mon Sep 17 00:00:00 2001 From: A Holt Date: Tue, 9 Oct 2018 17:21:25 -0400 Subject: [PATCH 5/5] Update rpi_debian.yml --- roles/network/tasks/rpi_debian.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/network/tasks/rpi_debian.yml b/roles/network/tasks/rpi_debian.yml index e56f8806e..1161d0ca6 100644 --- a/roles/network/tasks/rpi_debian.yml +++ b/roles/network/tasks/rpi_debian.yml @@ -20,19 +20,19 @@ dest: /etc/dhcpcd.conf src: network/dhcpcd.conf.j2 -- name: New raspbian requires country code -- check for it +- name: New Raspbian requires country code -- check for it shell: grep country /etc/wpa_supplicant/wpa_supplicant.conf register: country_code ignore_errors: True -- name: Put a country code if it does not exist +- name: Put country code ({{ host_country_code }}) in /etc/wpa_supplicant/wpa_supplicant.conf if nec lineinfile: - dest: /etc/wpa_supplicant/wpa_supplicant.conf + path: /etc/wpa_supplicant/wpa_supplicant.conf regexp: "^country.*" line: country={{ host_country_code }} when: country_code is defined and country_code.stdout == "" -- name: Enable the wifi with rfkill +- name: Enable the WiFi with rfkill shell: rfkill unblock 0 ignore_errors: True