feat: support insights service account credentials for project update

This commit is contained in:
Adrià Sala 2025-01-16 17:53:52 +01:00 committed by Adrià Sala
parent a19e1ba28f
commit 492c7a1af6
2 changed files with 7 additions and 0 deletions

View File

@ -1281,6 +1281,7 @@ class RunProjectUpdate(BaseTask):
'local_path': os.path.basename(project_update.project.local_path),
'project_path': project_update.get_project_path(check_if_exists=False), # deprecated
'insights_url': settings.INSIGHTS_URL_BASE,
'oidc_endpoint': settings.INSIGHTS_OIDC_ENDPOINT,
'awx_license_type': get_license().get('license_type', 'UNLICENSED'),
'awx_version': get_awx_version(),
'scm_url': scm_url,
@ -1447,6 +1448,11 @@ class RunProjectUpdate(BaseTask):
)
return params
def build_credentials_list(self, project_update):
if project_update.scm_type == 'insights' and project_update.credential:
return [project_update.credential]
return []
@task(queue=get_task_queuename)
class RunInventoryUpdate(SourceControlMixin, BaseTask):

View File

@ -697,6 +697,7 @@ DISABLE_LOCAL_AUTH = False
TOWER_URL_BASE = "https://platformhost"
INSIGHTS_URL_BASE = "https://example.org"
INSIGHTS_OIDC_ENDPOINT = "https://sso.example.org"
INSIGHTS_AGENT_MIME = 'application/example'
# See https://github.com/ansible/awx-facts-playbooks
INSIGHTS_SYSTEM_ID_FILE = '/etc/redhat-access-insights/machine-id'