2023-10-25 22:26:17 +02:00
|
|
|
---
|
2024-09-12 10:28:47 +02:00
|
|
|
- name: Ensure additional plugins are downloaded
|
2023-10-25 22:26:17 +02:00
|
|
|
ansible.builtin.get_url:
|
|
|
|
url: "{{ item.src }}"
|
|
|
|
dest: "{{ munin_plugin_src_path }}{{ item.name }}"
|
|
|
|
mode: '0755'
|
2024-09-12 10:28:47 +02:00
|
|
|
url_username: "{{ munin_node_plugins_repo_user | default(omit) }}"
|
|
|
|
url_password: "{{ munin_node_plugins_repo_user_pass | default(omit) }}"
|
|
|
|
force_basic_auth: true
|
2023-10-25 22:26:17 +02:00
|
|
|
loop: "{{ munin_node_plugins }}"
|
|
|
|
notify: restart munin-node
|
|
|
|
no_log: true
|
|
|
|
check_mode: false # damit werden auch im check-mode die Plugins heruntergeladen, sonst schlägt der nächste Task fehl
|
|
|
|
|
2024-09-12 10:28:47 +02:00
|
|
|
- name: Enable additional plugins
|
2023-10-25 22:26:17 +02:00
|
|
|
ansible.builtin.file:
|
|
|
|
src: "{{ munin_plugin_src_path }}{{ item.name }}"
|
|
|
|
dest: "{{ munin_plugin_dest_path }}{{ item.name }}"
|
|
|
|
state: link
|
|
|
|
notify: restart munin-node
|
|
|
|
loop: "{{ munin_node_plugins }}"
|
|
|
|
no_log: true
|
|
|
|
|
2024-09-12 10:28:47 +02:00
|
|
|
- name: Template additional plugin-config
|
2023-10-25 22:26:17 +02:00
|
|
|
ansible.builtin.copy:
|
|
|
|
content: "{{ item.config }}"
|
|
|
|
dest: "{{ munin_plugin_conf_dest_path }}{{ item.name }}"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0644"
|
|
|
|
notify: restart munin-node
|
|
|
|
loop: "{{ munin_node_plugins }}"
|
|
|
|
when: item.config is defined
|
|
|
|
no_log: true
|
|
|
|
|
2024-09-12 10:28:47 +02:00
|
|
|
- name: Ensure munin-node is running
|
2023-10-25 22:26:17 +02:00
|
|
|
ansible.builtin.service:
|
|
|
|
name: munin-node
|
|
|
|
state: started
|
|
|
|
enabled: true
|