This PoC shows how the profiles could be solved.
Main idea there is that there are external YAML data passed to profile apply. It is similar to adjust and uses similar functions.
external yaml contains definition where it is applied (go thru all leaf nodes) and then _merge_special method is called and all other keys are applied.
With extension for "?" mark to apply something if not defined.
It solves several use cases:
be able to add/append/remove/override some steps
e.g. able to change provision method
e.g. add some extra provision steps
It is generic, so that you have to define the selector where to define where you want to apply data, e.g. plan is defined as execute is defined and discovery is defined
plan1_definition:
where: execute is defined cc and discover is defined
# append to prepare phase
prepare+:
name: some name
how: shell
script: systemctl start httpd
# create reporting if not defined
report?:
how: html
open: true
# override provision by own definition
provision:
how: virtual
image: fedora-37
test1_definition:
where: summary is defined and test is defined
new_attribute: hello world
test+: appended
This PoC shows how the profiles could be solved. Main idea there is that there are external
YAML
data passed to profile apply. It is similar to adjust and uses similar functions. external yaml contains definition where it is applied (go thru all leaf nodes) and then_merge_special
method is called and all other keys are applied. With extension for "?
" mark to apply something if not defined.It solves several use cases:
where
to define where you want to apply data, e.g. plan is defined asexecute is defined and discovery is defined