Refactor caching-nameserver.yml for consistency and clarity in variable naming
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
# ---
|
# ---
|
||||||
# Install 'bind' apt based OS
|
# Install 'bind' apt based OS
|
||||||
@@ -7,7 +6,7 @@
|
|||||||
- name: (caching-nameserver.yml) update
|
- name: (caching-nameserver.yml) update
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
update_cache: true
|
update_cache: true
|
||||||
cache_valid_time: "{{ 0 if apt_config_updated is defined and apt_config_updated.changed else apt_update_cache_valid_time }}"
|
cache_valid_time: "{{ 0 if common_apt_config_updated is defined and common_apt_config_updated.changed else apt_update_cache_valid_time }}"
|
||||||
when:
|
when:
|
||||||
- ansible_facts["distribution"] == "Debian"
|
- ansible_facts["distribution"] == "Debian"
|
||||||
- apt_update|bool
|
- apt_update|bool
|
||||||
@@ -16,9 +15,9 @@
|
|||||||
|
|
||||||
- name: (caching-nameserver.yml) Configure any half-installed packages 'dpkg --configure -a'
|
- name: (caching-nameserver.yml) Configure any half-installed packages 'dpkg --configure -a'
|
||||||
ansible.builtin.command: dpkg --configure -a
|
ansible.builtin.command: dpkg --configure -a
|
||||||
register: _dpkg_configure
|
register: common_dpkg_configure
|
||||||
changed_when: (_dpkg_configure.stdout | default('')) | length > 0
|
changed_when: (common_dpkg_configure.stdout | default('')) | length > 0
|
||||||
failed_when: _dpkg_configure.rc != 0
|
failed_when: common_dpkg_configure.rc != 0
|
||||||
when:
|
when:
|
||||||
- ansible_facts["distribution"] == "Debian"
|
- ansible_facts["distribution"] == "Debian"
|
||||||
- apt_update|bool
|
- apt_update|bool
|
||||||
@@ -42,7 +41,7 @@
|
|||||||
state: present
|
state: present
|
||||||
when:
|
when:
|
||||||
- ansible_facts["distribution"] == "Debian"
|
- ansible_facts["distribution"] == "Debian"
|
||||||
- install_bind_packages|bool == true
|
- install_bind_packages|bool
|
||||||
tags:
|
tags:
|
||||||
- apt-caching-nameserver
|
- apt-caching-nameserver
|
||||||
|
|
||||||
@@ -53,7 +52,7 @@
|
|||||||
- name: (yum.yml) Install system updates for centos systems
|
- name: (yum.yml) Install system updates for centos systems
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
name: "*"
|
name: "*"
|
||||||
state: latest
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
# cache_valid_time: 3600
|
# cache_valid_time: 3600
|
||||||
when:
|
when:
|
||||||
@@ -110,7 +109,7 @@
|
|||||||
- name: Check if file '/etc/bind/named.conf.options' exists
|
- name: Check if file '/etc/bind/named.conf.options' exists
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: /etc/bind/named.conf.options
|
path: /etc/bind/named.conf.options
|
||||||
register: file_named_conf_options
|
register: common_file_named_conf_options
|
||||||
|
|
||||||
- name: (caching-nameserver.yml) update named.conf.options configuration file (gateway server)
|
- name: (caching-nameserver.yml) update named.conf.options configuration file (gateway server)
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
@@ -128,7 +127,7 @@
|
|||||||
when:
|
when:
|
||||||
- ansible_facts["distribution"] == "Debian"
|
- ansible_facts["distribution"] == "Debian"
|
||||||
- inventory_hostname in groups["gateway_server"]
|
- inventory_hostname in groups["gateway_server"]
|
||||||
# - not file_named_conf_options.stat.exists
|
# - not common_file_named_conf_options.stat.exists
|
||||||
|
|
||||||
# --------------------
|
# --------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user