You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Edit pillars or override this template in saltstack if you need customization
137
-
{% set settings = salt['pillar.get']('ntp', {}) %}
138
-
{% set default_servers = ['0.ubuntu.pool.ntp.org',
137
+
{%- set settings = salt['pillar.get']('ntp', {}) %}
138
+
{%- set default_servers = ['0.ubuntu.pool.ntp.org',
139
139
'1.ubuntu.pool.ntp.org',
140
140
'2.ubuntu.pool.ntp.org',
141
141
'3.ubuntu.pool.ntp.org'] %}
@@ -146,9 +146,9 @@ filegen loopstats file loopstats type day enable
146
146
filegen peerstats file peerstats type day enable
147
147
filegen clockstats file clockstats type day enable
148
148
149
-
{% for server in settings.get('servers', default_servers) %}
149
+
{%- for server in settings.get('servers', default_servers) %}
150
150
server {{ server }}
151
-
{% endfor %}
151
+
{%- endfor %}
152
152
153
153
restrict -4 default kod notrap nomodify nopeer noquery
154
154
restrict -6 default kod notrap nomodify nopeer noquery
@@ -201,9 +201,9 @@ If the customization based on pillar data is not enough, we can override the tem
201
201
# Some bizarre configurations here
202
202
# ...
203
203
204
-
{% for server in settings.get('servers', default_servers) %}
204
+
{%- for server in settings.get('servers', default_servers) %}
205
205
server {{ server }}
206
-
{% endfor %}
206
+
{%- endfor %}
207
207
```
208
208
209
209
This way we are locally **overriding the template files** offered by the formula in order to make a more complex adaptation. Of course, this could be applied as well to any of the files, including the state files.
@@ -237,7 +237,7 @@ To make this work we need a `conf.sls` state file that takes a list of possible
237
237
include:
238
238
- ntp
239
239
240
-
{% from 'ntp/map.jinja' import ntp with context %}
240
+
{%- from 'ntp/map.jinja' import ntp with context %}
241
241
242
242
Configure NTP:
243
243
file.managed:
@@ -270,7 +270,7 @@ To make this work we could write a specially crafted `conf.sls`.
270
270
include:
271
271
- ntp
272
272
273
-
{% from 'ntp/map.jinja' import ntp with context %}
273
+
{%- from 'ntp/map.jinja' import ntp with context %}
274
274
275
275
Configure NTP:
276
276
file.managed:
@@ -293,8 +293,8 @@ We can simplify the `conf.sls` with the new `files_switch` macro to use in the `
293
293
include:
294
294
- ntp
295
295
296
-
{% from 'ntp/map.jinja' import ntp with context %}
297
-
{% from 'ntp/macros.jinja' import files_switch %}
296
+
{%- from 'ntp/map.jinja' import ntp with context %}
297
+
{%- from 'ntp/macros.jinja' import files_switch %}
0 commit comments