diff options
Diffstat (limited to 'tasks/rundeck.yml')
-rw-r--r-- | tasks/rundeck.yml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tasks/rundeck.yml b/tasks/rundeck.yml index 4396552..007b86e 100644 --- a/tasks/rundeck.yml +++ b/tasks/rundeck.yml | |||
@@ -27,14 +27,17 @@ | |||
27 | Accept: application/json | 27 | Accept: application/json |
28 | X-Rundeck-Auth-Token: "{{ rundeck_api_token }}" | 28 | X-Rundeck-Auth-Token: "{{ rundeck_api_token }}" |
29 | vars: | 29 | vars: |
30 | rundeck_empty_group_path: '""' | 30 | rundeck_empty_group_path: '' |
31 | register: rundeck_existing_jobs | 31 | register: rundeck_existing_jobs |
32 | when: rundeck_remove_missing | 32 | when: rundeck_remove_missing |
33 | 33 | ||
34 | - name: "Prepare list of jobs to remove" | 34 | - name: "Prepare list of jobs to remove" |
35 | set_fact: | 35 | set_fact: |
36 | rundeck_created_ids: "{{ rundeck_create_jobs.results | map(attribute='json') | map('json_query','succeeded[*].id') | flatten | list }}" | 36 | rundeck_created_ids: "{{ rundeck_create_jobs.results | map(attribute='json') | map('json_query','succeeded[*].id') | flatten | list }}" |
37 | rundeck_jobs_ids: "{{ rundeck_existing_jobs.json | map(attribute='id') | list }}" | 37 | rundeck_jobs_ids: "{{ rundeck_existing_jobs_list | map(attribute='id') | list }}" |
38 | vars: | ||
39 | rundeck_existing_jobs_list_null: "{{ rundeck_existing_jobs.json | selectattr('group', 'none') | list }}" | ||
40 | rundeck_existing_jobs_list: "{{ rundeck_jobs_group | default(false) | ternary(rundeck_existing_jobs.json, rundeck_existing_jobs_list_null) }}" | ||
38 | when: rundeck_remove_missing | 41 | when: rundeck_remove_missing |
39 | 42 | ||
40 | - name: "Remove jobs not in the directory" | 43 | - name: "Remove jobs not in the directory" |