ansible uri and body format

30 views
Skip to first unread message

wane...@gmail.com

unread,
Apr 4, 2019, 5:41:11 AM4/4/19
to Ansible Project
Here are my body's model  

{
  "specs": [
    {
      "name": "test",
      "id": "7dcf2db8-858e-4c00-bbde-e0c5c734770c"
    }
  ]
}


trying to convert this last for uri module 
   body_format: json
   body:
    specs:
      id: "{{ item.0.uuid }}"
      name: "{{ item.2 }}"

how to convert this last correctly ? switch to raw ?

Matt Martz

unread,
Apr 4, 2019, 10:57:32 AM4/4/19
to ansible...@googlegroups.com
You want:

   body_format: json
   body:
    specs:
      - id: "{{ item.0.uuid }}"
        name: "{{ item.2 }}"

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/b9a41bd1-f609-45e8-9147-d2dfc777dec4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Jerome Denechaud

unread,
Apr 4, 2019, 4:35:46 PM4/4/19
to Ansible Project
Reply all
Reply to author
Forward
0 new messages