From 6c4d42341c6d46189d3383a447e2c4cbb7726b97 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Fri, 19 Mar 2021 07:01:23 +0000 Subject: [PATCH] munin-server: Add all hosts to munin from inventory --- roles/munin-server/tasks/main.yml | 8 ++++++++ roles/munin-server/templates/hosts.conf.j2 | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 roles/munin-server/templates/hosts.conf.j2 diff --git a/roles/munin-server/tasks/main.yml b/roles/munin-server/tasks/main.yml index fc6a41b..c6780d7 100644 --- a/roles/munin-server/tasks/main.yml +++ b/roles/munin-server/tasks/main.yml @@ -64,6 +64,14 @@ owner: root group: "{{ ansible_wheel }}" +- name: create host config + template: + dest: /etc/munin/conf.d/hosts.conf + src: hosts.conf.j2 + mode: 0644 + owner: root + group: "{{ ansible_wheel }}" + - name: create override config copy: dest: /etc/munin/conf.d/00-override.conf diff --git a/roles/munin-server/templates/hosts.conf.j2 b/roles/munin-server/templates/hosts.conf.j2 new file mode 100644 index 0000000..5c33e39 --- /dev/null +++ b/roles/munin-server/templates/hosts.conf.j2 @@ -0,0 +1,5 @@ +{% for host in groups["all"] %} +[{{ host }}] + address {{ host }} + use_node_name yes +{% endfor %}