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: doc/topics/releases/oxygen.rst
+188Lines changed: 188 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,6 +110,194 @@ file. For example:
110
110
111
111
These commands will run in sequence **before** the bootstrap script is executed.
112
112
113
+
New pillar/master_tops module called saltclass
114
+
----------------------------------------------
115
+
116
+
This module clones the behaviour of reclass (http://reclass.pantsfullofunix.net/), without the need of an external app, and add several features to improve flexibility.
117
+
Saltclass lets you define your nodes from simple ``yaml`` files (``.yml``) through hierarchical class inheritance with the possibility to override pillars down the tree.
118
+
119
+
**Features**
120
+
121
+
- Define your nodes through hierarchical class inheritance
122
+
- Reuse your reclass datas with minimal modifications
123
+
- applications => states
124
+
- parameters => pillars
125
+
- Use Jinja templating in your yaml definitions
126
+
- Access to the following Salt objects in Jinja
127
+
- ``__opts__``
128
+
- ``__salt__``
129
+
- ``__grains__``
130
+
- ``__pillars__``
131
+
- ``minion_id``
132
+
- Chose how to merge or override your lists using ^ character (see examples)
133
+
- Expand variables ${} with possibility to escape them if needed \${} (see examples)
134
+
- Ignores missing node/class and will simply return empty without breaking the pillar module completely - will be logged
135
+
136
+
An example subset of datas is available here: http://git.mauras.ch/salt/saltclass/src/master/examples
137
+
138
+
========================== ===========
139
+
Terms usable in yaml files Description
140
+
========================== ===========
141
+
classes A list of classes that will be processed in order
142
+
states A list of states that will be returned by master_tops function
143
+
pillars A yaml dictionnary that will be returned by the ext_pillar function
144
+
environment Node saltenv that will be used by master_tops
145
+
========================== ===========
146
+
147
+
A class consists of:
148
+
149
+
- zero or more parent classes
150
+
- zero or more states
151
+
- any number of pillars
152
+
153
+
A child class can override pillars from a parent class.
154
+
A node definition is a class in itself with an added ``environment`` parameter for ``saltenv`` definition.
155
+
156
+
**class names**
157
+
158
+
Class names mimic salt way of defining states and pillar files.
159
+
This means that ``default.users`` class name will correspond to one of these:
Escaped variables are rendered as is - ``${test}``
264
+
265
+
Missing variables are rendered as is - ``${net:dns:srv2}``
266
+
267
+
.. code-block:: yaml
268
+
269
+
pillars:
270
+
app:
271
+
config:
272
+
dns:
273
+
srv1: ${default:network:dns:srv1}
274
+
srv2: ${net:dns:srv2}
275
+
uri: https://application.domain/call?\${test}
276
+
prod_parameters:
277
+
- p1
278
+
- p2
279
+
- p3
280
+
pkg:
281
+
- app-core
282
+
- app-backend
283
+
284
+
List override:
285
+
286
+
Not using ``^`` as the first entry will simply merge the lists
287
+
288
+
.. code-block:: yaml
289
+
290
+
pillars:
291
+
app:
292
+
pkg:
293
+
- ^
294
+
- app-frontend
295
+
296
+
297
+
**Known limitation**
298
+
299
+
Currently you can't have both a variable and an escaped variable in the same string as the escaped one will not be correctly rendered - '\${xx}' will stay as is instead of being rendered as '${xx}'
0 commit comments