/
NIOS Modules for Ansible Collections

NIOS Modules for Ansible Collections

Infoblox NIOS Modules for Ansible Collections include a set of NIOS modules, lookup plug-ins, roles, and playbooks. The NIOS modules enable you to automate the management operations performed on NIOS objects and the inventory and lookup plug-ins allow you to retrieve data from NIOS to Ansible.

Configure the collection in an Ansible playbook (a .yml file) by referencing the collection content by its fully qualified collection name according to the operation it must perform.
The following playbook samples reference infoblox.nios_modules.nios_a_record for creating an A record:

Sample using authentication with NIOS credentials:

connection: local
tasks:
  - name: Create Nios A record Test
    infoblox.nios_modules.nios_a_record:
      name: ansible.testzone.com
      view: ansibleDnsView
      ipv4: 192.168.11.251
      comment: Created with Ansible
      state: present
      provider:
        host: <nios_hostname_or_hostip>
        username: <nios_username>
        password: <nios_password>

Sample using Certificate-based authentication:

connection: local
tasks:
  - name: Create Nios A record Test
    infoblox.nios_modules.nios_a_record:
      name: ansible.testzone.com
      view: ansibleDnsView
      ipv4: 192.168.11.251
      comment: Created with Ansible
      state: present
      provider:
        host: <nios_hostname_or_hostip>
        cert: "<absolute_path_for_client.cert.pem>"
key: "<absolute_path_for_client.key.pem>"

Note

To perform manage operations on a NIOS cloud platform member,  specify the following when configuring a playbook:

  • Credentials of an admin account that is assigned to the admin group cloud-api-only and has read-write permissions on each NIOS object it must manage.

  • Extensible attributes Tenant ID, CMP Type, and Cloud API Owned.

For details on NIOS modules and plug-ins, see the following topics:

Consider the following points when working with NIOS modules:

  • You must run the NIOS modules and plug-ins locally by specifying connection:local.

  • All NIOS modules (other than plug-ins) support the create, update, and delete operations. For the create and update operations, set the status parameter to present and for the delete operation, set it to absent.

  • All NIOS modules related to resource records have ttl as a common parameter. This optional parameter specifies the time the data is cached in the DNS server before the data is updated.

  • All NIOS modules have the optional parameter extattrs, which specifies extensible attributes. The parameter supports create, update, and delete operations.
    To remove the configured extensible attributes, specify an empty dictionary as shown in the following example of an A record:
    name: Delete extattrs for nios a record
    infoblox.nios_modules.nios_a_record:
    name: sample.testzone.com
    view: extra
    ipv4: 12.10.0.18
    extattrs: {}
    comment: Created with Ansible
    state: present
    provider: "{{ nios_provider }}"

  • All NIOS modules and plug-ins have the following common parameters:

    • comment: Text that describes the module or plug-in.

    • provider: A dictionary object that contains details of connections. You can include the following subparameters:

Subparameter

Required/Optional

Description

Subparameter

Required/Optional

Description

host

Required

Specifies the DNS host name or IP address for connecting to the remote
instance of NIOS.
You can also use the environment variable INFOBLOX_HOST to specify the value.

username

Required
(For authentication with NIOS credentials)

Specifies the user name to use for authenticating the connection to the remote instance of NIOS.
You can also use the environment variable INFOBLOX_USERNAME to specify the value.

password

Required
(For authentication with NIOS credentials)

Specifies the password to use for authenticating the connection to the remote instance of NIOS.
You can also use the environment variable INFOBLOX_PASSWORD to specify the value.

cert

Required
(For certificate-based authentication)

Specifies the absolute path to the X.509 certificate in .PEM format required for authenticating the connection to the remote instance of NIOS.
You can also use the environment variable INFOBLOX_CERT=<client.cert.pem> to specify the value.

key

Required
(For certificate-based authentication)

Specifies the absolute path to the certificate key required for authenticating the connection to the remote instance of NIOS.
You can also use the environment variable INFOBLOX_KEY=<client.key.pem> to specify the value.

validate_certs

Optional

Specifies whether to enable the verification of SSL certificates. The default value is no.
You can also use the environment variable INFOBLOX_SSL_VERIFY to specify the value.

http_request_timeout

Optional

Specifies the wait time for receiving a response. The default value is 10.
You can also use the environment variable INFOBLOX_HTTP_REQUEST_TIMEOUT to specify the value.

max_retries

Optional

Specifies the number of retries to attempt before the connection is declared usable. The default value is 3.
You can also use the environment variable INFOBLOX_MAX_RETRIES to specify the value.

max_results

Optional

Specifies the maximum number of objects to be returned; if the parameter is set to a negative number, the appliance returns an error when the number of returned objects exceeds the set value. The default value is 1000.
You can also use the environment variable INFOBLOX_MAX_RESULTS to specify the value.

wapi_version

Optional

Specifies the version of WAPI to use. The default value is 2.1.
You can also use the environment variable INFOBLOX_WAPI_VERSION to specify the value.
Because the compatibility of Infoblox NIOS Modules for Ansible Collections has been tested with the WAPI version 2.9, Infoblox recommends that you use WAPI version 2.9 or later.

http_pool_maxsize

Optional

Specifies the maximum number of connections to save in the pool. The default value is 10.

http_pool_connections

Optional

Specifies the number of urllib3 connection pools to cache. The default value is 10.

silent_ssl_warnings

Optional

Specifies whether the SSL warnings are enabled or disabled. When the value is set to True,  unverified HTTPS requests are made. The default value is True.

 

Related content