-
Have a question and a possible use case where we want to be able to retrive system level environment variables from within our custom automate domain. Ive tried a to export a variable as both the root and manageiq user and tried to fetch it using ENV.fetch("MIQ_TEST"), but it returns an exception saying the key is not found. So Im curious if this is possible or not from within the automate datastore? Any assistance would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is not possible in automate because of the distributed nature of how it works. In a multi-appliance setup, you might export on one appliance, but then the next step of the state machine could run on a different appliance where that variable won't exist. Also note that in the future we are planning on isolating automate steps into containers so that they can't have access to the underlying system, and then if you export an ENV var in that case, then it definitely won't exist in a future step. Instead, it's probably better to use something like |
Beta Was this translation helpful? Give feedback.
This is not possible in automate because of the distributed nature of how it works. In a multi-appliance setup, you might export on one appliance, but then the next step of the state machine could run on a different appliance where that variable won't exist. Also note that in the future we are planning on isolating automate steps into containers so that they can't have access to the underlying system, and then if you export an ENV var in that case, then it definitely won't exist in a future step.
Instead, it's probably better to use something like
$evm.set_state_var
and$evm.get_state_var
if within a state machine, or you can store the value in$evm.root