teemtee / fmf

Flexible Metadata Format
GNU General Public License v2.0
22 stars 28 forks source link

PoC of profiles support #196

Open jscotka opened 1 year ago

jscotka commented 1 year ago

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:

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
LecrisUT commented 1 year ago

How is this different then applying the profile yaml as a main.fmf? Maybe it has overlap with setting system/user/project metadata file/tree