Create constants in oneprovision template

Hello

If I hardcode the values into the provision template it works fine, but I would like to use constants, especially because there are repeated values

For example:

defaults:
  configuration:
    oneprovision_hypervisor: 'lxc'

I tried defining the value with standard YAML

hypervisor: 'lxc'
...
    oneprovision_hypervisor: "{{hypervisor}}"

Im a missing something?

Hello @Samu,

You can use user inputs to achieve this, please check this.

Best,
Álex.

1 Like

Hello @ahuertas

Thanks for the answer, but i’m not trying to input the value, I want to set it as a constant on the template. Is it possible?

Hello @Samu,

That’s not possible, but you can achieve it by having user inputs with defaults values.

Best,
Álex.

1 Like

Thank @ahuertas :grinning:

1 Like