I try to print the previously registered mosh_version variable using the ansible debug msg command like this:
- name: Print mosh version
debug: msg="Mosh Version: {{ mosh_version.stdout }}"
It doesn't work and prints the following error:
Note: The error may actually appear before this position: line 55, column 27
- name: Print mosh version
debug: msg="Mosh Version: {{ mosh_version.stdout }}"
^
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items:
- "{{ foo }}"
I tried
- name: Print mosh version
debug: msg=Mosh Version: "{{ mosh_version.stdout }}"
but this will just print "Mosh".
What's the best way to get this running?
- name: Print mosh version
debug: var=mosh_version.stdout_lines
– Tom Aac Jun 01 '15 at 12:30ok: [127.0.0.1] => { "var": { "mosh_version.stdout_lines": [ "mosh 1.2.4a [build mosh-1.2.4-57-g9eeb2fb]" ] } }this works, I'd really prefer the custom message though ;-) – Zulakis Jun 01 '15 at 12:37