Check if image_pull_secrets variable is defined (#865)

* Do not attempt to backup secret if none are defined
This commit is contained in:
Christian Adams
2022-04-11 11:10:09 -04:00
committed by GitHub
parent 5e81729bc9
commit 1b41d945e6

View File

@@ -26,13 +26,15 @@
# image_pull_secret is deprecated in favor of image_pull_secrets
- name: Dump image_pull_secret into file
include_tasks: dump_secret.yml
loop:
with_items:
- image_pull_secret
when: image_pull_secret is defined
- name: Dump image_pull_secrets into file
include_tasks: dump_secret.yml
loop: "{{ awx_spec.spec[image_pull_secrets] }}"
with_items:
- image_pull_secrets
when: image_pull_secrets | default([]) | length
- name: Nest secrets under a single variable
set_fact: