I’m trying our Morpheus variables and I would like to create a task type of (shell script) to return list of tags on a server or instance that has been deployed but it returns a null value in the output.
The abcTag returns nothing when ran in server context type and fooTag returns null
then when ran in instance context type the abcTag return null while the fooTag returns the label manually typed into box instead of tags created via options or Tag policy that was created, unless I’m missing something.
When working with variables in Morpheus, you need to make sure you specify the variable name and path correctly. As easy way to check this is to use a Python script to dump all of the variables in the instance/server context, and then view the output to make sure you are calling the correct variable.
Create a Python task in Morpheus with the following content:
You can then run this task on the instance and server. View the task output and you will be able to determine the correct variable name and path to reference.
It is useful to use a JSON formater to make the output easier to read. I did a quick test in my lab and set a tag called fooTag and label called mylabel during provisioning of an instance. I then ran the Python task above in the instance context and server context.
As the tag and label were applied during instance provisioning, you will see them in the instance context.
I searched through the variable output from the Pythion task and there are a few places where the tag and label are referenced: