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

remove named and dhcpd install options

This commit is contained in:
Jerry Vonau 2022-07-08 01:16:36 -05:00
parent 10ebd9441b
commit a9e92191db
40 changed files with 95 additions and 91 deletions

View file

@ -1,6 +1,6 @@
# NM-debian.yml
- name: Stopping services
include_tasks: down-debian.yml
#- name: Stopping services
# include_tasks: down-debian.yml
# provide keyfile layout like the XO's used way back.
#- name: Create uuid for NM's keyfile store

View file

@ -22,30 +22,30 @@
- name: No LAN configured - non-dnsmasq
set_fact:
named_enabled: True
dhcpd_enabled: False
# named_enabled: True
# dhcpd_enabled: False
dhcp_service2: "dhcpd disabled"
when: not dnsmasq_enabled and iiab_network_mode == "Appliance"
- name: LAN configured - non-dnsmasq
set_fact:
named_enabled: True
dhcpd_enabled: True
# named_enabled: True
# dhcpd_enabled: True
dhcp_service2: "dhcpd"
when: not dnsmasq_enabled and iiab_network_mode != "Appliance"
- name: LAN configured - dnsmasq
set_fact:
named_enabled: False
dhcpd_enabled: False
# named_enabled: False
# dhcpd_enabled: False
dnsmasq_enabled: True
dhcp_service2: "dnsmasq"
when: dnsmasq_install and iiab_network_mode != "Appliance"
- name: LAN not configured - dnsmasq
set_fact:
named_enabled: False
dhcpd_enabled: False
# named_enabled: False
# dhcpd_enabled: False
dnsmasq_enabled: True
dhcp_service2: "dnsmasq"
when: dnsmasq_install and iiab_network_mode == "Appliance"
@ -71,12 +71,12 @@
# 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: 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
@ -89,7 +89,7 @@
value: "{{ host_wifi_mode }}"
- option: host_channel
value: "{{ host_channel }}"
- name: Add 'network' variable 'current_client_channel' value if defined, to {{ iiab_ini_file }}
ini_file:
dest: "{{ iiab_ini_file }}"

View file

@ -62,7 +62,7 @@
regexp: "{{ iiab_wan_iface }}"
when: wan_ip != "dhcp" and iiab_wan_iface != "none" and is_debian and not is_debian_8
- include_tasks: down-debian.yml
#- include_tasks: down-debian.yml
- name: Reload systemd
systemd:

View file

