Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass authentication field to insights plugin #81

Open
wants to merge 2 commits into
base: devel
Choose a base branch
from

Conversation

fosterseth
Copy link
Member

@fosterseth fosterseth commented Jan 10, 2025

This patch will add

authentication: service_account

to insights.yml if client_id is defined on the credential.

Even though extra_vars is configured in the insights credential field, extra_vars is not utilized for inventory source syncs.

As such, we can override the inventory_as_dict class on the Inventory plugin to inject "authentication: service_account" param into the insights.yml file.

in the inventory sync private data dir

inventory/insights.yml

authentication: service_account
plugin: redhatinsights.insights.insights

the INSIGHTS_CLIENT_ID and INSIGHTS_CLIENT_SECRET are passed in via environment variables, which is supported by the insights module https://github.com/RedHatInsights/ansible-collections-insights/blob/43e169d6eb0a01d40b3a8df05070e372cb6fd862/docs/inventory.md

This patch will add

   authentication: service_account

to insights.yml if client_id is defined.

Even though extra_vars is configured in the insights
credential field, extra_vars is not utilized for
inventory source syncs.

As such, we can override the inventory_as_dict
class on the Inventory plugin to
inject "authentication: service_account" param
into the insights.yml file.

Signed-off-by: Seth Foster <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant