> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# Nautobot

> Configure the Nautobot dynamic inventory plugin for Itential Gateway.

To create and manage device inventory via plugin, several steps are required. This guide covers the Nautobot plugin.

> **Info**
>
> **Related reading:** [Ansible Collection for Nautobot](https://docs.nautobot.com/projects/ansible/en/latest/)

#### Install the plugin

There is an `ansible-galaxy` command that can install the plugin into the Gateway server. You will likely have to incorporate this command into your Gateway build plan so that you do not have to do this as a manual step. For Nautobot the command looks like this:

```bash
ansible-galaxy collection install networktocode.nautobot==5.1.1
```

#### Configure Ansible to use the plugin

There are several ways to accomplish this step. Below is a suggested method for enabling a plugin. Make sure the `interpreter_python` is appropriate for the environment.

This example enables the Nautobot dynamic inventory plugin at `/etc/ansible/ansible.cfg`.

```ini
[defaults]
host_key_checking = False
timeout = 900
# This might need adjusting depending on specifics
interpreter_python = /bin/python3.9
INVENTORY_ENABLED = "networktocode.nautobot.inventory"

[persistent_connection]
command_timeout = 3600
connect_timeout = 900
```

#### Configure the host file

Use the [Nautobot Ansible documentation](https://docs.nautobot.com/projects/ansible/en/latest/) to determine the most appropriate way to configure the plugin to connect to and query from the source of truth system. The Nautobot plugin configuration below connects to the public Nautobot demo and returns all devices found there.

`/opt/automation-gateway/ansible/inventory/hosts`

```yaml
plugin: networktocode.nautobot.inventory
# This is the public nautobot demo website.
api_endpoint: https://demo.nautobot.com
validate_certs: false
config_context: true
flatten_config_context: true
flatten_local_context_data: true
services: false
plurals: false
cache: true
# Customer must determine how to apply appropriate filters
#query_filters:
#  - role: switch
# The silly token for the "demo" user on the nautobot demo site
token: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

#### Confirm the plugin is working

Before invoking the plugin from Gateway, the plugin should be tested directly from the command line using direct Ansible capability. This command will invoke the plugin and return the devices it finds.

```bash
ansible-inventory -vvv --list -i <path-to-plugin-host-file>
```

#### Restart Gateway

Restarting Gateway should trigger the plugin to execute. Once execution finishes, you should see Nautobot devices in the Ansible inventory.