dd
Some checks failed
ansible-lint / ansible-lint (pull_request) Failing after 3s
gitleaks / gitleaks (pull_request) Successful in 3s

This commit is contained in:
Michael Grote 2024-09-12 14:42:33 +02:00
parent ea303ee5c5
commit a4c8ddd898
5 changed files with 15 additions and 13 deletions

View file

@ -1,5 +1,5 @@
---
- name: download additional plugins
- name: Ensure additional plugins are downloaded
ansible.builtin.get_url:
url: "{{ item.src }}"
dest: "{{ munin_plugin_src_path }}{{ item.name }}"
@ -12,7 +12,7 @@
no_log: true
check_mode: false # damit werden auch im check-mode die Plugins heruntergeladen, sonst schlägt der nächste Task fehl
- name: enable additional plugins
- name: Enable additional plugins
ansible.builtin.file:
src: "{{ munin_plugin_src_path }}{{ item.name }}"
dest: "{{ munin_plugin_dest_path }}{{ item.name }}"
@ -21,7 +21,7 @@
loop: "{{ munin_node_plugins }}"
no_log: true
- name: copy additional plugin-config
- name: Template additional plugin-config
ansible.builtin.copy:
content: "{{ item.config }}"
dest: "{{ munin_plugin_conf_dest_path }}{{ item.name }}"
@ -33,7 +33,7 @@
when: item.config is defined
no_log: true
- name: Ensure munin-node is running.
- name: Ensure munin-node is running
ansible.builtin.service:
name: munin-node
state: started

View file

@ -1,5 +1,5 @@
---
- name: install packages
- name: Ensure packages are installed
ansible.builtin.apt:
name: munin-node
state: present
@ -7,7 +7,7 @@
- munin-node-configure --shell
- munin-node-configure --shell - 2
- name: create directories
- name: Ensure directories exist
ansible.builtin.file:
path: "{{ item }}"
state: directory
@ -15,11 +15,10 @@
group: root
mode: "0755"
loop:
- /etc/munin
- /etc/munin/plugin-conf.d
- /etc/munin/plugins
- name: Copy munin-node configuration.
- name: Template munin-node configuration
ansible.builtin.template:
src: munin-node.conf.j2
dest: /etc/munin/munin-node.conf

View file

@ -1,11 +1,14 @@
---
- name: include install-tasks
ansible.builtin.include_tasks: install.yml
- name: include user tasks
ansible.builtin.include_tasks: user.yml
- name: include plugin-tasks
ansible.builtin.include_tasks: additional.yml
when: munin_node_plugins is defined
- name: include remove-tasks
ansible.builtin.include_tasks: remove.yml
when: munin_node_disabled_plugins is defined

View file

@ -1,5 +1,5 @@
---
- name: remove unwanted plugins
- name: Ensure unwanted plugins are absent
ansible.builtin.file:
path: "{{ munin_plugin_dest_path }}{{ item }}"
state: absent
@ -7,7 +7,7 @@
notify: restart munin-node
when: munin_node_disabled_plugins is defined
- name: remove additional plugin-config
- name: Ensure additional plugin-config is absent
ansible.builtin.file:
state: absent
dest: "{{ munin_plugin_conf_dest_path }}{{ item }}"

View file

@ -1,11 +1,11 @@
---
- name: ensure group exists
- name: Ensure group exists
become: true
ansible.builtin.group:
name: "{{ munin_user_group }}"
state: present
- name: ensure user exists
- name: Ensure user exists
become: true
ansible.builtin.user:
name: munin
@ -13,7 +13,7 @@
shell: /usr/sbin/nologin
create_home: false
- name: add user to sudoers
- name: Ensure user is added to sudoers
become: true
ansible.builtin.blockinfile:
path: /etc/sudoers