Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.

API & Integration, DevOps,NetOps,SecOps

Reply

Add CAA Record Using Ansible URI module

[ Edited ]
Authority
Posts: 17
143     0

I'm trying to add a CAA recording using Ansible but I don't see a module for this so I'm trying to add the record using the Ansible URI module.  It works when I use postman but fails using Ansible with a Bad Request error.  I have also tried a simple GET from an example from Infoblox and it also fails.  Not sure why.  Here's my code for the simple GET request for a member.

 

- name: Add CAA Record
  hosts: Infoblox
  collections: 
   - infoblox.nios_modules
  connection: local
  gather_facts: false
  vars_files: 
    - defaults/main.yml

  tasks:

    - name: Get object reference of the DNS service
      uri:
        url: https://GRD02NODE1.site/wapi/v2.11.2/member:dns?host_name=dns.net
        user: "{{ nios_provider.username }}"
        password: "{{ nios_provider.password }}"
        validate_certs: no
        return_content: yes
        method: GET
        force_basic_auth: yes
        status_code: 200
      register: content

This is the error:
    "msg": "Status code was 400 and not [200]: HTTP Error 400: Bad Request",
    "redirected": false,
    "referrer_policy": "no-referrer-when-downgrade",
    "status": 400,
    "strict_transport_security": "max-age=31536000; includeSubDomains",
    "url": "https://GRD02NODE1.site/wapi/v2.11.2/member:dns?host_name=dns.net",
    "x_content_type_options": "nosniff",
    "x_frame_options": "SAMEORIGIN",
    "x_xss_protection": "1; mode=block"

 

Showing results for 
Search instead for 
Did you mean: 

Recommended for You