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:
Kevin Carter 2019-06-25 23:20:34 -05:00
parent a3cd1feccf
commit f13fb3f3bc
2 changed files with 10 additions and 0 deletions

View File

@ -35,3 +35,6 @@ tripleo_container_pull_image: "{{ pull_image | default(true) }}"
# Name of the tag
tripleo_container_image_latest: "{{ container_image_latest | default('latest') }}"
# Set the default container image if undefined
tripleo_container_image: "{{ container_image | default('') }}"

View File

@ -17,6 +17,13 @@
# "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
shell: "{{ tripleo_container_cli }} pull {{ tripleo_container_image }}"
when: