🚨: fix ansible-lint
All checks were successful
ansible-lint / lint-everything (push) Successful in 1m29s
All checks were successful
ansible-lint / lint-everything (push) Successful in 1m29s
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
- name: Check if .my.cnf file exists
|
- name: Check if .my.cnf file exists
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: /root/.my.cnf
|
path: /root/.my.cnf
|
||||||
register: dot_my_cnf
|
register: mariadb_dot_my_cnf
|
||||||
|
|
||||||
- name: Set root password
|
- name: Set root password
|
||||||
community.mysql.mysql_user:
|
community.mysql.mysql_user:
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
host: localhost
|
host: localhost
|
||||||
name: root
|
name: root
|
||||||
password: "{{ mariadb_root_pass }}"
|
password: "{{ mariadb_root_pass }}"
|
||||||
when: not dot_my_cnf.stat.exists
|
when: not mariadb_dot_my_cnf.stat.exists
|
||||||
|
|
||||||
- name: Put .my.cnf file
|
- name: Put .my.cnf file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
@@ -2,23 +2,23 @@
|
|||||||
|
|
||||||
- name: Set package fact
|
- name: Set package fact
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
muninpkgs:
|
munin_client_muninpkgs:
|
||||||
- muninlite
|
- muninlite
|
||||||
munin_need_reconfigure: false
|
munin_client_munin_need_reconfigure: false
|
||||||
when: ansible_facts['distribution'] == "LEDE" or ansible_facts['distribution'] == "OpenWRT" or ansible_facts['distribution'] == "OpenWrt"
|
when: ansible_facts['distribution'] == "LEDE" or ansible_facts['distribution'] == "OpenWRT" or ansible_facts['distribution'] == "OpenWrt"
|
||||||
|
|
||||||
- name: Set other packages fact
|
- name: Set other packages fact
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
muninpkgs:
|
munin_client_muninpkgs:
|
||||||
- munin-node
|
- munin-node
|
||||||
- munin-plugins-core
|
- munin-plugins-core
|
||||||
- munin-plugins-extra
|
- munin-plugins-extra
|
||||||
munin_need_reconfigure: true
|
munin_client_munin_need_reconfigure: true
|
||||||
when: ansible_facts['distribution'] == "Debian"
|
when: ansible_facts['distribution'] == "Debian"
|
||||||
|
|
||||||
- name: Install munin node packages
|
- name: Install munin node packages
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: "{{ muninpkgs }}"
|
name: "{{ munin_client_muninpkgs }}"
|
||||||
state: present
|
state: present
|
||||||
update_cache: true
|
update_cache: true
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
mode: "0o644"
|
mode: "0o644"
|
||||||
notify:
|
notify:
|
||||||
- Restart munin-node
|
- Restart munin-node
|
||||||
when: munin_need_reconfigure
|
when: munin_client_munin_need_reconfigure
|
||||||
|
|
||||||
## Adding modules for specific functions
|
## Adding modules for specific functions
|
||||||
# for NginX webservers
|
# for NginX webservers
|
||||||
@@ -98,14 +98,14 @@
|
|||||||
changed_when: true
|
changed_when: true
|
||||||
notify:
|
notify:
|
||||||
- Restart munin-node
|
- Restart munin-node
|
||||||
when: munin_need_reconfigure
|
when: munin_client_munin_need_reconfigure
|
||||||
|
|
||||||
# Useless junks for everyone
|
# Useless junks for everyone
|
||||||
- name: Delete useless junks for everyone
|
- name: Delete useless junks for everyone
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "/etc/munin/plugins/{{ item }}"
|
path: "/etc/munin/plugins/{{ item }}"
|
||||||
state: absent
|
state: absent
|
||||||
when: munin_need_reconfigure
|
when: munin_client_munin_need_reconfigure
|
||||||
loop:
|
loop:
|
||||||
- users
|
- users
|
||||||
|
|
||||||
|
@@ -5,14 +5,14 @@
|
|||||||
|
|
||||||
- name: Detect systemd-resolve
|
- name: Detect systemd-resolve
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
_systemd_resolve_enable: "{{ ansible_facts.udp_listen | selectattr('port', 'eq', 53) | selectattr('name', 'eq', 'systemd-resolve') | count > 0 }}"
|
nsd_systemd_resolve_enable: "{{ ansible_facts.udp_listen | selectattr('port', 'eq', 53) | selectattr('name', 'eq', 'systemd-resolve') | count > 0 }}"
|
||||||
|
|
||||||
- name: Deactivate DNS stublistener
|
- name: Deactivate DNS stublistener
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/systemd/resolved.conf
|
path: /etc/systemd/resolved.conf
|
||||||
regex: '^#DNSStubListener=yes'
|
regex: '^#DNSStubListener=yes'
|
||||||
line: DNSStubListener=no
|
line: DNSStubListener=no
|
||||||
when: _systemd_resolve_enable
|
when: nsd_systemd_resolve_enable
|
||||||
notify:
|
notify:
|
||||||
- Restart systemd-resolved
|
- Restart systemd-resolved
|
||||||
|
|
||||||
|
@@ -55,14 +55,14 @@
|
|||||||
- name: Stat associated keys
|
- name: Stat associated keys
|
||||||
ansible.builtin.stat:
|
ansible.builtin.stat:
|
||||||
path: "{{ nsd_default_etc_path }}/keys/{{ item.name }}/.ds"
|
path: "{{ nsd_default_etc_path }}/keys/{{ item.name }}/.ds"
|
||||||
register: _stat_keys
|
register: nsd_stat_keys
|
||||||
|
|
||||||
- name: Sign zone file
|
- name: Sign zone file
|
||||||
become: true
|
become: true
|
||||||
become_user: nsd
|
become_user: nsd
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
chdir: "{{ nsd_default_etc_path }}/keys/{{ item.name }}/"
|
chdir: "{{ nsd_default_etc_path }}/keys/{{ item.name }}/"
|
||||||
cmd: "ldns-signzone -o {{ item.name }} -u {{ nsd_default_etc_path }}/zones/{{ item.name }}.zone {{ (_stat_keys.stat.lnk_target | split('.'))[:-1] | join('.') }}"
|
cmd: "ldns-signzone -o {{ item.name }} -u {{ nsd_default_etc_path }}/zones/{{ item.name }}.zone {{ (nsd_stat_keys.stat.lnk_target | split('.'))[:-1] | join('.') }}"
|
||||||
changed_when: true
|
changed_when: true
|
||||||
|
|
||||||
- name: Reload zone
|
- name: Reload zone
|
||||||
|
@@ -10,5 +10,5 @@
|
|||||||
|
|
||||||
- name: Set default CA
|
- name: Set default CA
|
||||||
ansible.builtin.command: /etc/x509/acme.sh --set-default-ca --server letsencrypt
|
ansible.builtin.command: /etc/x509/acme.sh --set-default-ca --server letsencrypt
|
||||||
register: acme_output
|
register: x509_acme_output
|
||||||
changed_when: acme_output.rc != 0
|
changed_when: x509_acme_output.rc != 0
|
||||||
|
Reference in New Issue
Block a user