From eb726d710784bb1676042f3fe2f1b5b0bb47cb81 Mon Sep 17 00:00:00 2001 From: Matthew Fennell Date: Wed, 9 Sep 2026 22:54:41 +0100 Subject: Don't install prosody plugins by default I want to set up monitoring on fennell.dev and search.fennell.dev - neither of which have a postgres instance or should include other prosody-related plugins in the future. Therefore, configure a base set of plugins that should always be included, and let extra plugins / configuration be driven by extra_profiles. Over time, I'll want to create profile maps (containing config for the necessary packages/plugins to install/configure for that profile) to avoid unnecessary duplication of tasks, but for now, it's sufficient. --- munin-node/tasks/main.yml | 52 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 16 deletions(-) (limited to 'munin-node/tasks') diff --git a/munin-node/tasks/main.yml b/munin-node/tasks/main.yml index dde9572..f068eb5 100644 --- a/munin-node/tasks/main.yml +++ b/munin-node/tasks/main.yml @@ -7,12 +7,20 @@ - name: Ensure required packages are installed ansible.builtin.apt: name: - - libdbi-perl # Used by munin postgres plugins - munin-node # Graphs and monitoring state: present update_cache: true become: true +- name: Ensure prosody packages are installed + ansible.builtin.apt: + name: + - libdbi-perl # Used by munin postgres plugins + state: present + update_cache: true + when: "'prosody' in extra_profiles" + become: true + - name: Ensure munin-node tcp ports are open community.general.ufw: rule: allow @@ -33,7 +41,7 @@ become: true notify: Restart munin-node -- name: Ensure munin plugins are configured +- name: Ensure default plugins are configured ansible.builtin.file: src: "/usr/share/munin/plugins/{{ item.src }}" dest: "/etc/munin/plugins/{{ item.dest }}" @@ -80,6 +88,31 @@ dest: open_files - src: open_inodes dest: open_inodes + - src: proc_pri + dest: proc_pri + - src: processes + dest: processes + - src: swap + dest: swap + - src: threads + dest: threads + - src: uptime + dest: uptime + - src: users + dest: users + - src: vmstat + dest: vmstat + notify: Restart munin-node + +- name: Ensure prosody plugins are configured + ansible.builtin.file: + src: "/usr/share/munin/plugins/{{ item.src }}" + dest: "/etc/munin/plugins/{{ item.dest }}" + owner: root + group: root + state: link + become: true + with_items: - src: postgres_autovacuum dest: postgres_autovacuum - src: postgres_bgwriter @@ -114,18 +147,5 @@ dest: postgres_users - src: postgres_xlog dest: postgres_xlog - - src: proc_pri - dest: proc_pri - - src: processes - dest: processes - - src: swap - dest: swap - - src: threads - dest: threads - - src: uptime - dest: uptime - - src: users - dest: users - - src: vmstat - dest: vmstat + when: "'prosody' in extra_profiles" notify: Restart munin-node -- cgit v1.2.3