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
Copy file name to clipboardExpand all lines: TOFS_pattern.md
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ Let's work with the NTP example. A basic formula that follows the [design guidel
70
70
71
71
In order to use it, let's assume a [masterless configuration](http://docs.saltstack.com/en/latest/topics/tutorials/quickstart.html) and this relevant section of `/etc/salt/minion`:
In `init.sls` we have the minimal states required to have NTP configured. In many cases `init.sls` is almost equivalent to an `apt-get install` or a `yum install` of the package.
{%- from 'ntp/map.jinja' import ntp with context %}
100
100
@@ -112,7 +112,7 @@ Enable and start NTP:
112
112
113
113
In `conf.sls` we have the configuration states. In most cases, that is just managing configuration file templates and making them to be watched by the service.
Under `files/default`, there is a structure that mimics the one in the minion in order to avoid clashes and confusion on where to put the needed templates. There you can find a mostly standard template for the configuration file.
# Edit pillars or override this template in saltstack if you need customization
@@ -163,7 +163,7 @@ With all this, it is easy to install and configure a simple NTP server by just r
163
163
164
164
Alternatively, you can define a highstate in `/srv/saltstack/salt/top.sls` and run `salt-call state.highstate`.
165
165
166
-
```
166
+
```sls
167
167
## /srv/saltstack/salt/top.sls
168
168
base:
169
169
'*':
@@ -172,15 +172,15 @@ base:
172
172
173
173
**Customizing the formula just with pillar data**, we have the option to define the NTP servers.
174
174
175
-
```
175
+
```sls
176
176
## /srv/saltstack/pillar/top.sls
177
177
base:
178
178
'*':
179
179
- ntp
180
180
```
181
181
182
182
183
-
```
183
+
```sls
184
184
## /srv/saltstack/pillar/ntp.sls
185
185
ntp:
186
186
servers:
@@ -195,7 +195,7 @@ ntp:
195
195
196
196
If the customization based on pillar data is not enough, we can override the template by creating a new one in `/srv/saltstack/salt/ntp/files/default/etc/ntp.conf.jinja`
If we want to cover the possibility of a special template for a minion identified by `node01` then we could have a specific template in `/srv/saltstack/salt/ntp/files/node01/etc/ntp.conf.jinja`.
0 commit comments