homeserver/roles/mgrote_munin_node/tasks/additional.yml
Michael Grote bc6f8fdc9e
All checks were successful
ansible-lint / gitleaks (push) Successful in 5s
ansible-lint / Ansible Lint (push) Successful in 1m0s
add no_log as global variable (#233)
Reviewed-on: #233
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Co-committed-by: Michael Grote <michael.grote@posteo.de>
2024-11-10 15:56:59 +01:00

40 lines
1.3 KiB
YAML

---
- name: Ensure additional plugins are downloaded
ansible.builtin.get_url:
url: "{{ item.src }}"
dest: "{{ munin_plugin_src_path }}{{ item.name }}"
mode: '0755'
url_username: "{{ munin_node_plugins_repo_user | default(omit) }}"
url_password: "{{ munin_node_plugins_repo_user_pass | default(omit) }}"
force_basic_auth: true
loop: "{{ munin_node_plugins }}"
notify: restart munin-node
no_log: "{{ no_debug | default('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
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: "{{ no_debug | default('true') }}"
- name: Template additional plugin-config
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: "{{ no_debug | default('true') }}"
- name: Ensure munin-node is running
ansible.builtin.service:
name: munin-node
state: started
enabled: true