Hi,
This looks like the right place for posting questions- but please point me
in the right direction if not.
I'm using the "extra variables" box on the awx web front-end to provide
key-value pairs to a shell script in my playbook. The problem I'm having is
how I can use those variables in my shell script, as they all appear as
{u'key': u'value'} when I print them from within my shell script. This
means that they don't conform to the standard JSON format (which uses
double-quotes) and also as these are unicode strings I'm having other
issues trying to pull out the information I want. What I would like is to
easily put these key-value pairs into an associative array so I can access
the values when they're required. Is there a good way to do this? At the
moment I'm having to use sed to substitute out the bits I don't want (the
single quotes have to be converted to double quotes and I have to remove
the "u" character and then pass this to a package called jq to read the
string as a JSON object). This feels like the wrong approach, so I'm look
for some advice or examples of whether this can be done more elegantly?
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/d04dc999-d042-46b2-af50-c543443d7190%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.