@ -1,70 +1,72 @@
- name: Disable dhcpd service
service:
name: dhcpd
enabled: no
when: (dhcpd_install or dhcpd_installed is defined) and not dhcpd_enabled
#- name: Disable dhcpd service
# service:
# name: dhcpd
# enabled: no
# when: (dhcpd_install or dhcpd_installed is defined) and not dhcpd_enabled
# service is restarted with NM dispatcher.d script
- name: Enable dhcpd service
service:
name: dhcpd
enabled: yes
when: dhcpd_install and dhcpd_enabled
#- name: Enable dhcpd service
# service:
# name: dhcpd
# enabled: yes
# when: dhcpd_install and dhcpd_enabled
- name: Install /etc/sysconfig/dhcpd, /etc/dhcpd-iiab.conf from templates (root:root, 0644 by default)
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
#- name: Install /etc/sysconfig/dhcpd, /etc/dhcpd-iiab.conf from templates (root:root, 0644 by default)
# template:
# src: "{{ item.src }}"
# dest: "{{ item.dest }}"
# # owner: root
# group: root
# mode: "{{ item.mode }}"
# with_items:
# - { src: 'dhcp/dhcpd-env.j2', dest: '/etc/sysconfig/dhcpd' }
# - { src: 'dhcp/dhcpd-iiab.conf.j2', dest: '/etc/dhcpd-iiab.conf' }
# when: dhcpd_install and dhcpd_enabled
#- name: Install /etc/named-iiab.conf and two *.zone.db files into /var/named-iiab (root:root, 0644 by default)
# template:
# src: "{{ item.src }}"
# dest: "{{ item.dest }}"
# owner: root
# group: root
# mode: "{{ item.mode }}"
with_items:
- { src: 'dhcp/dhcpd-env.j2', dest: '/etc/sysconfig/dhcpd' }
- { src: 'dhcp/dhcpd-iiab.conf.j2', dest: '/etc/dhcpd-iiab.conf' }
when: dhcpd_install and dhcpd_enabled
# with_items:
# - { src: 'named/named-iiab.conf.j2', dest: '/etc/named-iiab.conf' }
# - { src: 'named/school.local.zone.db.j2', dest: '/var/named-iiab/school.local.zone.db' }
# - { src: 'named/school.internal.zone.db.j2', dest: '/var/named-iiab/school.internal.zone.db' }
# when: named_install and named_enabled
- name: Install /etc/named-iiab.conf and two *.zone.db files into /var/named-iiab (root:root, 0644 by default)
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
# owner: root
# group: root
# mode: "{{ item.mode }}"
with_items:
- { src: 'named/named-iiab.conf.j2', dest: '/etc/named-iiab.conf' }
- { src: 'named/school.local.zone.db.j2', dest: '/var/named-iiab/school.local.zone.db' }
- { src: 'named/school.internal.zone.db.j2', dest: '/var/named-iiab/school.internal.zone.db' }
when: named_install and named_enabled
#- name: Enable named service ({{ dns_service }}) if named_enabled
# systemd:
# name: "{{ dns_service }}"
# enabled: yes
# when: named_install and named_enabled
- name: Enable named service ({{ dns_service }}) if named_enabled
systemd:
name: "{{ dns_service }}"
enabled: yes
when: named_install and named_enabled
- name: Disable named service ({{ dns_service }}) if not named_enabled
systemd:
name: "{{ dns_service }}"
enabled: no
when: (named_install or named_installed is defined) and not named_enabled
#- name: Disable named service ({{ dns_service }}) if not named_enabled
# systemd:
# name: "{{ dns_service }}"
# enabled: no
# when: (named_install or named_installed is defined) and not named_enabled
- name: Install /etc/dnsmasq.d/iiab.conf from template, when dnsmasq_enabled and isn't Appliance
template:
src: network/dnsmasq.conf.j2
dest: /etc/dnsmasq.d/iiab.conf
when: dnsmasq_install and dnsmasq_enabled and (iiab_network_mode != "Appliance")
when: iiab_network_mode != "Appliance"
# when: dnsmasq_install and dnsmasq_enabled and (iiab_network_mode != "Appliance")
- name: Install /etc/hosts.dnsmasq from template for /etc/dnsmasq.d/iiab.conf (instead of using /etc/hosts)
template:
src: network/hosts-dnsmasq.j2
dest: /etc/hosts.dnsmasq
when: dnsmasq_install and dnsmasq_enabled and (iiab_network_mode != "Appliance")
when: iiab_network_mode != "Appliance"
# when: dnsmasq_install and dnsmasq_enabled and (iiab_network_mode != "Appliance")
- name: Update /etc/dnsmasq.d/dnsmasq-iiab for custom dns setting
template:
src: network/dnsmasq-iiab
dest: /etc/dnsmasq.d/dnsmasq-iiab
when: dnsmasq_install # 2020-05-10: Are all these dnsmasq_install conditions really still necessary ?
# when: dnsmasq_install # 2020-05-10: Are all these dnsmasq_install conditions really still necessary ?
## Another way to skin the cat
##- name: Check if systemd service networkd-dispatcher is enabled
@ -100,7 +102,8 @@
mode: 0755
# owner: root
# group: root
when: dnsmasq_install and dnsmasq_enabled and nd_dir.stat.exists and nd_dir.stat.isdir and (iiab_network_mode != "Appliance")
when: nd_dir.stat.exists and nd_dir.stat.isdir and (iiab_network_mode != "Appliance")
# when: dnsmasq_install and dnsmasq_enabled and nd_dir.stat.exists and nd_dir.stat.isdir and (iiab_network_mode != "Appliance")
#when: dnsmasq_install and dnsmasq_enabled and nd_enabled is defined and nd_enabled.stdout == "enabled" and nd_dir.stat.exists and nd_dir.stat.isdir and (iiab_network_mode != "Appliance")
#when: dnsmasq_install and dnsmasq_enabled and systemd_out.status.UnitFileState == "enabled" and networkd_dir.stat.exists and networkd_dir.stat.isdir and (iiab_network_mode != "Appliance")
@ -108,13 +111,13 @@
file:
path: /etc/dnsmasq.d/iiab.conf
state: absent
when: (not dnsmasq_enabled) or (iiab_network_mode == "Appliance")
when: iiab_network_mode == "Appliance"
- name: Enable iiab-dnsmasq systemd service, if dnsmasq_enabled
systemd:
name: iiab-dnsmasq
enabled: yes
when: dnsmasq_install and dnsmasq_enabled
# when: dnsmasq_install and dnsmasq_enabled
- name: Disable iiab-dnsmasq, if not dnsmasq_enabled
systemd:

