ansible-roles/munin/tasks/openbsd.yml

101 lines
1.8 KiB
YAML
Raw Normal View History

2017-03-27 16:56:17 +02:00
---
- name: Ensure that Munin is installed
openbsd_pkg:
name: '{{ item }}'
state: present
with_items:
- munin-server
- munin-node
tags:
- munin
- packages
- name: Set munin.conf file
template:
src: munin.conf.j2
dest: /etc/munin/munin.conf
mode: "0644"
tags:
- munin
- name: Create munin www directory
file:
path: '{{ munin_dir }}'
state: directory
owner: _munin
group: www
mode: "0755"
tags:
- munin
2017-03-28 19:39:38 +02:00
- name: Set munin-node config
template:
2017-03-30 15:32:05 +02:00
src: munin-node.conf.j2
2017-03-27 16:56:17 +02:00
dest: /etc/munin/munin-node.conf
2017-03-28 19:39:38 +02:00
mode: "0644"
2017-03-27 16:56:17 +02:00
notify: restart munin_node
tags:
- munin
- name: Install munin cron
copy:
src: "crontab"
dest: "/var/cron/tabs/_munin"
owner: "_munin"
group: "crontab"
tags:
- munin
- name: Enable munin plugins
file:
src: "/usr/local/libexec/munin/plugins/{{ item }}"
dest: "/etc/munin/plugins/{{ item }}"
state: link
with_items:
2017-03-30 15:32:05 +02:00
- cpu
- df
- df_inode
- load
- memory
- munin_stats
- netstat
- open_files
- pf_changes
- pf_searches
- pf_states
- processes
- systat
- uptime
- users
- vmstat
2017-03-27 16:56:17 +02:00
notify: restart munin_node
tags:
- munin
- name: Enable network graphs
file:
src: "/usr/local/libexec/munin/plugins/if_"
dest: "/etc/munin/plugins/if_{{ item }}"
state: link
2017-03-28 19:39:38 +02:00
notify: restart munin_node
2017-03-27 16:56:17 +02:00
with_items: "{{ ansible_interfaces }}"
- name: Enable sensors plugin unless VM detected
file:
2017-03-29 16:42:39 +02:00
src: /usr/local/libexec/munin/plugins/sensors_
2017-03-27 16:56:17 +02:00
dest: /etc/munin/plugins/sensors_temp
state: link
2017-03-30 15:32:05 +02:00
when: ansible_vio0 is undefined
2017-03-27 16:56:17 +02:00
notify: restart munin_node
tags:
- munin
- name: Activating munin_node
service:
name: munin_node
enabled: yes
state: started
tags:
- munin