From 1fae7e67642c4e536f91d6d8c33ce013a8eef9c0 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Tue, 28 Oct 2014 15:44:14 -0400 Subject: [PATCH] Add more customization with data passed to the system job when run --- awx/main/tasks.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 2b0b6dc062..5c39d4af71 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -1145,6 +1145,13 @@ class RunSystemJob(BaseTask): json_vars = json.loads(system_job.extra_vars) if 'days' in json_vars: args.extend(['--days', str(json_vars['days'])]) + if system_job.job_type == 'cleanup_jobs': + if 'jobs' in json_vars and json_vars['jobs']: + args.extend(['--jobs']) + if 'project_updates' in json_vars and json_vars['project_updates']: + args.extend(['--project-updates']) + if 'inventory_updates' in json_vars and json_vars['inventory_updates']: + args.extend(['--inventory-updates']) except Exception, e: pass print args