1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

Merge pull request #1207 from holta/dhcp2

Refining @jvonau's new fix for dhcp_service2
This commit is contained in:
A Holt 2018-10-09 17:36:07 -04:00 committed by GitHub
commit bca9512b89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 12 deletions

View file

@ -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

View file

@ -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
@ -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:
@ -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 }}"

View file

@ -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