Merge pull request #11865 from AlanCoding/galaxy_task_env

Add user-defined environment variables to ansible-galaxy commands
This commit is contained in:
Alan Rominger
2022-04-01 15:24:54 -04:00
committed by GitHub
8 changed files with 90 additions and 18 deletions

View File

@@ -282,6 +282,19 @@ register(
placeholder={'HTTP_PROXY': 'myproxy.local:8080'},
)
register(
'GALAXY_TASK_ENV',
field_class=fields.KeyValueField,
label=_('Environment Variables for Galaxy Commands'),
help_text=_(
'Additional environment variables set for invocations of ansible-galaxy within project updates. '
'Useful if you must use a proxy server for ansible-galaxy but not git.'
),
category=_('Jobs'),
category_slug='jobs',
placeholder={'HTTP_PROXY': 'myproxy.local:8080'},
)
register(
'INSIGHTS_TRACKING_STATE',
field_class=fields.BooleanField,

View File

@@ -1161,6 +1161,7 @@ class RunProjectUpdate(BaseTask):
'scm_track_submodules': project_update.scm_track_submodules,
'roles_enabled': galaxy_creds_are_defined and settings.AWX_ROLES_ENABLED,
'collections_enabled': galaxy_creds_are_defined and settings.AWX_COLLECTIONS_ENABLED,
'galaxy_task_env': settings.GALAXY_TASK_ENV,
}
)
# apply custom refspec from user for PR refs and the like