---
title: "Configuring Infoblox NIOS Modules for Ansible Collections"
canonical: "https://docs.infoblox.com/space/niosmodulesansible/44525497/Configuring%C2%A0Infoblox%20NIOS%20Modules%20for%20Ansible%20Collections"
format: markdown
---
For Ansible to authenticate and connect to NIOS, you can configure the authentication information required to access the NIOS Grid objects in an Ansible playbook (a .yml file) or set them as environment variables. The authentication types supported by the NIOS modules for Ansible Collections are, authentication with Infoblox NIOS credentials and certificate-based authentication.

> ⚠️ **Note**
> ⚠️ 
> ⚠️ - If you define both the authentication types in a playbook, by default, Ansible uses NIOS credentials to authenticate the connection.
> ⚠️ - The examples in this guide use the credentials stored in the <playbookdir>/group_vars/nios.yml file.

# Configuring the Authentication with NIOS Credentials

You can define the NIOS credentials in a playbook (.yml) or set them as environment variables.

- To configure the authentication in a playbook:  
`nios_provider:`  
`    host: <nios_host_ip>`  
`    username: <NIOS_username>`  
`    password: <NIOS_password>`
- To set the values as environment variables:  
`export INFOBLOX_HOST=<nios_host_ip>`  
`export INFOBLOX_USERNAME=<NIOS_username> `  
`export INFOBLOX_PASSWORD=<NIOS_password>`

# Configuring Certificating-Based Authentication

Starting from plug-in version 1.4.0 (with Python-client version 0.5.2), NIOS Modules with Ansible Collections supports certificate-based authentication with X.509 certificate in .PEM format. You must specify the absolute paths for the certificate and key, either in an Ansible playbook or set them as environment variables.

- To configure the authentication in a playbook:  
`nios_provider:`  
`    host: <nios_host_ip>`  
`    cert: "<absolute_path_for_client.cert.pem>"`  
`    key: "<absolute_path_for_client.key.pem>"`
- To set the values as environment variables:  
`export INFOBLOX_CERT=<client.cert.pem>`  
`export INFOBLOX_KEY=<client.key.pem>`