Commit f4a53748 authored by Chris Croome's avatar Chris Croome

tweaks

parent 83b96c20
Pipeline #7730 failed with stage
in 16 seconds
......@@ -33,7 +33,7 @@ munin_plugins_enabled:
- name: cpu
dir: /usr/lib/munin-c/plugins
file: munin-plugins-c
- name: "quota2percent_{{ munin_quota_disk.stdout | default(omit) }}"
- name: "quota2percent_{{ munin_quota_disk | default(omit) }}"
dir: /usr/local/share/munin/plugins
file: quota2percent_
- name: df
......
......@@ -24,14 +24,31 @@
- name: Find the first disk with quota enabled
shell: grep quota /etc/fstab | awk '{ print $1 }' | head -n1 | sed 's;/dev/;;'
register: munin_quota_disk
register: munin_quota_disk_check
tags:
- munin
- name: Get the names of users with quotas
shell: repquota -u -O csv /dev/xvda4 | grep -v ^User | grep -v 0,$ | awk -F, '{ print $1 }' | xargs
register: munin_quota_users
when: ( munin_quota_disk is defined ) and ( munin_quota_disk != "" )
tags:
- munin
- name:
block:
- name: Set a fact for munin_quota_disk
set_fact:
munin_quota_disk: "{{ munin_quota_disk_check.stdout }}"
tags:
- munin
- name: Get the names of users with quotas
shell: "repquota -u -O csv /dev/{{ munin_quota_disk }} | grep -v ^User | grep -v 0,$ | awk -F, '{ print $1 }' | xargs"
register: munin_quota_users_check
tags:
- munin
- name: Set a fact for munin_quota_users
set_fact:
munin_quota_users: "{{ munin_quota_users_check.stdout }}"
when: ( munin_quota_users_check is defined ) and ( munin_quota_users_check.stdout != "" )
tags:
- munin
when: ( munin_quota_disk_check is defined ) and ( munin_quota_disk_check.stdout != "" )
...
......@@ -173,7 +173,7 @@ env.regex_php ^[0-9]* php
{% if munin_quota_users is defined %}
[quota2percent_*]
user {{ munin_quota_users.stdout }}
user {{ munin_quota_users }}
env.low_uid never
{% endif %}
# vim: syntax=dosini
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment