diff --git a/mrtg/files/weathermap.html b/mrtg/files/weathermap.html new file mode 100644 index 0000000000000000000000000000000000000000..abab69cdf669a4de7f5f1b811f46cbe3dd1d25db --- /dev/null +++ b/mrtg/files/weathermap.html @@ -0,0 +1,11 @@ +<!doctype html> +<html> +<head> +<title>Weathermap</title> +<meta http-equiv="refresh" content="300" /> +<meta charset="utf-8" /> +</head> +<body> +<img src="weathermap.png"> +</body> +</html> diff --git a/mrtg/tasks/main.yml b/mrtg/tasks/main.yml index 5b05e2efab3d892dd38c49887e3f9121ba490a0a..8f88e6eca672b37c1ecdedc3e0d3470767853405 100644 --- a/mrtg/tasks/main.yml +++ b/mrtg/tasks/main.yml @@ -46,7 +46,7 @@ tags: mrtg - name: create an index HTML page - command: "indexmaker --output /var/www/mrtg/index.html --title='Traffic of {{domain}}' --columns=3 --pagetop='{% for switch in mrtg_switches %}<a href=\"index-{{switch['router']}}.html\"><b>{{switch['router']}}</b>.{{domain}}</a> {% endfor %} {% if use_weathermap %}<a href=\"weathermap.png\">Weathermap</a>{%endif %}' /etc/mrtg.cfg" + command: "indexmaker --output /var/www/mrtg/index.html --title='Traffic of {{domain}}' --columns=3 --pagetop='{% for switch in mrtg_switches %}<a href=\"index-{{switch['router']}}.html\"><b>{{switch['router']}}</b>.{{domain}}</a> {% endfor %} {% if use_weathermap %}<a href=\"weathermap.html\">Weathermap</a>{%endif %}' /etc/mrtg.cfg" become: yes become_user: mrtg tags: mrtg diff --git a/mrtg/tasks/weathermap.yml b/mrtg/tasks/weathermap.yml index de0162d659e61ba3875e5666c91a433063ba6873..c86d8a6f77394fe8e027eb0a762a54f1c81a6f9f 100644 --- a/mrtg/tasks/weathermap.yml +++ b/mrtg/tasks/weathermap.yml @@ -61,6 +61,15 @@ script: "makeweather.py {{weathermap_placement_strategy}} --colorscale /root/colorscale.pal" tags: weathermap +- name: upload the weathermap html file + copy: + src: weathermap.html + dest: /var/www/mrtg/ + owner: mrtg + group: www-data + mode: 0644 + tags: weathermap + - name: create the weathermap regularly cron: name: "create weathermap"