Reply

Create network using ansible

New Member
Posts: 2
1911     0

Hello,

we are testing the creation of the network via ansible tasks from our playbook above

tasks:
- name: create network
infoblox.nios_modules.nios_network:
network: 192.168.5.0/24
network_view: default
options:
- name: domain-name
value: dc01-dev
extattrs:
Site: test site
comment: Created with Ansible
state: present
provider: "{{ nios_provider }}"

i have an error
AdmConProtoError: Field is not readable: template code Client.Ibap.Proto\" text\": \"Field is not readable: template\"\\n}'\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.8/site-packages/infoblox_client/connector.py\", line 317, in get_obj…

any idea


B.Regards
Anas

Re: Create network using ansible

Superuser
Posts: 38
1912     0

Hi Anas,

Could you try running the below snippet as a playbook.

---
- hosts: localhost
  vars:
    nios_provider:
      host: <grid>
      username: admin
      password: infoblox
  connection: local
  tasks:
   - name: create network
     nios_network:
       network: 192.168.5.0/24
       options:
         - name: domain-name
           value: dc01-dev
       network_view: default
       extattrs:
         Site: Test Site
       comment: Created with Ansible
       state: present
       provider: "{{ nios_provider }}"
Shukran

Re: Create network using ansible

[ Edited ]
New Member
Posts: 2
1912     0

hello,

thank you for your reply, i got syntax error trying to excuste your playbook, because we need to specify the collection first

infoblox.nios_modules.nios_network:

error:

The error appears to be in '/runner/project/playbooks/create_network.yml': line 12, column 7, but may
---
- hosts: localhost
connection: local
vars:
nios_provider:
host: x.x.x.x
username: admin
password: xxxx

tasks:
- name: create network
nios_network:
network: 192.168.10.0/24
network_view: default
options:
- name: domain-name
value: dc01-dev
extattrs:
Site: test site
comment: Created with Ansible
state: present
provider: "{{ nios_provider }}"
any idea about the previous error
module_stderr": "Failed on object search with url https://infoblox_url/wapi/v2.1/network?network=192.168.11.0%2F24&network_view=default&_return_fields...: b'{ \"Error\": \"AdmConProtoError: Field is not readable: template\", \\n \"code\": \"Client.Ibap.Proto\", \\n \"text\": \"Field is not readable: template\"\\n}'\nFailed on object search with url https://infoblox_url/wapi/v2.1/network?network=192.168.11.0%2F24&network_view=default&_return_fields...: b'{ \"Error\": \"AdmConProtoError: Field is not readable: template\", \\n \"code\": \"Client.Ibap.Proto\", \\n \"text\": \"Field is not readable: template\"\\n}'\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.8/site-packages/infoblox_client/connector.py\", line 317, in get_obj…



Re: Create network using ansible

Superuser
Posts: 38
1912     0

The playbook looks good. You could check if the ansible or infoblox-client needs to be updated.

You can run the below snippet to check the outdated pip modules:

pip3 list --outdated

The below snippet will update all the outdated modules:

pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip install -U
Shukran
Showing results for 
Search instead for 
Did you mean: 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin