- 10 Jan 2025
-
DarkLight
-
PDF
SolarWinds
- Updated on 10 Jan 2025
-
DarkLight
-
PDF
Steps to Create a Dynamic Inventory
To create and manage device inventory via plugin, several steps are required. This guide covers the SolarWinds NCM (Network Configuration Manager) plugin.
Related Reading: SolarWinds NCM
Step 1. Install the required ansible collections
For SolarWinds NCM, install the following two Ansible collections using ansible-galaxy
:
itential-core-1.0.0.tar.gz
itential-plugins-1.0.0.tar.gz
Step 2. Add the SolarWinds plugin config file
Configure the SolarWinds NCM plugin by creating an inventory file in the inventory directory found on a typical IAG server at the following location:
/opt/automation-gateway/ansible/inventory/solarwinds.yml
This example enables the SolarWinds NCM plugin.
# Copyright 2024, Itential, Inc
# GNU General Public License v3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
---
# The value for plugin is required and is always set to
# `itential.plugins.solarwinds`.
plugin: itential.plugins.solarwinds
# Configures the url to the server. For example, `https://1.2.3.4` or
# `https://solarwindows.example.com`. This value is required
base_url: <Hostname or IP address to server>
# Configures the port value to use when connecting to the server. If this
# value is not specified, the default value of `17778` will be used
api_port: <API port>
# Configures the username to use when autoenticating to the server. This value
# is required.
username: <username used to authenticate to Solarwinds API>
# Configures the password to use when authenticating to the server This value
# is required.
password: <password used to authenticate to Solarwinds API>
# Enables or disables certification verification for TLS connections. The
# default value is `True`
verify_ssl: <true | false >
# Enables or disables the use of Solarwinds ConnectionProfile as the device
# credentials. Typically set this value to True
use_connection_profiles: <true | false >
Step 3. Configure ansible to use the SolarWinds plugin
Configure Ansible to use this plugin as the inventory source by using the following configuration. The ansible config file is typically found on an IAG server at the following location:
/etc/ansible/ansible.cfg
[defaults]
collections_path=/opt/automation-gateway/ansible/collections:/usr/share/ansible/collections
inventory=/opt/automation-gateway/ansible/inventory/solarwinds.yml
[inventory]
enable_plugins=itential.plugins.solarwinds
Step 4. Confirm the plugin is working
Execute the inventory plugin with the following command to confirm everything works as intended outside of IAG:
ansible-inventory -vvv --list
When executed correctly, this step should return a list of devices from SolarWinds with their associated variables.
Step 5. Restart IAG
Restarting IAG should trigger the plugin to execute. Once execution finishes, you should see devices in the Ansible inventory.
sudo systemctl restart automation-gateway
Troubleshooting
Plugin can't connect to SolarWinds NCM
In the SolarWinds 2023.1 release, you can continue using port 17778. However, please note that it is being deprecated and will not be supported in a future version.
Navigate to the advanced global settings page located at:
<SolarwindsURL>/Orion/Admin/AdvancedConfiguration/Global.aspx
Inspect the following endpoint port flags:
DisableSwisRestEndpointOnPort17774
DisableSwisRestEndpointOnPort17778
Passwords not appearing
Check the settings. If you set the inventory file use_connection_profiles
flag to "true", and only ansible_user
has value (but ansible_password
does not) try the following:
- Log in to Solarwinds using an
admin
account. - Navigate to the advanced global settings page located at
<SolarwindsURL>/Orion/Admin/AdvancedConfiguration/Global.aspx
. - Uncheck the flag
HideSwisConnectionProfilePasswords
to expose inventory passwords to the plugin. - Save the settings.