forked from AFPy/infra
Julien Palard
308b6c2844
Like:
E: The value 'bookworm-backports' is invalid for APT::Default-Release as such a release is not available in the sources
E: The value 'bookworm-security' is invalid for APT::Default-Release as such a release is not available in the sources
E: The value 'bookworm-updates' is invalid for APT::Default-Release as
such a release is not available in the sources
But anyway « The plugin does not support this anymore. » : bc6450d8eb
59 lines
1.3 KiB
YAML
59 lines
1.3 KiB
YAML
---
|
|
|
|
- name: apt install munin-node
|
|
apt:
|
|
state: present
|
|
name: munin-node
|
|
register: install_munin
|
|
|
|
- name: Configure munin node
|
|
shell: munin-node-configure --shell | grep -v ip_ | sh
|
|
when: install_munin is changed
|
|
notify: munin
|
|
|
|
- name: Copy munin-node.conf
|
|
copy:
|
|
dest: /etc/munin/munin-node.conf
|
|
content: |
|
|
log_level 4
|
|
log_file /var/log/munin/munin-node.log
|
|
pid_file /var/run/munin/munin-node.pid
|
|
|
|
background 1
|
|
setsid 1
|
|
|
|
user root
|
|
group root
|
|
|
|
ignore_file [\#~]$
|
|
ignore_file DEADJOE$
|
|
ignore_file \.bak$
|
|
ignore_file %$
|
|
ignore_file \.dpkg-(tmp|new|old|dist)$
|
|
ignore_file \.rpm(save|new)$
|
|
ignore_file \.pod$
|
|
|
|
{% for host in groups["muninservers"] %}
|
|
allow ^{{ hostvars[host]['ansible_facts']['default_ipv6']['address'] }}$
|
|
{% endfor %}
|
|
allow ^127.0.0.1$
|
|
|
|
host *
|
|
port 4949
|
|
notify: munin
|
|
|
|
- name: Setup apt_all plugin
|
|
file:
|
|
src: /usr/share/munin/plugins/apt_all
|
|
dest: /etc/munin/plugins/apt_all
|
|
state: link
|
|
|
|
- name: Remove native munin apt update
|
|
# It is no longer supported
|
|
# and raises errors.
|
|
# The doc tells to use APT::Periodic::Update-Package-Lists "1"; instead.
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/cron.d/munin-node
|
|
state: absent
|
|
regexp: '/etc/munin/plugins/apt_all update'
|