Beginner Question - debug msg

Hi, i am an absolute beginner in ansible.

I try to output a greped text via debug and msg

THIS WORKS

- name: Check the Application version
command: /usr/bin/myscrpit.sh APPLICATIONNAME status | grep Version
register: version

The result is: SCM Version 6.2

THIS doesn’t work

- name: show the greped Version
debug: msg: " {{ version} "

But i received an error.

is the syntax wrong?

i tried : debug: msg: " {{ version.stdout } "

best regards
Alex

debug: msg: " {{ version}} " <= its {{ and }} not a single ending }

You also have a error in the syntax, you need to those between one of these

YAML syntax:

Hi,

also (unrelated to the other answers and your question), you want to
use the shell module (https://docs.ansible.com/ansible/latest/shell_module.html)
instead of the command module
(https://docs.ansible.com/ansible/latest/command_module.html) so the
piping to grep actually works.

Quoting from the documentation of the command module:

   "The given command will be executed on all selected nodes. It
    will not be processed through the shell, so variables like
    $HOME and operations like "<", ">", "|", ";" and "&" will not
    work (use the shell module if you need these features)."

*- name: Check the Application version*
* command: /usr/bin/myscrpit.sh APPLICATIONNAME status | grep
Version*
* register: version*

Cheers,
Felix

WOW. Thanks a lot for the great support.