From ee3faab4fd338bfb29e9d2b8fd90ededb8903d17 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Tue, 3 Dec 2019 11:27:00 +0100
Subject: [PATCH] ansible-inventories/arocom#2840 Sort dicts before looping
 through them

---
 templates/redirect.map.jinja2 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/redirect.map.jinja2 b/templates/redirect.map.jinja2
index b9eeef9..46bb4aa 100644
--- a/templates/redirect.map.jinja2
+++ b/templates/redirect.map.jinja2
@@ -1,9 +1,9 @@
-{% for key in proxy_redirect_maps[item]|default([]) %}
+{% for key in (proxy_redirect_maps[item]|default([]))|sort %}
 {{ key }} {{ proxy_redirect_maps[item][key] }}
 {% endfor %}
-{% for host in groups.all %}
+{% for host in groups.all|sort %}
 {% if hostvars[host].ansible_local is defined and hostvars[host].ansible_local.proxy_redirect_maps is defined %}
-{% for key in hostvars[host].ansible_local.proxy_redirect_maps[item]|default([]) %}
+{% for key in (hostvars[host].ansible_local.proxy_redirect_maps[item]|default([]))|sort %}
 {{ key }} {{ hostvars[host].ansible_local.proxy_redirect_maps[item][key] }}
 {% endfor %}
 {% endif %}
-- 
GitLab