Infoblox’s global team of threat hunters uncovers a DNS operation with the ability to bypass traditional security measures and control the Great Firewall of China. Read about “Muddling Meerkat” and the many other threat actors discovered by Infoblox Threat Intel here.

Automation Scripts

Reply

ANSIBLE - modify existing network containers using nios_network module

New Member
Posts: 1
220     0

Hi community,

Apologies if this topic has been addressed before, but I haven't been able to find a solution to my question.

I'm currently working on an Ansible playbook to modify network container information, but I'm encountering errors.

 

Here's the task:

    - name: EDIT NETWORK CONTAINERS
      infoblox.nios_modules.nios_network:
        network: '1.0.0.0/8'
        comment: 'Test'
        extattrs:
          'Country': 'Test country'
          'Platform': 'Test platform'
        provider: '{{ nios_provider }}'
      connection: local

The error message I'm getting is:

 

"msg": "The network 1.0.0.0/8 will overlap an existing network", "operation": "create_object", "type": "AdmConDataError"

 

My test network 1.0.0.0/8 contains more networks inside (1.1.1.0/24, 1.1.2.0/24, etc.). It seems like it's trying to create a new network instead of modifying the existing one. If I provide a specific network, such as 1.1.1.0/24, it works as expected.

 

If I modify the task and add the container key, like this:

 

    - name: EDIT NETWORK CONTAINERS
      infoblox.nios_modules.nios_network:
        network: '1.0.0.0/8'
        container: true
        comment: 'Test'
        extattrs:
          'Country': 'Test country'
          'Platform': 'Test platform'
        provider: '{{ nios_provider }}'
      connection: local

I get a different error:

 

"msg": "Field is not allowed for update: network", "operation": "update_object", "type": "AdmConProtoError"

It complains about `network`, which can't be removed because it's mandatory.

I'm using:

  • ansible [core 2.12.3]
  • python version = 3.9.6
  • infoblox.nios_modules 1.2.1

Any insights would be appreciated.

 

Thanks in advance.

E.

 

 

 

 

Showing results for 
Search instead for 
Did you mean: 

Recommended for You