You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
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
J Hawkesworth
unread,
May 9, 2016, 10:48:19 AM5/9/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
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.
Petre Bandac
unread,
May 9, 2016, 10:51:23 AM5/9/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ivo Hechmann
Register: 'x' = script.stdout or something? :)
Hab's irgendwo gemacht, schicke dir morn ein Bispiu
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
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.