set_fact did the trick. We have splitted our playbooks in roles. Depending on the job, the "version" variable is defined or undefined (but required, and can be retrieved by another script). With set_fact I was able to define the variable as variable and not as task result.
Thank you ivo On Monday, May 9, 2016 at 4:48:19 PM UTC+2, J Hawkesworth wrote: > > You could use set_fact to store just the stdout into another variable, but > personally I wouldn't bother - you can just ignore the bits of the register > output that you don't care about. > > On Monday, May 9, 2016 at 1:53:15 PM UTC+1, Ivo Hechmann wrote: >> >> Hello team ansible >> >> How can I register the output of a script in a variable? Thus, not the >> script result object with all its attributes like stdout, stderr etc, but >> only catch the stdout and register as variable? >> >> Thank you very much for any hints... >> >> Ivo >> > -- 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/aa89bd46-3f8a-483a-a247-e8a14589e16f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
