variable registering everything, not just the stdout

Hi all,

In a role I have the following:

  • name: generate new UUID
    shell: uuidgen
    register: new_uuid

When I call the variable in the template I get everything, not just the UUID.

Example:

UUID={{ new_uuid }}

I get:

UUID={u’changed’: True, u’end’: u’2016-09-09 11:30:01.256488’, u’stdout’: u’f213d337-5c3b-4687-8061-70f74b49ed20’, u’cmd’: u’uuidgen’, u’start’: u’2016-09-09 11:30:01.251479’, u’delta’: u’0:00:00.005009’, u’stderr’: u’‘, u’rc’: 0, ‘stdout_lines’: [u’f213d337-5c3b-4687-8061-70f74b49ed20’], u’warnings’: }

All of my other registered variables work correctly, just this one is giving me a problem. Anyone know what I am doing wrong?

Thanks!

jamie

it is working as expected, you always get the full payload from the module, what you want is this:

UUID={{ new_uuid.stdout }}

Excellent. Thank you! I was tracking down that line of thinking but couldn’t find the right object.