WIP: attempt cleanup on container build id vars

Change-Id: Ia767988dae7bf3c01b74fd719facf9f20daa6059
This commit is contained in:
Wes Hayutin 2019-03-13 17:34:39 -06:00 committed by Marios Andreou
parent 9a90158e55
commit c6eaa9d8cb
3 changed files with 25 additions and 22 deletions

View File

@ -1,11 +1,20 @@
---
# Conditional facts to be set which are common to undercloud and overcloud
# confirmed variables for deploy and mixed upgrade
# GOOD
# docker_registry_namespace
# http://git.openstack.org/cgit/openstack/tripleo-quickstart/tree/config/release/tripleo-ci/CentOS-7/master-undercloud-queens-overcloud.yml
- name: set docker_registry_namespace_used
set_fact:
docker_registry_namespace_used: "{{ docker_registry_namespace }}"
tags:
- undercloud-install
# get_build_command is passing the current hash
# plus the latest dlrn hash and I'm not sure why
# http://git.openstack.org/cgit/openstack-infra/tripleo-ci/tree/roles/run-test/templates/oooq_common_functions.sh.j2#n155
- when: get_build_command is defined
block:
- name: execute build_command
@ -21,6 +30,19 @@
tags:
- undercloud-install
# docker_image_tag is set to the dlrn hash but uses the tag
# as a backup default
# "{{ dlrn_hash|default(dlrn_hash_tag) }}"
- name: set container_build_id from docker_image_tag
set_fact:
container_build_id: "{{ docker_image_tag }}"
cacheable: true
tags:
- undercloud-install
# overcloud_docker_image_tag is set to overcloud_dlrn_hash
# I don't see where overcloud_dlrn_hash is set
# http://codesearch.openstack.org/?q=overcloud_dlrn_hash&i=nope&files=&repos=
- name: set mixed upgrade container_build_id
set_fact:
container_build_id: "{{ overcloud_docker_image_tag }}"
@ -32,14 +54,6 @@
tags:
- undercloud-install
- name: set container_build_id from docker_image_tag
set_fact:
container_build_id: "{{ docker_image_tag }}"
cacheable: true
when: container_build_id is not defined
tags:
- undercloud-install
- name: Set update_containers_append_tag for the play
set_fact:
update_containers_append_tag: "{{ lookup('pipe','date +-updated-%Y%m%d%H%M%S') }}"
@ -48,12 +62,6 @@
tags:
- undercloud-install
- name: Finally set container_build_id when it's not set by the above
set_fact:
container_build_id: "{{ dlrn_hash_tag }}"
cacheable: true
when: container_build_id is not defined
- name: echo container_build_id
debug:
var: container_build_id

View File

@ -37,14 +37,13 @@ openstack tripleo container image prepare --verbose \
-e {{ working_dir }}/containers-prepare-parameter.yaml
{% else %}
BUILD_ID=${BUILD_ID:-"{{ container_build_id }}"}
openstack overcloud container image prepare \
--output-images-file {{ working_dir }}/overcloud_containers.yaml \
--output-env-file {{ working_dir }}/containers-default-parameters.yaml \
${PREPARE_ARGS} \
--namespace {{ docker_registry_host }}/{{ docker_registry_namespace_used }} \
--tag $BUILD_ID \
--tag {{ container_build_id }} \
{% if docker_prep_prefix is defined %}
--prefix "{{ docker_prep_prefix }}" \
{% endif %}
@ -208,7 +207,7 @@ openstack overcloud container image upload --debug --config-file {{ working_dir
{% if docker_ceph_tag is defined %}
--set "ceph_tag={{ docker_ceph_tag }}" \
{% endif %}
--tag $BUILD_ID
--tag {{ container_build_id }}
{% endif %}
{% if update_containers|bool and not use_overcloud_mixed_upgrade|default(false)|bool %}
@ -233,7 +232,7 @@ if [[ -n "$packages_for_update" ]]; then
{% if docker_prep_suffix is defined %}
--suffix "{{ docker_prep_suffix }}" \
{% endif %}
--tag $BUILD_ID
--tag {{ container_build_id }}
container-check -u \
-c {{ working_dir }}/containers_update.yaml \

View File

@ -16,10 +16,6 @@ set -eux
export {{ var }}
{% endfor %}
## * get build id
## ::
BUILD_ID={{ container_build_id }}
## * Set the local ip used for the undercloud install
## ::