diff --git a/roles/mgrote_munin_server/tasks/main.yml b/roles/mgrote_munin_server/tasks/main.yml index 016f67ae..5ea07e57 100644 --- a/roles/mgrote_munin_server/tasks/main.yml +++ b/roles/mgrote_munin_server/tasks/main.yml @@ -83,43 +83,25 @@ fi # cronjoib? timer? TODO - # sed -i "s/\*\/5/\*\/5/g" /etc/cron.d/munin kommt imho aus paket +- name: check if munin has been run + ansible.builtin.stat: + path: /var/cache/munin/www/index.html + register: placeholder + +- name: Template website placeholder + ansible.builtin.template: + src: placeholder.html + dest: /var/cache/munin/www/index.html + mode: '0644' + owner: munin + group: munin + when: not placeholder.stat.exists - -# generate node list -NODES=${NODES:-} -for NODE in $NODES -do - NAME=`echo $NODE | cut -d ':' -f1` - HOST=`echo $NODE | cut -d ':' -f2` - grep -q "${HOST}$" /etc/munin/munin.conf || cat << EOF >> /etc/munin/munin.conf -[$NAME] - address $HOST - use_node_name yes - -EOF -done - -# placeholder html to prevent permission error -if [ ! -f /var/cache/munin/www/index.html ]; then - cat << EOF > /var/cache/munin/www/index.html - -
-