SolarWinds 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

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

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 Gateway server at the following location:

/opt/automation-gateway/ansible/inventory/solarwinds.yml

This example enables the SolarWinds NCM plugin.

1# Copyright 2024, Itential, Inc
2# GNU General Public License v3.0+ (https://www.gnu.org/licenses/gpl-3.0.txt)
3---
4
5# The value for plugin is required and is always set to
6# `itential.plugins.solarwinds`.
7plugin: itential.plugins.solarwinds
8
9# Configures the url to the server. For example, `https://1.2.3.4` or
10# `https://solarwindows.example.com`. This value is required
11base_url: <Hostname or IP address to server>
12
13# Configures the port value to use when connecting to the server. If this
14# value is not specified, the default value of `17778` will be used
15api_port: <API port>
16
17# Configures the username to use when authenticating to the server. This value
18# is required.
19username: <username used to authenticate to Solarwinds API>
20
21# Configures the password to use when authenticating to the server. This value
22# is required.
23password: <password used to authenticate to Solarwinds API>
24
25# Enables or disables certification verification for TLS connections. The
26# default value is `True`
27verify_ssl: <true | false>
28
29# Enables or disables the use of Solarwinds ConnectionProfile as the device
30# credentials. Typically set this value to True
31use_connection_profiles: <true | false>
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 a Gateway server at the following location:

/etc/ansible/ansible.cfg

1[defaults]
2collections_path=/opt/automation-gateway/ansible/collections:/usr/share/ansible/collections
3inventory=/opt/automation-gateway/ansible/inventory/solarwinds.yml
4
5[inventory]
6enable_plugins=itential.plugins.solarwinds
4

Confirm the plugin is working

Execute the inventory plugin with the following command to confirm everything works as intended outside of Gateway:

$ansible-inventory -vvv --list

When executed correctly, this step should return a list of devices from SolarWinds with their associated variables.

5

Restart Gateway

Restarting Gateway 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

Refer to SolarWinds Platform Release Notes: In the SolarWinds 2023.1 release, you can continue using port 17778. However, 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 a value (but ansible_password does not), try the following:

  1. Log in to SolarWinds using an admin account.
  2. Navigate to the advanced global settings page located at <SolarwindsURL>/Orion/Admin/AdvancedConfiguration/Global.aspx.
  3. Uncheck the flag HideSwisConnectionProfilePasswords to expose inventory passwords to the plugin.
  4. Save the settings.