diff --git a/roles/mgrote_munin_server/defaults/main.yml b/roles/mgrote_munin_server/defaults/main.yml index 46ee4e39..66184a14 100644 --- a/roles/mgrote_munin_server/defaults/main.yml +++ b/roles/mgrote_munin_server/defaults/main.yml @@ -13,14 +13,8 @@ munin_packages: - curl tzdata - munin-node - libfile-readbackwards-perl -apt_packages_physical: - - hddtemp - - ipmitool - - powertop - - s-tui -apt_packages_vm: - - qemu-guest-agent - - open-vm-tools -apt_packages_extra: -apt_packages_absent: -apt_packages_internet: + +munin_servername: "{{ ansible_fwdn }}" +munin_dirs: + - /var/run/munin + - /etc/munin/plugins diff --git a/roles/mgrote_munin_server/tasks/main.yml b/roles/mgrote_munin_server/tasks/main.yml index 7426c582..ece4e4d3 100644 --- a/roles/mgrote_munin_server/tasks/main.yml +++ b/roles/mgrote_munin_server/tasks/main.yml @@ -10,24 +10,29 @@ src: /etc/munin/apache.conf dest: /etc/apache2/sites-available/000-default.conf +- name: Ensure needed dirs exists + ansible.builtin.file: + path: "{{ item }}" + state: directory + mode: '0755' + owner: munin + group: munin + loop: "{{ munin_dirs }}" +# (chfn -f 'munin' root) ??? TODO +- name: Enable fgcid + ansible.builtin.command: /usr/sbin/a2enmod fcgid # TODO CHANGED/when - - - (mkdir -p /var/run/munin && \ - chown -R munin:munin /var/run/munin) && \ - (chfn -f 'munin' root) && \ - (/usr/sbin/a2enmod fcgid) && \ - rm -rf /etc/munin/plugins && \ - mkdir -p /etc/munin/plugins +- name: Template munin-server plugins + ansible.builtin.template: + src: "{{ item }}" + dest: "/etc/munin/plugins/{{ item }}" + mode: '0755' + loop: "{{ munin_server_plugins }}" COPY run.sh /usr/local/bin/run -COPY munin_stats /etc/munin/plugins/munin_stats -COPY munin_update /etc/munin/plugins/munin_update -RUN chmod +x /etc/munin/plugins/munin_stats && \ - chmod +x /etc/munin/plugins/munin_update && \ chmod +x /usr/local/bin/run COPY logrotate-munin /etc/logrotate.d/munin