HPE Morpheus Enterprise
1828413 Members
3509 Online
109977 Solutions
New Discussion

Can I use Morpheus variables with Ansible Command Options?

 
Not applicable

Can I use Morpheus variables with Ansible Command Options?

In Ansible task type, can morpheus variables be used in Command Options (execute target is set to Local) ? eg: <%=accountName%> ?

4 REPLIES 4
Not applicable

Re: Can I use Morpheus variables with Ansible Command Options?

okie, that is not available in MorpheusAccess

Not applicable

Re: Can I use Morpheus variables with Ansible Command Options?

but for a valid var it would evaluate

Not applicable

Re: Can I use Morpheus variables with Ansible Command Options?

There is also a huge “morpheus” extravar that is handed in to Ansible by default. You might run an Ansible playbook e.g.:

- hosts: all
  gather_facts: false
  tasks:
    - debug: var=morpheus

This will dump out the morpheus var to the console so you can see what’s in it. it’ll be unformatted, and for some reason the | to_nice_json and | to_nice_yaml filters don’t seem to work on it, even when the msg: argument is used for debug, but they DO work if you use the template module to dump the morpheus var to /tmp or something.

You can also add values to the ‘morpheus’ extravar in various ways, but you should look first to see if what you need is already there.

Not applicable

Re: Can I use Morpheus variables with Ansible Command Options?

worked with <%=account%>. The value of accountName is picked up.
 

host_list declined parsing /var/opt/morpheus/morpheus-ui/dynamic_inv/ST01/morpheusinv.yml