@@ -62,6 +62,14 @@ After making the checkout, source the virtualenv and Kayobe config environment v
62
62
kayobe# source venvs/kayobe/bin/activate
63
63
kayobe# source src/kayobe-config/kayobe-env
64
64
65
+ If you are using a Kayobe environment, you will instead need to specify which
66
+ environment to source. See the section Kayobe Environments for more details.
67
+
68
+ .. code-block :: console
69
+ :substitutions:
70
+
71
+ kayobe# source src/kayobe-config/kayobe-env --environment <env-name>
72
+
65
73
Set up any dependencies needed on the control host:
66
74
67
75
.. code-block :: console
@@ -155,3 +163,55 @@ From the seed host, the Bifrost container may be entered:
155
163
(bifrost-deploy)[root@seed bifrost-base]# baremetal node list
156
164
157
165
.. Consider adding a section about configuring the physical network.
166
+
167
+ Kayobe Environments
168
+ -------------------
169
+
170
+ Kayobe supports configuring multiple environments under
171
+ ``etc/kayobe/environments ``. These can be used to reduce duplicated configs
172
+ between systems. Any shared config can be defined under the base layer
173
+ ``etc/kayobe ``, and any system-specific config lives under
174
+ ``etc/kayobe/environments/<env-name> ``.
175
+
176
+ To use a specific environment with Kayobe, make sure to source its environment
177
+ variables:
178
+
179
+ .. code-block :: console
180
+ :substitutions:
181
+
182
+ kayobe# source src/kayobe-config/kayobe-env --environment <env-name>
183
+
184
+ The Kayobe inventory and configuration under the base layer ``etc/kayobe `` are
185
+ merged automatically with the environment layer under
186
+ ``etc/kayobe/environments/<env-name> ``. This means that files such as
187
+ ``globals.yml `` or any host/group vars can be defined either within or outside
188
+ of the environment. The base layer variables will be set on every system, and
189
+ any environment-specific variables will only be set on their systems. Variables
190
+ defined under an environment will take precedence over those defined in the
191
+ base layer.
192
+
193
+ The Kolla inventory under the base layer ``etc/kayobe/kolla/inventory `` is also
194
+ merged with the environment layer under
195
+ ``etc/kayobe/environments/<env-name>/kolla/inventory ``. However, Kolla config
196
+ files do not yet support this. As such, any shared configuration under
197
+ ``etc/kayobe/kolla/config `` will need to be symlinked into all environments
198
+ under ``etc/kayobe/environments/<env-name>/kolla/config ``. An additional caveat
199
+ is that only symlinked directories are supported. So any shared individual
200
+ files will unfortunately need to be duplicated in each environment.
201
+
202
+ If the majority of your Kolla config is intended to be shared, it is currently
203
+ recommended that you symlink the entire ``etc/kayobe/kolla/config `` directory,
204
+ and then template any specific variables based on the environment sources. For
205
+ example:
206
+
207
+ .. code-block :: console
208
+
209
+ ---
210
+ {% if kayobe_environment == "env-us" %}
211
+ region: US
212
+ {% elif kayobe_environment == "env-uk" %}
213
+ region: UK
214
+ {% endif %}
215
+
216
+ Please note that there is work ongoing to support the merging of Kolla
217
+ configuration in the future.
0 commit comments