Compare commits

..

1 Commits

Author SHA1 Message Date
Yohann Dedy 743b1cc15f Add areas 2020-04-17 09:39:06 +02:00
5 changed files with 24 additions and 18 deletions

View File

@ -21,15 +21,15 @@
- src: munin.conf.j2
dest: /etc/munin/munin.conf
- src: hosts.conf.j2
dest: "{{ munin_conf_d_directory }}/hosts.conf"
dest: "{{ munin_conf_d_directory }}/hosts-{{ munin_hosts_area }}.conf"
- name: Create munin user via htpasswd.
htpasswd:
create: true
name: "{{ munin_admin_user }}"
password: "{{ munin_admin_password }}"
path: /etc/munin/munin-htpasswd
state: present
#- name: Create munin user via htpasswd.
# htpasswd:
# create: true
# name: "{{ munin_admin_user }}"
# password: "{{ munin_admin_password }}"
# path: /etc/munin/munin-htpasswd
# state: absent
- name: Enable or disable the munin cron job.
lineinfile:

View File

@ -1,11 +1,8 @@
# Munin hosts.
{% for host in munin_hosts %}
[{{ host.name }}]
address {{ host.address }}
{% if host.extra is defined %}
{% for extra in host.extra %}
{{ extra }}
{% endfor %}
{% for host in groups[munin_hosts] %}
{% if host != inventory_hostname %}
[{{ host }}]
address {{ hostvars[host]['ansible_default_ipv4']['address'] }}
use_node_name yes
{% endif %}
{% endfor %}

View File

@ -0,0 +1,6 @@
# Munin hosts.
{% for host in munin_hosts %}
[{{ hostvars[host]['ansible_fqdn'] }}]
address {{ hostvars[host]['ansible_default_ipv4']['address'] }}
use_node_name yes
{% endfor %}

View File

@ -89,3 +89,6 @@ contact.{{ contact.name }}.always_send {{ contact.level }}
#contact.nagios.command /usr/bin/send_nsca nagios.host.comm -c /etc/nsca.conf
# Hosts are defined separately, in {{ munin_includedir }}
[{{ inventory_hostname }}]
address 127.0.0.1
use_node_name yes

View File

@ -1,6 +1,6 @@
---
munin_conf_d_directory: /etc/munin/munin-conf.d
munin_htmldir: /var/cache/munin/www
#munin_htmldir: /var/cache/munin/www
munin_includedir: /etc/munin/munin-conf.d