diff --git a/roles/munin_client/tasks/lxc.yml b/roles/munin_client/tasks/lxc.yml new file mode 100644 index 0000000..682cd22 --- /dev/null +++ b/roles/munin_client/tasks/lxc.yml @@ -0,0 +1,29 @@ +--- + +# Useless junks for LXC +- name: Delete junks for LXC containers + ansible.builtin.file: + path: "/etc/munin/plugins/{{ item }}" + state: absent + notify: + - Restart munin-node + loop: + - acpi + - cpuspeed + - diskstats + - entropy + - irqstats + +# Per process CPU/RAM +- name: Add per process CPU/RAM metrics + ansible.builtin.copy: + src: "files/{{ item }}" + dest: "/etc/munin/plugins/{{ item }}" + mode: "0755" + owner: root + group: root + notify: + - Restart munin-node + loop: + - cpu_by_process + - memory_by_process diff --git a/roles/munin_client/tasks/main.yml b/roles/munin_client/tasks/main.yml index cbc38fe..622dd84 100644 --- a/roles/munin_client/tasks/main.yml +++ b/roles/munin_client/tasks/main.yml @@ -100,7 +100,7 @@ - Restart munin-node when: munin_need_reconfigure -## Useless junks for everyone +# Useless junks for everyone - name: Delete useless junks for everyone ansible.builtin.file: path: "/etc/munin/plugins/{{ item }}" @@ -109,22 +109,12 @@ loop: - users -## Useless junks for LXC -- name: Delete junks for LXC containers - ansible.builtin.file: - path: "/etc/munin/plugins/{{ item }}" - state: absent - notify: - - Restart munin-node +# Specific LXC commands +- name: Execute specific LXC commands + ansible.builtin.include_tasks: lxc.yml when: ansible_facts['virtualization_type'] == "lxc" - loop: - - acpi - - cpuspeed - - diskstats - - entropy - - irqstats -## Useless junks for hypervisors +# Useless junks for hypervisors - name: Execute delete states for hypervisors ansible.builtin.include_tasks: hypervisors.yml when: "'hypervisors' in group_names"