From 165f2d727cdab5e8bb106f2551110778d8159fe6 Mon Sep 17 00:00:00 2001 From: Ion Dulgheru Date: Wed, 24 May 2017 18:17:05 +0300 Subject: [PATCH] Fix master_tops configuration rendering --- salt/files/master.d/f_defaults.conf | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/salt/files/master.d/f_defaults.conf b/salt/files/master.d/f_defaults.conf index 6e7cebe..fd797a3 100644 --- a/salt/files/master.d/f_defaults.conf +++ b/salt/files/master.d/f_defaults.conf @@ -746,14 +746,21 @@ rosters: {%- do default_keys.append('master_tops') %} master_tops: {%- for master in cfg_master['master_tops'] -%} - {%- if cfg_master['master_tops'][master] is string %} - {{ master }}: {{ cfg_master['master_tops'][master] }} - {%- else %} - {{ master}}: + {%- if cfg_master['master_tops'][master] is mapping %} + {{ master }}: {%- for parameter in cfg_master['master_tops'][master] %} {{ parameter }}: {{ cfg_master['master_tops'][master][parameter] }} {%- endfor -%} - {%- endif -%} + {%- elif cfg_master['master_tops'][master] is string %} + {{ master }}: {{ cfg_master['master_tops'][master] }} + {%- elif cfg_master['master_tops'][master] is iterable %} + {{ master }}: + {%- for item in cfg_master['master_tops'][master] %} + - {{ item }} + {%- endfor -%} + {%- else %} + {{ master }}: {{ cfg_master['master_tops'][master] }} + {% endif %} {%- endfor %} {% endif %}