SaltStack Integration
Salt (also known as SaltStack) is a Python-based open source configuration management tool and remote execution engine that supports Infrastructure as Code (IaC). The Device42 Salt integration lets you gather information about your devices from the same tool you use to provision them.
The integration collects the following data from Salt:
- Name
- Node type
- CPU power
- Customer
- Virtual or physical
- Virtual sub-type
- CPU core count
- Manufacturer
- Operating System and OS Version
- Total Memory
- HDD Count
- Service Level
Prerequisites
Before you configure the integration, make sure you have:
- A working Device42 instance and a working Salt installation
- Accepted keys for the minions on the Salt Master
- Permission to run the script on the Salt Master as the user that runs the Salt Master
- The Python packages in the integration repository's
requirements.txtfile
pip install PyYAML appdirs futures jinja2 tornado requests salt markupsafe msgpack-python packaging pycrypto pyparsing pyzmq singledispatch six
Configure and Use the Integration
- Create a working directory and copy the contents of the
salt_to_device42_syncrepository to it. - Copy or rename the settings file
settings.yaml.exampletosettings.yaml. - Add your Device42 host, user name, and password to the
settings.yamlfile:
Click to expand the code block
========= Device 42
Device42:
host: host
user: user
pass: pass
# ========= Options
# static options
Static:
customer: null
customer_id: null
service_level: null
Options:
# as_node_name: one of [fqdn, name]
as_node_name: fqdn
node_filter: []
Consult README.md and requirements.txt for more details.
- Configure node filtering, if required. You can find details about the configuration options in
NodeFilter.md. Add filter settings after theOptions:section ofsettings.yaml. - Run the script with
python saltexplore.py. Use-c /path/to/settings.yamlto specify a settings file in another location.
Download the script from the salt_to_device42_sync repository.
If you run into unexpected behavior or bugs, or have questions, comments, or feature requests, contact support@device42.com.