tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Allow `when` key for step configs

Open lukaszachy opened this issue 1 year ago • 1 comments

For simple on/off of the config based on the context it will be much more readable than using 'adjust' and having to think about the final ordering of the configs.

No changes to the config will be allowed (no modification of values) just 'enable' config if when is evaluated true Compare:

adjust:
-  when: distro == fedora
   prepare+:
      - name: Fedora specific stuff
        how: shell
        script: <some script>
--snip more adjust rules and discover/provision/...---
prepare:
 - name: run this each time
   how: shell

with

prepare:
  - name: run this each time
    how: shell
  - name: Fedora specific stuff
        how: shell
        script: <some script>
        when: distro == fedora

lukaszachy avatar Feb 22 '24 14:02 lukaszachy