Hi,

I have a varible that contains an array:

              "AuthenticationHTTPheader": [
                    "iv-user",
                    "iv-groups"
                ],
  

I need to pass this walue as a JSON-element in a body of a Request sent by 
URI module. So,

        body: 
            '{
                ...
                "remote_http_header": "{{ 
item.AuthenticationHTTPheader|default (d_remhed) }}",
                ...
            }'

in the output I see that URI module sends the following to the server:

                "remote_http_header": "[u'iv-user', u'iv-groups']",

here -> 
https://stackoverflow.com/questions/41521138/ansible-template-adds-u-to-array-in-template
 
<- I read, that " | to_json" could solve the problem, but in my case using 
this breaks down the whole json of the body, it's no more a json, but a 
string with escaped quotes:

..., \"remote_http_header\": \"[\"iv-user\", \"iv-groups\"]\",...

how can I send to the server this array? I need this to be sent to the 
server:


                "remote_http_header": [ "iv-user", "iv-groups"]


Thanks to everybody!

-- 
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/b097f4b8-31d1-44e9-872d-959c1e4ad27a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to