Use role tripleo-modify-image to update containers

This change uses the yum_update task file in ansible role
tripleo-modify-image to update the undercloud images.

Change-Id: I62a4b03538d26083a0ba4ce0b2e7a5b0c456134d
Blueprint: container-prepare-workflow
This commit is contained in:
Steve Baker 2018-06-05 12:59:25 +12:00 committed by Emilien Macchi
parent b3794ff03a
commit c2a3aac33f
3 changed files with 20 additions and 3 deletions

View File

@ -20,3 +20,8 @@
set_fact:
container_build_id: "{{ docker_image_tag }}"
when: container_build_id is not defined
- 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') }}"
when: update_containers and update_containers_append_tag is undefined

View File

@ -30,8 +30,6 @@ PREPARE_ARGS=${PREPARE_ARGS:-"{{ prepare_service_env_args }}"}
## populate the docker registry. This is done automatically.
## ::
BUILD_ID=${BUILD_ID:-"{{ container_build_id }}"}
{% if release not in ['ocata', 'pike', 'queens'] %}
openstack tripleo container image prepare \
--output-env-file {{ working_dir }}/containers-default-parameters.yaml \
@ -39,6 +37,7 @@ openstack tripleo container image prepare \
-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 \
@ -109,7 +108,6 @@ openstack overcloud container image upload --debug --config-file {{ working_dir
{% endif %}
--tag $BUILD_ID
{% endif %}
{% endif %}
{% if update_containers|bool and not use_overcloud_mixed_upgrade|default(false)|bool %}
# See https://github.com/imain/container-check for script and documentation
@ -141,6 +139,7 @@ if [[ -n "$packages_for_update" ]]; then
-k $packages_for_update
fi
{% endif %}
{% endif %}
echo "============================="

View File

@ -3,11 +3,24 @@ parameter_defaults:
- {{ local_docker_registry_host }}:8787
ContainerImagePrepare:
- push_destination: "{{ local_docker_registry_host }}:8787"
excludes: [ceph]
{% if update_containers|bool and not use_overcloud_mixed_upgrade|default(false)|bool %}
modify_role: tripleo-modify-image
modify_append_tag: "{{ update_containers_append_tag }}"
modify_vars:
tasks_from: yum_update.yml
compare_host_packages: true
yum_repos_dir_path: /etc/yum.repos.d
update_repo: gating-repo
{% endif %}
set:
tag: "{{ container_build_id }}"
namespace: "{{ docker_registry_host }}/{{ docker_registry_namespace_used }}"
name_prefix: "{{ docker_prep_prefix }}"
name_suffix: "{{ docker_prep_suffix }}"
- push_destination: "{{ local_docker_registry_host }}:8787"
includes: [ceph]
set:
ceph_namespace: "{{ docker_ceph_namespace }}"
ceph_image: "{{ docker_ceph_image }}"
ceph_tag: "{{ docker_ceph_tag }}"