Skip to content

Commit bca9512

Browse files
authored
Merge pull request #1207 from holta/dhcp2
Refining @jvonau's new fix for dhcp_service2
2 parents 09ce8bc + 15df488 commit bca9512

File tree

3 files changed

+31
-12
lines changed

3 files changed

+31
-12
lines changed

roles/network/defaults/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ services_externally_visible: False
6464

6565
# DNS / name resolution
6666
dhcpd_install: True
67-
dhcpd_enabled: True
68-
#dhcp_service: ???? # Set in individual OS's /opt/iiab/iiab/vars/<OS>.yml for use in roles/network/tasks/dhcpd.yml
69-
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
67+
dhcpd_enabled: False
68+
#dhcp_service: ???? # Set in individual OS's /opt/iiab/iiab/vars/<OS>.yml for use in roles/network/tasks/dhcpd.yml
69+
#dhcp_service2: "dhcpd disabled" # Moved to roles/network/tasks/computed_services.yml as community transitions from named/BIND to dnsmasq (PR #1202)
7070
named_install: True
7171
named_enabled: False
7272
dnsmasq_enabled: True

roles/network/tasks/computed_services.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
set_fact:
2424
named_enabled: True
2525
dhcpd_enabled: False
26-
dhcp_service2: "dhcpd"
26+
dhcp_service2: "dhcpd disabled"
2727
when: not dnsmasq_enabled and iiab_network_mode == "Appliance"
2828

2929
- name: LAN configured - non-dnsmasq
@@ -37,8 +37,17 @@
3737
set_fact:
3838
named_enabled: False
3939
dhcpd_enabled: False
40+
dnsmasq_enabled: True
4041
dhcp_service2: "dnsmasq"
41-
when: dnsmasq_install and dnsmasq_enabled and iiab_network_mode != "Appliance"
42+
when: dnsmasq_install and iiab_network_mode != "Appliance"
43+
44+
- name: LAN not configured - dnsmasq
45+
set_fact:
46+
named_enabled: False
47+
dhcpd_enabled: False
48+
dnsmasq_enabled: False
49+
dhcp_service2: "dnsmasq disabled"
50+
when: dnsmasq_install and iiab_network_mode == "Appliance"
4251

4352
- name: Add 'network' variable values (from computed_services.yml) to /etc/iiab/iiab.ini
4453
ini_file:
@@ -47,11 +56,21 @@
4756
option: "{{ item.option }}"
4857
value: "{{ item.value }}"
4958
with_items:
50-
- option: iiab_network_mode_applied
59+
- option: dansguardian_enabled
60+
value: "{{ dansguardian_enabled }}"
61+
- option: squid_enabled
62+
value: "{{ squid_enabled }}"
63+
- option: wondershaper_enabled
64+
value: "{{ wondershaper_enabled }}"
65+
- option: iiab_network_mode(applied)
5166
value: "{{ iiab_network_mode }}"
67+
- option: dhcpd_enabled
68+
value: "{{ dhcpd_enabled }}"
5269
- option: dhcp_service2
5370
value: "{{ dhcp_service2 }}"
71+
- option: named_enabled
72+
value: "{{ named_enabled }}"
5473
- option: dnsmasq_enabled
5574
value: "{{ dnsmasq_enabled }}"
56-
- option: no_net_restart
57-
value: "{{ no_net_restart }}"
75+
# - option: no_net_restart
76+
# value: "{{ no_net_restart }}"

roles/network/tasks/rpi_debian.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020
dest: /etc/dhcpcd.conf
2121
src: network/dhcpcd.conf.j2
2222

23-
- name: New raspbian requires country code -- check for it
23+
- name: New Raspbian requires country code -- check for it
2424
shell: grep country /etc/wpa_supplicant/wpa_supplicant.conf
2525
register: country_code
2626
ignore_errors: True
2727

28-
- name: Put a country code if it does not exist
28+
- name: Put country code ({{ host_country_code }}) in /etc/wpa_supplicant/wpa_supplicant.conf if nec
2929
lineinfile:
30-
dest: /etc/wpa_supplicant/wpa_supplicant.conf
30+
path: /etc/wpa_supplicant/wpa_supplicant.conf
3131
regexp: "^country.*"
3232
line: country={{ host_country_code }}
3333
when: country_code is defined and country_code.stdout == ""
3434

35-
- name: Enable the wifi with rfkill
35+
- name: Enable the WiFi with rfkill
3636
shell: rfkill unblock 0
3737
ignore_errors: True
3838

0 commit comments

Comments
 (0)