Skip to content

Commit

Permalink
Merge pull request #81 from fosterseth/insights_service_account
Browse files Browse the repository at this point in the history
Pass authentication field to insights plugin
  • Loading branch information
fosterseth authored Jan 15, 2025
2 parents c8cff62 + 36f6bc4 commit 0d569b5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/awx_plugins/inventory/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,14 @@ class insights(PluginFileInjector):
collection = 'insights'
use_fqcn = True

def inventory_as_dict(self, inventory_update, private_data_dir):
inventory_data = super().inventory_as_dict(inventory_update, private_data_dir)
credential = inventory_update.get_cloud_credential()
if credential.get_input('client_id', default=''):
inventory_data['authentication'] = 'service_account'

return inventory_data


class insights_supported(PluginFileInjector):
plugin_name = 'insights'
Expand All @@ -442,6 +450,14 @@ class insights_supported(PluginFileInjector):
collection = 'insights'
use_fqcn = True

def inventory_as_dict(self, inventory_update, private_data_dir):
inventory_data = super().inventory_as_dict(inventory_update, private_data_dir)
credential = inventory_update.get_cloud_credential()
if credential.get_input('client_id', default=''):
inventory_data['authentication'] = 'service_account'

return inventory_data


class openshift_virtualization(PluginFileInjector):
plugin_name = 'kubevirt'
Expand Down

0 comments on commit 0d569b5

Please sign in to comment.