Skip to content
Snippets Groups Projects
Commit 4d7126e1 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Add variable to disable AWX jobs

AWX jobs should only be triggered on the production server (not from
staging). At least until we get a full staging environment.
parent 6d6a187e
No related branches found
No related tags found
No related merge requests found
......@@ -68,4 +68,5 @@ MAC_OUI = '02:42:42'
DOCUMENTATION_URL = 'http://ics-infrastructure.pages.esss.lu.se/csentry/index.html'
# AWX job templates
AWX_JOB_ENABLED = False
AWX_CORE_SERVICES_UPDATE = 'ics-ans-core CSENTRY refresh'
......@@ -39,6 +39,9 @@ def trigger_core_services_update():
def launch_job_template(job_template, monitor=True, **kwargs):
if not current_app.config.get('AWX_JOB_ENABLED', False):
current_app.logger.info('AWX job is disabled. Not sending any request.')
return 'AWX job not triggered'
resource = tower_cli.get_resource('job')
result = resource.launch(job_template=job_template, monitor=monitor, **kwargs)
return result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment