Pillar refactoring for ntp_servers
Prod related: (PROD:26777)
Change-Id: I197b8ae693ac25af0774085232c5cb37986873c4
diff --git a/maas/map.jinja b/maas/map.jinja
index 0671435..a1f0771 100644
--- a/maas/map.jinja
+++ b/maas/map.jinja
@@ -1,3 +1,11 @@
+{%- if pillar.get('maas', {}).get('region', {}).get('ntp', False) %}
+{%- set maas = salt['pillar.get']('maas', {}) %}
+{%- set ntp_servers = [] %}
+{%- for name,server in maas.region.ntp.items() if server.enabled %}
+ {{- ntp_servers.append (server.get('host', name))| default("", True) }}
+{%- endfor %}
+{%- do maas.region.maas_config.update({'ntp_servers': ntp_servers|join(',')}) %}
+{%- endif %}
{%- load_yaml as cluster_defaults %}
Debian: