From 315597fe6e721c90ecc656c6049d5a6d8fb36b0f Mon Sep 17 00:00:00 2001
From: Lars Beckers <lars.beckers@rwth-aachen.de>
Date: Wed, 11 Sep 2019 17:17:02 +0200
Subject: [PATCH] mrtg: fix ansible-lint issues

---
 mrtg/tasks/main.yml       | 10 +++++-----
 mrtg/tasks/weathermap.yml |  8 +++++---
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/mrtg/tasks/main.yml b/mrtg/tasks/main.yml
index 8a0ee13..52ce2b4 100644
--- a/mrtg/tasks/main.yml
+++ b/mrtg/tasks/main.yml
@@ -36,7 +36,7 @@
 
 - name: create the config  # noqa 301
   # yamllint disable-line rule:line-length
-  command: "cfgmaker --output /etc/mrtg.cfg {% for switch in mrtg_switches %} --ifdesc=alias {{switch['community']}}@{{switch['router']}}:::::2 {% endfor %}"
+  command: "cfgmaker --output /etc/mrtg.cfg {% for switch in mrtg_switches %} --ifdesc=alias {{ switch['community'] }}@{{ switch['router'] }}:::::2 {% endfor %}"
   tags: mrtg
 
 - name: ensure the mrtg user can read the mrtg config file
@@ -47,7 +47,7 @@
 
 - name: ensure the mrtg user can read and write directories
   file:
-    path: "{{item}}"
+    path: "{{ item }}"
     state: directory
     owner: mrtg
     group: mrtg
@@ -70,15 +70,15 @@
 
 - name: create an index HTML page  # noqa 301
   # yamllint disable-line rule:line-length
-  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"
+  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: true
   become_user: mrtg
   tags: mrtg
 
 - name: create separate index HTML pages  # noqa 301
   # yamllint disable-line rule:line-length
-  command: "indexmaker --output /var/www/mrtg/index-{{item['router']}}.html --title {{item['router']}}.{{domain}} --filter name=~{{item['router']}}_[0-9]+ --columns=3 --pagetop='<a href=\"index.html\">back</a>' /etc/mrtg.cfg"
-  with_items: "{{mrtg_switches}}"
+  command: "indexmaker --output /var/www/mrtg/index-{{ item['router'] }}.html --title {{ item['router'] }}.{{ domain }} --filter name=~{{ item['router'] }}_[0-9]+ --columns=3 --pagetop='<a href=\"index.html\">back</a>' /etc/mrtg.cfg"
+  with_items: "{{ mrtg_switches }}"
   become: true
   become_user: mrtg
   tags: mrtg
diff --git a/mrtg/tasks/weathermap.yml b/mrtg/tasks/weathermap.yml
index b64833f..8000545 100644
--- a/mrtg/tasks/weathermap.yml
+++ b/mrtg/tasks/weathermap.yml
@@ -27,6 +27,7 @@
 
 - name: get the weathermap package
   get_url:
+    # TODO check for updated versions
     # yamllint disable-line rule:line-length
     url: https://github.com/howardjones/network-weathermap/releases/download/version-0.98/php-weathermap-0.98.zip
     dest: /opt/weathermap.zip
@@ -60,15 +61,16 @@
 - name: get the weathermap colorscale
   get_url:
     dest: /root/colorscale.pal
+    # TODO use specific commit/tag instead of master
     # yamllint disable-line rule:line-length
-    url: "https://raw.githubusercontent.com/Gnuplotting/gnuplot-palettes/master/{{weathermap_colorscale}}.pal"
-    checksum: "{{weathermap_colorscale_hash}}"
+    url: "https://raw.githubusercontent.com/Gnuplotting/gnuplot-palettes/master/{{ weathermap_colorscale }}.pal"
+    checksum: "{{ weathermap_colorscale_hash }}"
   when: weathermap_colorscale is not none
   tags: weathermap
 
 - name: create the weathermap config
   # yamllint disable-line rule:line-length
-  script: "makeweather.py {{weathermap_placement_strategy}} --colorscale /root/colorscale.pal"
+  script: "makeweather.py {{ weathermap_placement_strategy }} --colorscale /root/colorscale.pal"
   tags: weathermap
 
 - name: upload the weathermap html file
-- 
GitLab