---
title: "NIOS Modules for Ansible Collections"
canonical: "https://docs.infoblox.com/space/niosmodulesansible/44525470/NIOS%20Modules%20for%20Ansible%20Collections"
format: markdown
---
<span style="color: #000000">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.</span>

<span style="color: #000000">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. </span>  
<span style="color: #000000">The following playbook samples reference </span>`infoblox.nios_modules.nios_a_record`<span style="color: #000000"> for creating an A record:</span>

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`.

<span style="color: #000000">For details on NIOS modules and plug-ins, see the following topics:</span>

- <span style="color: #000000">*[Infoblox NIOS Modules](https://infoblox-docs.atlassian.net/wiki/spaces/niosmodulesansible/pages/44950790)*</span>
- <span style="color: #000000">*[Infoblox NIOS Plug-Ins](https://infoblox-docs.atlassian.net/wiki/spaces/niosmodulesansible/pages/45973583)*</span>

<span style="color: #000000">Consider the following points when working with NIOS modules:</span>

- <span style="color: #000000">You must run the NIOS modules and plug-ins locally by specifying </span>`connection:local`<span style="color: #000000">.</span>
- <span style="color: #000000">All NIOS modules (other than plug-ins) support the create, update, and delete operations. For the create and update operations, set the </span>`status`<span style="color: #000000"> parameter to </span>`present`<span style="color: #000000"> and for the delete operation, set it to </span>`absent`<span style="color: #000000">.</span>
- <span style="color: #000000">All NIOS modules related to resource records have </span>`ttl`<span style="color: #000000"> as a common parameter. This optional parameter specifies the time the data is cached in the DNS server before the data is updated.</span>
- <span style="color: #000000">All NIOS modules have the optional parameter </span>`extattrs`<span style="color: #000000">, which specifies extensible attributes</span>. 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 }}"`
- <span style="color: #000000">All NIOS modules and plug-ins have the following common parameters:</span>
  - `comment`<span style="color: #000000">: Text that describes the module or plug-in.</span>
  - `provider`<span style="color: #000000">: A dictionary object that contains details of connections. You can include the following subparameters:</span>

| **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`. |