set container variables when needed

Only run container tasks when required to:
1. prior to undercloud
2. prior to overcloud-prep-containers
3. prior to standalone deployment

Closes-Bug: #1777896
Change-Id: I50054a95500747972454305001d34c4c97b71e7f
This commit is contained in:
Wes Hayutin 2018-06-20 12:14:00 -04:00 committed by wes hayutin
parent 1329dc1fd1
commit 2037e9a415
9 changed files with 43 additions and 27 deletions

View File

@ -0,0 +1,9 @@
container-prep
==============
The containers used by TripleO are now in use in multiple parts of the
workflow. This role is a common role for containers that can be used
to setup either for the undercloud, standalone or overcloud-prep-containers.
Role Variables
--------------

View File

@ -0,0 +1 @@
---

View File

@ -0,0 +1,2 @@
dependencies:
- extras-common

View File

@ -0,0 +1,27 @@
# Conditional facts to be set which are common to undercloud and overcloud
- name: set docker_registry_namespace_used
set_fact:
docker_registry_namespace_used: "{{ docker_registry_namespace }}"
- name: set container_build_id from get_build_command
set_fact:
container_build_id: "{{ get_build_command }}"
when: get_build_command is defined
- name: set mixed upgrade container_build_id
set_fact:
container_build_id: "{{ overcloud_docker_image_tag }}"
docker_registry_namespace_used: "{{ overcloud_docker_registry_namespace }}"
when:
- container_build_id is not defined
- use_overcloud_mixed_upgrade|default(false)|bool
- name: set container_build_id from docker_image_tag
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 is defined and update_containers|bool and update_containers_append_tag is undefined

View File

@ -1,27 +0,0 @@
# Conditional facts to be set which are common to undercloud and overcloud
- name: set docker_registry_namespace_used
set_fact:
docker_registry_namespace_used: "{{ docker_registry_namespace }}"
- name: set container_build_id from get_build_command
set_fact:
container_build_id: "{{ get_build_command }}"
when: get_build_command is defined
- name: set mixed upgrade container_build_id
set_fact:
container_build_id: "{{ overcloud_docker_image_tag }}"
docker_registry_namespace_used: "{{ overcloud_docker_registry_namespace }}"
when:
- container_build_id is not defined
- use_overcloud_mixed_upgrade|default(false)|bool
- name: set container_build_id from docker_image_tag
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 is defined and update_containers|bool and update_containers_append_tag is undefined

View File

@ -1,2 +1,3 @@
dependencies:
- extras-common
- container-prep

View File

@ -1,2 +1,3 @@
dependencies:
- extras-common
- container-prep

View File

@ -1,2 +1,3 @@
dependencies:
- extras-common
- container-prep

View File

@ -1,2 +1,3 @@
dependencies:
- extras-common
- container-prep