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

View file

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

View file

@ -1,11 +1,14 @@
--- ---
- name: include install-tasks - name: include install-tasks
ansible.builtin.include_tasks: install.yml ansible.builtin.include_tasks: install.yml
- name: include user tasks - name: include user tasks
ansible.builtin.include_tasks: user.yml ansible.builtin.include_tasks: user.yml
- name: include plugin-tasks - name: include plugin-tasks
ansible.builtin.include_tasks: additional.yml ansible.builtin.include_tasks: additional.yml
when: munin_node_plugins is defined when: munin_node_plugins is defined
- name: include remove-tasks - name: include remove-tasks
ansible.builtin.include_tasks: remove.yml ansible.builtin.include_tasks: remove.yml
when: munin_node_disabled_plugins is defined 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: ansible.builtin.file:
path: "{{ munin_plugin_dest_path }}{{ item }}" path: "{{ munin_plugin_dest_path }}{{ item }}"
state: absent state: absent
@ -7,7 +7,7 @@
notify: restart munin-node notify: restart munin-node
when: munin_node_disabled_plugins is defined when: munin_node_disabled_plugins is defined
- name: remove additional plugin-config - name: Ensure additional plugin-config is absent
ansible.builtin.file: ansible.builtin.file:
state: absent state: absent
dest: "{{ munin_plugin_conf_dest_path }}{{ item }}" dest: "{{ munin_plugin_conf_dest_path }}{{ item }}"

View file

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