From: Matt Birkholz Date: Thu, 18 Sep 2025 23:44:29 +0000 (-0600) Subject: Fix configuration of Munin. X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=74e658c50372096d995b14f9ebbd67ef59a511ad;p=Network.git Fix configuration of Munin. This apparently was incomplete. Used the Ansible ~ini_file~ module to delete the entire section(?), the default ~localhost.localdomain~ monitoring. --- diff --git a/README.org b/README.org index bb949e1..7653c70 100644 --- a/README.org +++ b/README.org @@ -1328,9 +1328,10 @@ trends in resource usage. - name: Punt default Munin node. become: yes - replace: + ini_file: + section: "[localhost.localdomain]" + state: absent path: /etc/munin/munin.conf - regexp: '^\[localhost.*\n\n' - name: Configure actual Munin nodes. become: yes @@ -1720,6 +1721,14 @@ Each cloistered host is a Munin node. become: yes apt: pkg=munin-node +- name: Configure Munin Node. + become: yes + lineinfile: + regexp: "^allow [^]{{ core_addr|regex_escape }}[$]$" + line: "allow ^{{ core_addr|regex_escape }}$" + path: /etc/munin/munin-node.conf + notify: Restart Munin node. + - name: Add {{ ansible_user }} to munin group. become: yes user: diff --git a/roles_t/abbey-cloister/tasks/main.yml b/roles_t/abbey-cloister/tasks/main.yml index 4c6e343..0157013 100644 --- a/roles_t/abbey-cloister/tasks/main.yml +++ b/roles_t/abbey-cloister/tasks/main.yml @@ -31,6 +31,14 @@ become: yes apt: pkg=munin-node +- name: Configure Munin Node. + become: yes + lineinfile: + regexp: "^allow [^]{{ core_addr|regex_escape }}[$]$" + line: "allow ^{{ core_addr|regex_escape }}$" + path: /etc/munin/munin-node.conf + notify: Restart Munin node. + - name: Add {{ ansible_user }} to munin group. become: yes user: diff --git a/roles_t/abbey-core/tasks/main.yml b/roles_t/abbey-core/tasks/main.yml index 633c2c3..d60f27d 100644 --- a/roles_t/abbey-core/tasks/main.yml +++ b/roles_t/abbey-core/tasks/main.yml @@ -232,9 +232,10 @@ - name: Punt default Munin node. become: yes - replace: + ini_file: + section: "[localhost.localdomain]" + state: absent path: /etc/munin/munin.conf - regexp: '^\[localhost.*\n\n' - name: Configure actual Munin nodes. become: yes