Add default for the container_image option
This creates a default option for `tripleo_container_image` and a failure condition when the option is undefined. Closes-Bug: #1834283 Change-Id: Ice80e74b177bfaeedc22f51572e434c01dea18fc Signed-off-by: Kevin Carter <kevin@cloudnull.com>
This commit is contained in:
parent
a3cd1feccf
commit
f13fb3f3bc
|
@ -35,3 +35,6 @@ tripleo_container_pull_image: "{{ pull_image | default(true) }}"
|
||||||
|
|
||||||
# Name of the tag
|
# Name of the tag
|
||||||
tripleo_container_image_latest: "{{ container_image_latest | default('latest') }}"
|
tripleo_container_image_latest: "{{ container_image_latest | default('latest') }}"
|
||||||
|
|
||||||
|
# Set the default container image if undefined
|
||||||
|
tripleo_container_image: "{{ container_image | default('') }}"
|
||||||
|
|
|
@ -17,6 +17,13 @@
|
||||||
|
|
||||||
# "tripleo-container-tag" will search for and load any operating system variable file
|
# "tripleo-container-tag" will search for and load any operating system variable file
|
||||||
|
|
||||||
|
- name: Fail if container image is undefined
|
||||||
|
fail:
|
||||||
|
msg: >-
|
||||||
|
The variable `tripleo_container_image` is an empty set. Check the settings.
|
||||||
|
when:
|
||||||
|
- (tripleo_container_image | length) < 1
|
||||||
|
|
||||||
- name: Pull {{ tripleo_container_image }} image
|
- name: Pull {{ tripleo_container_image }} image
|
||||||
shell: "{{ tripleo_container_cli }} pull {{ tripleo_container_image }}"
|
shell: "{{ tripleo_container_cli }} pull {{ tripleo_container_image }}"
|
||||||
when:
|
when:
|
||||||
|
|
Loading…
Reference in New Issue