Inventory Sources
  • 14 Aug 2023
  • Dark
    Light
  • PDF

Inventory Sources

  • Dark
    Light
  • PDF

Article Summary

Inventory Sources (Internal vs External)

While the functionality of each integration will remain the same regardless of how the inventory device is sourced, it is important to understand how Automation Gateway will behave in each scenario.

Internal Inventory

An Internal inventory source simply means that an External file path was not supplied, or not correctly loaded; therefore, you must manage your inventory exclusively through the GUI or APIs.

Pros

  • Inventory can be fully managed via API calls for end-to-end automations that do not have access to the underlying file system.

Cons

  • Certain inventory features of an integration must be adapted to fit inside of a JSON structure instead of other file formats supported by that integration (e.g., YAML for Ansible, etc.).

External Inventory

An External inventory source indicates that you have supplied a correct path to the relevant inventory or configuration file for that integration. Due to the External file acting as the source of truth, Automation Gateway is unable to directly modify the file and "Internal" inventory is necessarily disabled. In order to modify External inventory, you must directly update the file itself and prompt Automation Gateway to "Refresh" its knowledge of that inventory.

Pros

  • The full extent of native inventory options are available for each relevant integration (e.g., complicated ini groups and variables with Ansible).

Cons

  • The underlying filesystem must be kept up-to-date via file syncing protocols, scripts, cron jobs, or manual processes.

Ansible Devices vs Inventory Devices

For legacy support, among other factors, Automation Gateway has two sets of endpoints for Inventory. The first are the /devices and /groups endpoints which are exclusively for use with Ansible (and Scripts by extension). The second is the /inventories endpoints which are for all inventory-enabled integrations besides Ansible. In either case, users can manage inventory devices via our GUI or RESTful API endpoints.


Note: Beginning with Automation Gateway 2021.1, Ansible will be the only integration that uses the /devices endpoints.


Inventory Device Integration Types

Each Inventory Device has an associated integration_type which is used when managing devices via API calls.

Integration Integration Type
HTTP Requests http_requests
NETCONF netconf
Netmiko netmiko
Nornir nornir

Device Inventory Examples

Cisco ASA

{
  "name": XXXXXX
  "variables":{
   "ansible_host": "XXX.XX.XXX.XX",
   "ansible_port": 22,
   "ansible_network_os": "asa",
   "ansible_connection": "network_cli",
   "ansible_user": "USERNAME",
   "ansible_password": "PASSWORD",
   "ansible_become": "yes",
   "ansible_become_method": "enable",
   "ansible_become_pass": "PASSWORD"
   }
}

Fortigate - Netmiko

{
  "ansible_host": "x.x.x.x",
  "ansible_user": "user",
  "ansible_password": "pass",
  "ansible_port": 22,
  "ansible_connection": "local",
  "netmiko_device_type": "fortinet",
  "get_config_command": "show full-configuration",
  "end_command": "exit",
  "get_state_command": "get system status",
  "save_command": "end"
}

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.