View file

@ -62,14 +62,14 @@
# UNMAINTAINED
- name: Install named / BIND
include_tasks: roles/network/tasks/named.yml
when: named_install is defined and named_install
#- name: Install named / BIND
# include_tasks: roles/network/tasks/named.yml
# when: named_install is defined and named_install
# UNMAINTAINED
- name: Install dhcpd
include_tasks: roles/network/tasks/dhcpd.yml
when: dhcpd_install is defined and dhcpd_install
#- name: Install dhcpd
# include_tasks: roles/network/tasks/dhcpd.yml
# when: dhcpd_install is defined and dhcpd_install
# LESS MAINTAINED
- name: Install Squid

View file

@ -47,17 +47,17 @@
# include_tasks: wondershaper.yml
# when: wondershaper_install or wondershaper_installed is defined
- name: (Re)Install named
include_tasks: named.yml
when: named_install and FQDN_changed and iiab_stage|int == 9
# - name: (Re)Install named
# include_tasks: named.yml
# when: named_install and FQDN_changed and iiab_stage|int == 9
- name: (Re)Install dhcpd
include_tasks: dhcpd.yml
when: dhcpd_install and FQDN_changed and iiab_stage|int == 9
# - name: (Re)Install dhcpd
# include_tasks: dhcpd.yml
# when: dhcpd_install and FQDN_changed and iiab_stage|int == 9
- name: (Re)Install Squid
include_tasks: squid.yml
when: squid_install and FQDN_changed and iiab_stage|int == 9
# - name: (Re)Install Squid
# include_tasks: squid.yml
# when: squid_install and FQDN_changed and iiab_stage|int == 9
#preprep for backends
- name: Netplan in use on Ubuntu 18.04+

View file

@ -29,11 +29,11 @@
shell: netplan apply
when: wifi_up_down and is_ubuntu and netplan.stdout.find("yaml") != -1
- name: Start named service
systemd:
name: "{{ dns_service }}"
state: restarted
when: named_enabled and named_install
#- name: Start named service
# systemd:
# name: "{{ dns_service }}"
# state: restarted
# when: named_enabled and named_install
- name: Stop Squid service
systemd:
@ -98,7 +98,8 @@
#both interfaces.d and systemd-networkd should have br0 available and Appliance lacks br0
#keep an eye on legacy wifi installs where br0 is present but not 'online' with an ip address
#due to hostapd didn't go to a carrier state. All others should get dnsmasq restarted
- name: User choice of dnsmasq or dhcpd - restarting {{ dhcp_service2 }}
#- name: User choice of dnsmasq or dhcpd - restarting {{ dhcp_service2 }}
- name: Restarting {{ dhcp_service2 }}
systemd:
name: "{{ dhcp_service2 }}"
state: restarted

View file

@ -31,7 +31,7 @@
when: country_code is defined and country_code.stdout | length > 0
- name: Put country code ({{ host_country_code }}) in /etc/wpa_supplicant/wpa_supplicant.conf if nec
lineinfile:
lineinfile:
path: /etc/wpa_supplicant/wpa_supplicant.conf
regexp: "^country.*"
line: country={{ host_country_code }}
@ -54,8 +54,8 @@
src: network/dnsmasq-iiab
when: iiab_lan_iface == "br0"
- name: Stopping services
include_tasks: down-debian.yml
#- name: Stopping services
# include_tasks: down-debian.yml
- name: Reload systemd
systemd:

View file

@ -44,8 +44,8 @@
#when: wan_ip != "dhcp" and not is_ubuntu_18
- name: Stopping services
include_tasks: down-debian.yml
#- name: Stopping services
# include_tasks: down-debian.yml
- name: Reload systemd
systemd: