ansible/roles/munin-node/tasks/main.yml

47 lines
1 KiB
YAML

---
- name: Gather instance facts
setup:
- name: Update APT package cache
apt:
update_cache: "true"
cache_valid_time: "3600"
tags:
- munin-node-install
- name: Install dependencies
package:
name: "{{ packages }}"
state: present
vars:
packages:
- munin-node
tags:
- munin-node-install
- name: Remove main munin process
apt:
name: "{{ packages }}"
state: absent
purge: yes
vars:
packages:
- munin
tags:
- munin-node-install
- block:
- name: Allow dispatcher to connect to munin-node
lineinfile:
line: "cidr_allow {{ munin_server }}/32"
path: "/etc/munin/munin-node.conf"
state: present
notify: restart munin-node
tags:
- munin-node-config
- name: Setup firewall rule
firewalld:
port: 4949/tcp
zone: public
permanent: yes
state: enabled
immediate: yes
tags:
- munin-node-config