I would like to build an output that shows the key and value of a variable.
The following works perfectly ...
# Format in Ansible
msg="{{ php_command_result.results | map(attribute='item') | join(', ') }}"
# Output
{'value': {'svn_tag': '20150703r1_6.36_homeland'}, 'key': 'ui'}, {'value': {'svn_tag': '20150702r1_6.36_homeland'}, 'key': 'api'}
What I would like is to show the key
and svn_tag
together as so:
I'm able to display either the key
or svn_tag
but getting them to go together doesn't work.
msg="{{ php_command_result.results | map(attribute='item.key') | join(', ') }}"
# Output
ui, api
However, this is what I want.
# Desired Output
api - 20150702r1_6.36_homeland
ui - 20150703r1_6.36_homeland