Hello,
I have this small playbook and t doesn't convert veriables:
---
- hosts: karma
user: root
sudo: True
tasks:
- shell: ls /images/KBU/ | grep MODULE | awk -F- '{print $4}' | awk -F. '{print $1}' | tail -1
register: MODULE
environment:
MODULE: "{{ MODULE }}"
- shell: echo "{{ MODULE }}"
----------------------------
at TASK: [shell echo "{{ MODULE_GOROCO }}"] **************************************
it failes, it echoes the hole stdout of ansible:
------------------
cmd:
echo "{u'changed': True, u'end': u'2015-01-12 08:30:33.137879', u'stdout': u'G10R00C00', u'cmd': u"ls /images/KBU/ | grep KBUONE | awk -F- '{print $4}' | awk -F. '{print $1}' | tail -1", u'rc': 0, u'start': u'2015-01-12 08:30:33.121037', u'stderr': u'', u'delta': u'0:00:00.016842', 'invocation': {'module_name': u'shell', 'module_args': u"ls /images/KBU/ | grep KBUONE | awk -F- '{print $4}' | awk -F. '{print $1}' | tail -1"}, 'stdout_lines': [u'G10R00C00'], u'warnings': []}"
stderr: tail: option used in invalid context -- 1
tail: option used in invalid context -- 1
-----------------
it should echo this: G10R00C00. How do I echo the content of a registered variable ?