On 24.05.16 20:59 skinnedknuckles wrote:

> I'm running a powershell script (from my playbook) that returns a number 
> via stdout.  How do I assign the result (*6999*) to my playbook variable 
> named machineId?

> *[ansmgr@dhcp1-60-20 playbooks]$ ansible-playbook deploy.ymlPLAY [deploy 
> new software version] *********************************************TASK 
> [setup] 
> *******************************************************************ok: 
> [ADS-6999]TASK [get machine id] 
> **********************************************************changed: 
> [ADS-6999]TASK [debug] 
> *******************************************************************ok: 
> [ADS-6999] => {    "out": {        "changed": true,         "rc": 0, 
>         "stderr": "",         "stdout": "6999\n",         "stdout_lines": 
> [            "6999"        ]    }}PLAY RECAP 
> *********************************************************************ADS-6999 
>                   
> : ok=3    changed=1    unreachable=0    failed=0   *
> 

I would say set_fact with machineID=out.stdout should do the trick.
But I am not sure if this does what you actually want to achieve.

Johannes

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5744B50F.2010604%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to