Let me highlight the solution for the posterity :-)
If you want to register a variable based on a shell script:
- name: Register git version that is installed on system
> shell: git --version | sed 's/git\ version\ //g'
> register: git_version_output
> tags: register
>
You expect that the variable will store the output of the script. But this
is not the case
This wil store a dict/struct that stores many things:
the script itself, the timestamp of run, the exit value, etc
So if you are interested on simply the output itself, you need to address
it like:
- name: Dump git_installed_version to file
> debug: msg="success"
> when: *git_version_output.stdout* == {{ git_version }}
> tags: dump
>
Regards:
Bence
2015. március 13., péntek 14:37:06 UTC+1 időpontban Chris Short a
következőt írta:
>
> First facepalm of the day recorded at 9:35 AM. Thank you, Brian.
>
--
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/bb76b6d5-e789-48d9-917c-e461fcf47d46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.