diff options
Diffstat (limited to 'tasks/rundeck.yml')
-rw-r--r-- | tasks/rundeck.yml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tasks/rundeck.yml b/tasks/rundeck.yml index 1250d24..aa71570 100644 --- a/tasks/rundeck.yml +++ b/tasks/rundeck.yml | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | - name: Create rundeck jobs | 8 | - name: Create rundeck jobs |
9 | uri: | 9 | uri: |
10 | url: "{{rundeck_api_url }}/{{rundeck_api_version}}/project/{{ rundeck_project }}/jobs/import" | 10 | url: "{{ rundeck_api_url }}/{{ rundeck_api_version }}/project/{{ rundeck_project }}/jobs/import" |
11 | method: POST | 11 | method: POST |
12 | return_content: true | 12 | return_content: true |
13 | body_format: raw | 13 | body_format: raw |
@@ -17,7 +17,7 @@ | |||
17 | Content-Type: application/x-www-form-urlencoded; charset=utf-8 | 17 | Content-Type: application/x-www-form-urlencoded; charset=utf-8 |
18 | X-Rundeck-Auth-Token: "{{ rundeck_api_token }}" | 18 | X-Rundeck-Auth-Token: "{{ rundeck_api_token }}" |
19 | register: rundeck_create_jobs | 19 | register: rundeck_create_jobs |
20 | with_items: "{{ rundeck_jobs_files.files}}" | 20 | with_items: "{{ rundeck_jobs_files.files }}" |
21 | 21 | ||
22 | - name: Check if a job failed | 22 | - name: Check if a job failed |
23 | fail: | 23 | fail: |
@@ -33,13 +33,14 @@ | |||
33 | 33 | ||
34 | - name: Get all jobs | 34 | - name: Get all jobs |
35 | uri: | 35 | uri: |
36 | url: "{{rundeck_api_url }}/{{rundeck_api_version}}/project/{{ rundeck_project }}/jobs?groupPathExact={{ rundeck_jobs_group | default(rundeck_empty_group_path) }}" | 36 | url: "{{ rundeck_api_url }}/{{ rundeck_api_version }}/project/{{ rundeck_project }}/jobs?groupPathExact={{ rundeck_group_path }}" |
37 | method: GET | 37 | method: GET |
38 | headers: | 38 | headers: |
39 | Accept: application/json | 39 | Accept: application/json |
40 | X-Rundeck-Auth-Token: "{{ rundeck_api_token }}" | 40 | X-Rundeck-Auth-Token: "{{ rundeck_api_token }}" |
41 | vars: | 41 | vars: |
42 | rundeck_empty_group_path: '' | 42 | rundeck_empty_group_path: '' |
43 | rundeck_group_path: "{{ rundeck_jobs_group | default(rundeck_empty_group_path) }}" | ||
43 | register: rundeck_existing_jobs | 44 | register: rundeck_existing_jobs |
44 | when: rundeck_remove_missing | 45 | when: rundeck_remove_missing |
45 | 46 | ||
@@ -54,7 +55,7 @@ | |||
54 | 55 | ||
55 | - name: "Remove jobs not in the directory" | 56 | - name: "Remove jobs not in the directory" |
56 | uri: | 57 | uri: |
57 | url: "{{rundeck_api_url }}/{{rundeck_api_version}}/job/{{ item }}" | 58 | url: "{{ rundeck_api_url }}/{{ rundeck_api_version }}/job/{{ item }}" |
58 | method: DELETE | 59 | method: DELETE |
59 | headers: | 60 | headers: |
60 | Accept: application/json | 61 | Accept: application/json |