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