Merge "Run image prepare after registry install"

This commit is contained in:
Zuul 2018-06-01 22:23:51 +00:00 committed by Gerrit Code Review
commit a33d05d30d
1 changed files with 36 additions and 0 deletions

View File

@ -34,6 +34,12 @@ parameters:
default: ''
description: The IP address used to bind the local container registry
type: string
ContainerImagePrepare:
default: {}
description: Used to run "openstack tripleo container image prepare".
This is run after the registry is installed to populate
the registry with images.
type: json
conditions:
local_container_registry_is_empty: {equals : [{get_param: LocalContainerRegistry}, '']}
@ -65,6 +71,36 @@ outputs:
- include_role:
name: container-registry
tasks_from: docker-distribution
- name: Create temp file for prepare parameter
tempfile:
state: file
suffix: -prepare-param
register: prepare_param
- name: Create temp file for role data
tempfile:
state: file
suffix: -role-data
register: role_data
- name: Write ContainerImagePrepare parameter file
copy:
dest: "{{ '{{' }} prepare_param.path {{ '}}' }}"
content:
parameter_defaults:
ContainerImagePrepare: {get_param: ContainerImagePrepare}
- name: Write role data file
copy:
dest: "{{ '{{' }} role_data.path {{ '}}' }}"
content: {{ roles }}
- name: Run openstack tripleo container image prepare
command: openstack tripleo container image prepare --roles-file {{ '{{' }} role_data.path {{ '}}' }} --environment-file {{ '{{' }} prepare_param.path {{ '}}' }}
- name: Delete param file
file:
dest: "{{ '{{' }} prepare_param.path {{ '}}' }}"
state: absent
- name: Delete role file
file:
dest: "{{ '{{' }} role_data.path {{ '}}' }}"
state: absent
upgrade_tasks:
- name: Install docker packages on upgrade if missing
when: step|int == 3