THE GAME HAS CHANGED

Introducing Infoblox Universal DDI ManagementTM

Watch the launch to discover the new era of management for critical network services. Watch Now

API & Integration, DevOps,NetOps,SecOps

Reply

Unable to add naptr record in ansible playbook with: nios_naptr_record

New Member
Posts: 2
2329     0

Hi,

 

When I want to add a naptr record into the infoblox I get this error:

 

 FAILED! => {"changed": false, "code": "Client.Ibap.Data.Conflict", "msg": "The action is not allowed. A parent was not found.", "operation": "create_object", "type": "AdmConDataError"}

Adding a simple a record works!

 

This is the playbook I use:

---
- hosts: gridmaster
  connection: local
  gather_facts: false
  vars: 
    var_domain: sub.second.top
  
  
  
  vars_prompt:
      - name: "var_phone_nr"
        private: no
        prompt: "enter a Phone nr " 
  tasks
 
    - name: change to arpa 
      set_fact:
        phone_arpa: "{{ lookup('template', 'enum_nr.j2') }}"
    - name: set data
      set_fact:
        enum_data: "{{ phone_arpa + enum_domain }}"
        
        
    - name: Add naptr record
      nios_naptr_record:
        comment: 'Added with Ansible'
        name: enum_data
        flags: 'U'
        services: 'sip+E2U'
        regexp: '!^(.*)$!sip:\\1@NiceRegExp!'
        replacement: '.'
        view: "default"
        order: 10
        preference: 10
        state: present
        provider: '{{ nios_provider }}'
 
 

The ninja2 template just creates a simple e164 format of the phone nr. nothing else( noth worth to post here as it has nothing to do with the error and: tested with a simple record instead of the e164 format, but even that gives the same fatal error.

All ( network and dns ) views are correct, the zone's also excist ( tested to add a a record with same paramters ).

 

Re: Unable to add naptr record in ansible playbook with: nios_naptr_record

New Member
Posts: 2
2329     0

Very big pebcak issue this Smiley LOL

 

During all the testing and manipulating of the phone nr's I wrongly put the variable into the playbook:

 

      name: enum_data

should be:

      name: '{{ enum_data }}'

 

Now it works flawless.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You