Reply

Enum Value Invalid - Not sure what this is telling me

Techie
Posts: 14
474     0

Here's my playbook and the error I'm getting.  It appears to be related to the CL_RTR_INT entensible attributes I'm setting using variables.

 

---
- name: test next ip
  hosts: 10.x.x.x
  connection: local
  gather_facts: False   

  vars:

    router_a:
      tunnel_a:
               network: 10.255.64.0/22
               rtr_a: 'Router A'
               rtr_a_int: 'Tunnel1'

 

  tasks:

       - name: Obtain Creds
         include_vars: "/automation/ansible/gitlab/infoblox_ip_clt_rem/ansible_vault/SVC-NET-TOWER-VAULT.yml"
        no_log: true

 

      - name: "Return next available IP address for router A tunnels"
        set_fact:
          tunnel1: "{{ lookup('nios_next_ip', router_a.tunnel_a.network, num=2, exclude=['10.x.x.1', '10.x.x.2', '10.x.x.3', '10.x.x.4', '10.x.x.5' ], provider=cli_infoblox ) }}"

    

      - name: dynamically add host record to next available tunnel ip
        infoblox.nios_modules.nios_host_record:
          name: "{{ item }}"
          dns: false
          ipv4:
            - address: "{{ item }}"
          comment: this is a test comment
          extattrs:
            Application_ID: A00000
            Client_Site_#: "{{ client_num }}-{{ client_name }} - ({{ city }}, {{ state }})"
            CL_RTR_INT: "[ {{ 'router_a.tunnel_a.rtr_a' }}, {{ 'router_a.tunnel_a.rtr_a_int' }} ]"
          state: present
          provider: "{{ cli_infoblox }}"
        loop:
          - '{{ tunnel1[0] }}'
        delegate_to: localhost

    

Error message is below. 

},

"item": "10.x.x.4",

"msg": "Enum Value Invalid: name: CL_RTR_INT, value: [ Router A, Tunnel1 ].",

"operation": "create_object",

"type": "AdmConDataError"

}

Router A and Tunnel1 are the correct extensible attribute names.

 

 

Re: Enum Value Invalid - Not sure what this is telling me

Techie
Posts: 14
475     0

so I figured out what I was doing wrong.

 

This:

CL_RTR_INT: "[ {{ 'router_a.tunnel_a.rtr_a' }}, {{ 'router_a.tunnel_a.rtr_a_int' }} ]"

 

was changed to this:

 

CL_RTR_INT: "{{ [ item.rtr_a, item.rtr_a_int ] }}"

 

Showing results for 
Search instead for 
Did you mean: 

Recommended for You