Add some loop control for ansible warnings

This commit is contained in:
Alan Rominger
2022-02-04 16:12:28 -05:00
parent 957566993b
commit f05faaaaa0

View File

@@ -55,7 +55,7 @@
rescue: rescue:
- name: Get list of project updates and jobs - name: Get list of project updates and jobs
uri: uri:
url: "http://localhost/api/v2/{{ item }}/" url: "http://localhost/api/v2/{{ resource }}/"
user: admin user: admin
password: "{{ admin_pw_secret.resources[0].data.password | b64decode }}" password: "{{ admin_pw_secret.resources[0].data.password | b64decode }}"
force_basic_auth: yes force_basic_auth: yes
@@ -63,15 +63,19 @@
loop: loop:
- project_updates - project_updates
- jobs - jobs
loop_control:
loop_var: resource
- name: Get all job and project details - name: Get all job and project details
uri: uri:
url: "http://localhost{{ item }}" url: "http://localhost{{ endpoint }}"
user: admin user: admin
password: "{{ admin_pw_secret.resources[0].data.password | b64decode }}" password: "{{ admin_pw_secret.resources[0].data.password | b64decode }}"
force_basic_auth: yes force_basic_auth: yes
loop: | loop: |
{{ job_lists.results | map(attribute='json') | map(attribute='results') | flatten | map(attribute='url') }} {{ job_lists.results | map(attribute='json') | map(attribute='results') | flatten | map(attribute='url') }}
loop_control:
loop_var: endpoint
- name: Re-emit failure - name: Re-emit failure
vars: vars: