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>
changes/05/667505/3
Kevin Carter 3 years ago
parent a3cd1feccf
commit f13fb3f3bc
  1. 3
      tripleo_ansible/roles/tripleo-container-tag/defaults/main.yml
  2. 7
      tripleo_ansible/roles/tripleo-container-tag/tasks/main.yml

@ -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('') }}"

@ -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:

Loading…
Cancel
Save