@@ -159,77 +159,77 @@ tee playbook.yml << EOF
159159 - wobhook_credential: "{{ template_info[0].webhook_credential | default(omit, true) }}"
160160 - webhook_service: "{{ template_info[0].webhook_service }}"
161161
162- - name: figure out creds for JT
163- set_fact:
164- credentials: "{% if template_info[0].summary_fields['credentials'] | length>0 %}{% for cred in template_info[0].summary_fields['credentials'] %}{{ cred.name }}{% if loop.length > 1 %},{% endif %}{% endfor %}{% endif %}"
165-
166- - name: figure out creds for JT
167- set_fact:
168- credentials: "{% if credentials | length>0 %}{{ credentials | split(',') }}{% endif %}"
169-
170- - name: update project for scm allow_override and scm_update_on_launch
171- awx.awx.project:
172- name: "{{ project_var }}"
173- state: present
174- description: "{{ project_info[0].description }}"
175- organization: "{{ project_info[0].organization }}"
176- default_environment: "{{ project_info[0].default_environment }}"
177- scm_type: "{{ project_info[0].scm_type }}"
178- scm_url: "$scm_url "
179- scm_branch: "{{ project_info[0].scm_branch }}"
180- scm_refspec: "{{ scm_refspec }}"
181- # credential: "{{ project_info[0].credential }}"
182- scm_clean: "{{ project_info[0].scm_clean }}"
183- scm_delete_on_update: "{{ project_info[0].scm_delete_on_update }}"
184- scm_track_submodules: "{{ project_info[0].scm_track_submodules }}"
185- scm_update_on_launch: True
186- allow_override: True
187- validate_certs: "$CONTROLLER_VERIFY_SSL "
188-
189- # This task is only updating ask_scm_branch_on_launch
190- - name: update job template to turn ask_scm_branch_on_launch
191- awx.awx.job_template:
192- allow_simultaneous: "{{ template_info[0].allow_simultaneous }}"
193- ask_credential_on_launch: "{{ template_info[0].ask_credential_on_launch }}"
194- ask_diff_mode_on_launch: "{{ template_info[0].ask_diff_mode_on_launch }}"
195- ask_inventory_on_launch: "{{ template_info[0].ask_diff_mode_on_launch }}"
196- ask_job_type_on_launch: "{{ template_info[0].ask_job_type_on_launch }}"
197- ask_limit_on_launch: "{{ template_info[0].ask_limit_on_launch }}"
198- ask_scm_branch_on_launch: True
199- ask_skip_tags_on_launch: "{{ template_info[0].ask_skip_tags_on_launch }}"
200- ask_tags_on_launch: "{{ template_info[0].ask_tags_on_launch }}"
201- ask_variables_on_launch: "{{ template_info[0].ask_variables_on_launch }}"
202- ask_verbosity_on_launch: "{{ template_info[0].ask_verbosity_on_launch }}"
203- become_enabled: "{{ template_info[0].become_enabled }}"
204- credentials: "{{ credentials | default(omit, true) }}"
205- description: "{{ template_info[0].description }}"
206- diff_mode: "{{ template_info[0].diff_mode }}"
207- execution_environment: "{{ template_info[0].execution_environment }}"
208- extra_vars: "{% if not template_info[0].extra_vars | from_yaml %}{}{% else %}blah{% endif %}"
209- force_handlers: "{{ template_info[0].force_handlers }}"
210- forks: "{{ template_info[0].forks }}"
211- host_config_key: "{{ template_info[0].host_config_key }}"
212- inventory: "{{ template_info[0].inventory }}"
213- job_slice_count: "{{ template_info[0].job_slice_count }}"
214- job_tags: "{{ template_info[0].job_tags }}"
215- job_type: "{{ template_info[0].job_type }}"
216- limit: "{{ template_info[0].limit }}"
217- name: "{{ template_info[0].name }}"
218- organization: "{{ template_info[0].organization }}"
219- playbook: "{{ template_info[0].playbook }}"
220- project: "{{ template_info[0].project }}"
221- scm_branch: "{{ template_info[0].scm_branch }}"
222- skip_tags: "{{ template_info[0].skip_tags }}"
223- start_at_task: "{{ template_info[0].start_at_task }}"
224- survey_enabled: "{{ template_info[0].survey_enabled }}"
225- timeout: "{{ template_info[0].timeout }}"
226- use_fact_cache: "{{ template_info[0].use_fact_cache }}"
227- verbosity: "{{ template_info[0].verbosity }}"
228- webhook_credential: "{{ template_info[0].webhook_credential | default(omit, true) }}"
229- webhook_service: "{{ template_info[0].webhook_service }}"
230- validate_certs: "$CONTROLLER_VERIFY_SSL "
231-
232- when: project_var|length > 0
162+ - name: figure out creds for JT
163+ set_fact:
164+ credentials: "{% if template_info[0].summary_fields['credentials'] | length>0 %}{% for cred in template_info[0].summary_fields['credentials'] %}{{ cred.name }}{% if loop.length > 1 %},{% endif %}{% endfor %}{% endif %}"
165+
166+ - name: figure out creds for JT
167+ set_fact:
168+ credentials: "{% if credentials | length>0 %}{{ credentials | split(',') }}{% endif %}"
169+
170+ - name: update project for scm allow_override and scm_update_on_launch
171+ awx.awx.project:
172+ name: "{{ project_var }}"
173+ state: present
174+ description: "{{ project_info[0].description }}"
175+ organization: "{{ project_info[0].organization }}"
176+ default_environment: "{{ project_info[0].default_environment }}"
177+ scm_type: "{{ project_info[0].scm_type }}"
178+ scm_url: "$scm_url "
179+ scm_branch: "{{ project_info[0].scm_branch }}"
180+ scm_refspec: "{{ scm_refspec }}"
181+ # credential: "{{ project_info[0].credential }}"
182+ scm_clean: "{{ project_info[0].scm_clean }}"
183+ scm_delete_on_update: "{{ project_info[0].scm_delete_on_update }}"
184+ scm_track_submodules: "{{ project_info[0].scm_track_submodules }}"
185+ scm_update_on_launch: True
186+ allow_override: True
187+ validate_certs: "$CONTROLLER_VERIFY_SSL "
188+
189+ # This task is only updating ask_scm_branch_on_launch
190+ - name: update job template to turn ask_scm_branch_on_launch
191+ awx.awx.job_template:
192+ allow_simultaneous: "{{ template_info[0].allow_simultaneous }}"
193+ ask_credential_on_launch: "{{ template_info[0].ask_credential_on_launch }}"
194+ ask_diff_mode_on_launch: "{{ template_info[0].ask_diff_mode_on_launch }}"
195+ ask_inventory_on_launch: "{{ template_info[0].ask_diff_mode_on_launch }}"
196+ ask_job_type_on_launch: "{{ template_info[0].ask_job_type_on_launch }}"
197+ ask_limit_on_launch: "{{ template_info[0].ask_limit_on_launch }}"
198+ ask_scm_branch_on_launch: True
199+ ask_skip_tags_on_launch: "{{ template_info[0].ask_skip_tags_on_launch }}"
200+ ask_tags_on_launch: "{{ template_info[0].ask_tags_on_launch }}"
201+ ask_variables_on_launch: "{{ template_info[0].ask_variables_on_launch }}"
202+ ask_verbosity_on_launch: "{{ template_info[0].ask_verbosity_on_launch }}"
203+ become_enabled: "{{ template_info[0].become_enabled }}"
204+ credentials: "{{ credentials | default(omit, true) }}"
205+ description: "{{ template_info[0].description }}"
206+ diff_mode: "{{ template_info[0].diff_mode }}"
207+ execution_environment: "{{ template_info[0].execution_environment }}"
208+ extra_vars: "{% if not template_info[0].extra_vars | from_yaml %}{}{% else %}blah{% endif %}"
209+ force_handlers: "{{ template_info[0].force_handlers }}"
210+ forks: "{{ template_info[0].forks }}"
211+ host_config_key: "{{ template_info[0].host_config_key }}"
212+ inventory: "{{ template_info[0].inventory }}"
213+ job_slice_count: "{{ template_info[0].job_slice_count }}"
214+ job_tags: "{{ template_info[0].job_tags }}"
215+ job_type: "{{ template_info[0].job_type }}"
216+ limit: "{{ template_info[0].limit }}"
217+ name: "{{ template_info[0].name }}"
218+ organization: "{{ template_info[0].organization }}"
219+ playbook: "{{ template_info[0].playbook }}"
220+ project: "{{ template_info[0].project }}"
221+ scm_branch: "{{ template_info[0].scm_branch }}"
222+ skip_tags: "{{ template_info[0].skip_tags }}"
223+ start_at_task: "{{ template_info[0].start_at_task }}"
224+ survey_enabled: "{{ template_info[0].survey_enabled }}"
225+ timeout: "{{ template_info[0].timeout }}"
226+ use_fact_cache: "{{ template_info[0].use_fact_cache }}"
227+ verbosity: "{{ template_info[0].verbosity }}"
228+ webhook_credential: "{{ template_info[0].webhook_credential | default(omit, true) }}"
229+ webhook_service: "{{ template_info[0].webhook_service }}"
230+ validate_certs: "$CONTROLLER_VERIFY_SSL "
231+
232+ # when: project_var|length > 0
233233
234234 - name: launch a job and wait for the job
235235 when: job_template_var | length > 0
0 commit comments