I need to use a
pip.installed
function in salt and pass it an argument
env_vars
with multiple params which should be eventually rendered to a python dictionary. It is okay if there were one parameter and the argument was expecting an argument of the type other than dictionary i then could pass it like so:
pip.installed:
- env_vars: my_var
But i need to pass a dict and im not sure how to do it.
Should it be a construct like:
pip.installed:
- env_vars:
- my_var1: var_value
- my_var2: var_value2
And how should i checked that my config actually renders to the correct form?
That answer is not correct, Salt will issue a warning.
pip.installed:
- env_vars:
my_var1: var_value
my_var2: var_value2
Warnings: 'my_var2' and 'my_var1' are invalid keyword arguments for
'pip.installed'. If you were trying to pass additional data to be
used in a template context, please populate 'context' with 'key:
value' pairs. Your approach will work until Salt Carbon is out.
Please update your state files.
The variables need to be nested another level deep like this:
pip.installed:
- env_vars:
my_var1: var_value
my_var2: var_value2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With