Pillar refactoring for ntp_servers
Prod related: PROD-26777
Change-Id: I197b8ae693ac25af0774085232c5cb37986873c4
(cherry picked from commit 26d3c6db7200f40bb1a35b273ee15cbdcd1275fd)
diff --git a/README.rst b/README.rst
index 4498472..a82ef15 100644
--- a/README.rst
+++ b/README.rst
@@ -28,6 +28,10 @@
user: username #OPTIONAL
password: password #OPTIONAL
theme: mirantis
+ ntp:
+ server_1:
+ enabled: true
+ host: pool.ntp.org
bind:
host: 192.168.0.10:5240
port: 5240
@@ -194,8 +198,6 @@
maas_name: cfg01
network_discovery: 'enabled'
active_discovery_interval: '600'
- ntp_external_only: true
- ntp_servers: 10.10.11.23 10.10.11.24
upstream_dns: 192.168.12.13
enable_http_proxy: true
default_min_hwe_kernel: ''
diff --git a/maas/map.jinja b/maas/map.jinja
index 99901eb..b4f3ac7 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: