Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions roles/network/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ services_externally_visible: False

# DNS / name resolution
dhcpd_install: True
dhcpd_enabled: True
#dhcp_service: ???? # Set in individual OS's /opt/iiab/iiab/vars/<OS>.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
dhcpd_enabled: False
#dhcp_service: ???? # Set in individual OS's /opt/iiab/iiab/vars/<OS>.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
Expand Down
29 changes: 24 additions & 5 deletions roles/network/tasks/computed_services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 disabled"
when: dnsmasq_install and iiab_network_mode == "Appliance"

- name: Add 'network' variable values (from computed_services.yml) to /etc/iiab/iiab.ini
ini_file:
Expand All @@ -47,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 }}"
8 changes: 4 additions & 4 deletions roles/network/tasks/rpi_debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down