From d16d4f74e1a3569a20b3f77a69c8c31348610fa3 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 14 Aug 2021 16:44:22 -0400 Subject: [PATCH] Cleaner computed_network.yml, computed_services.yml, enable_services.yml --- roles/network/tasks/computed_network.yml | 2 +- roles/network/tasks/computed_services.yml | 2 +- roles/network/tasks/enable_services.yml | 34 +++++++++++------------ 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/roles/network/tasks/computed_network.yml b/roles/network/tasks/computed_network.yml index 2f8ae3baf..730274380 100644 --- a/roles/network/tasks/computed_network.yml +++ b/roles/network/tasks/computed_network.yml @@ -153,7 +153,7 @@ - name: Add 'computed_network' variable values to {{ iiab_ini_file }} ini_file: - dest: "{{ iiab_ini_file }}" + dest: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: computed_network option: "{{ item.option }}" value: "{{ item.value | string }}" diff --git a/roles/network/tasks/computed_services.yml b/roles/network/tasks/computed_services.yml index b8f815c85..4b1c75cac 100644 --- a/roles/network/tasks/computed_services.yml +++ b/roles/network/tasks/computed_services.yml @@ -52,7 +52,7 @@ - name: Add 'network' variable values (from computed_services.yml) to {{ iiab_ini_file }} ini_file: - dest: "{{ iiab_ini_file }}" + dest: "{{ iiab_ini_file }}" # /etc/iiab/iiab.ini section: network option: "{{ item.option }}" value: "{{ item.value | string }}" diff --git a/roles/network/tasks/enable_services.yml b/roles/network/tasks/enable_services.yml index d7947892d..9284b546c 100644 --- a/roles/network/tasks/enable_services.yml +++ b/roles/network/tasks/enable_services.yml @@ -11,29 +11,29 @@ enabled: yes when: dhcpd_install and dhcpd_enabled -- name: Install /etc/sysconfig/dhcpd, /etc/dhcpd-iiab.conf from templates +- 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 }}" + # owner: root + # group: root + # mode: "{{ item.mode }}" with_items: - - { src: 'dhcp/dhcpd-env.j2', dest: '/etc/sysconfig/dhcpd', mode: '0644' } - - { src: 'dhcp/dhcpd-iiab.conf.j2', dest: '/etc/dhcpd-iiab.conf', mode: '0644' } + - { 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 +- 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 }}" + # owner: root + # group: root + # mode: "{{ item.mode }}" with_items: - - { src: 'named/named-iiab.conf.j2', dest: '/etc/named-iiab.conf', mode: '0644' } - - { src: 'named/school.local.zone.db', dest: '/var/named-iiab/', mode: '0644' } - - { src: 'named/school.internal.zone.db', dest: '/var/named-iiab/', mode: '0644' } + - { src: 'named/named-iiab.conf.j2', dest: '/etc/named-iiab.conf' } + - { src: 'named/school.local.zone.db', dest: '/var/named-iiab/' } + - { src: 'named/school.internal.zone.db', dest: '/var/named-iiab/' } when: named_install and named_enabled - name: Enable named service ({{ dns_service }}) if named_enabled @@ -93,13 +93,13 @@ #- debug: # var: nd_dir -- name: To restart dnsmasq whenever br0 comes up, install /etc/networkd-dispatcher/routable.d/dnsmasq.sh from template (if isn't Appliance, and directory /etc/networkd-dispatcher/routable.d exists, i.e. OS's like Ubuntu 18.04 or later) +- name: To restart dnsmasq whenever br0 comes up, install /etc/networkd-dispatcher/routable.d/dnsmasq.sh from template (if isn't Appliance, and directory /etc/networkd-dispatcher/routable.d exists, i.e. OS's like Ubuntu 18.04 or later) (root:root by default) template: src: roles/network/templates/network/dnsmasq.sh.j2 dest: /etc/networkd-dispatcher/routable.d/dnsmasq.sh mode: 0755 - owner: root - group: root + # 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: 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") @@ -205,7 +205,7 @@ # group: root mode: 0755 -- name: Install iiab-internet-on|off (root:root by default) +- name: Install /usr/bin/iiab-internet-on|off from template (root:root by default) template: src: "{{ item }}" dest: /usr/bin/