Fix configuration of Munin.
authorMatt Birkholz <matt@birchwood-abbey.net>
Thu, 18 Sep 2025 23:44:29 +0000 (17:44 -0600)
committerMatt Birkholz <matt@birchwood-abbey.net>
Fri, 19 Sep 2025 02:56:19 +0000 (20:56 -0600)
This apparently was incomplete.  Used the Ansible ~ini_file~ module to
delete the entire section(?), the default ~localhost.localdomain~
monitoring.

README.org
roles_t/abbey-cloister/tasks/main.yml
roles_t/abbey-core/tasks/main.yml

index bb949e1e53f0f91ce850524f99fa787605c2e870..7653c70b259628c72631b58cb8dc30a8358c624c 100644 (file)
@@ -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:
index 4c6e343a13f6fbd9112d77b2062e0aa75c965afd..0157013b2bac6334efc2e9928547488a99ec5d03 100644 (file)
   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:
index 633c2c3ac5c668e6c634462ca93d402962797972..d60f27d68526cdffcf9e068442b4c4e049d090fc 100644 (file)
 
 - 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