jeromemarc / AnsibleInsightsInventory

A dynamic inventory script for Ansible that pulls groups with hosts from Red Hat Insights

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This script and accompanying ini file will allow you to run actions against groups defined in Red Hat Insights. Currently this script will only generate lists from hosts that are defined within a group.

Future enhancements:

  • Add all hosts without an existing group to a more generic Ansible grouping such as 'insights-other' or 'insights-all'
  • Potentially add some metadata from Red Hat Insights registration to a --host request, which currently only returns an empty dict.
  • Better flexibility around username/password storage

To get started with this script, first replace 'RH_ACCT' and 'RH_PASSWD' in the ini file with the appropriate credentials.

This script can be run independently from Ansible for testing purposes:

./insights_inventory.py --list

Or can be used within Ansible:

ansible all -i ./insights_inventory.py

About

A dynamic inventory script for Ansible that pulls groups with hosts from Red Hat Insights


Languages

Language:Python 100.0%