URI Executing on SHELL not with Ansible YAML Task

12 views
Skip to first unread message

Ume

unread,
Jan 18, 2023, 10:44:00 PM1/18/23
to Ansible Development
I need help with Converting Following URI to Ansible Task which is failing

curl -k1 -u admin:admin  -X POST https://10.10.2.3/wapi/v2.11.5/fileop?_function=getgriddata -H "Content-Type: application/json" -d {"type": "BACKUP"}"

How to specify {"type":  "BACKUP"}

    uri:
      url: "https://{{ nios_provider.host }}/wapi/v2.11.5/fileop?_function=getgriddata"
      method: POST
      user: "{{ infoblox_username }}"
      password: "{{ infoblox_password }}"
      force_basic_auth: yes
      headers:
        Content-Type: "application/json"
      body: '{"file_name":"{{ backup_dest }}"}'
      body_format: json
      status_code: 200
      validate_certs: no
    register: backup_result

3.JPG
Reply all
Reply to author
Forward
0 new messages