Use container_cli for post_upgrade_tasks & external_upgrade_tasks
- Export container_cli for post_upgrade_tasks & external_deploy_tasks and external_upgrade_tasks - Replace "docker exec" by {{ container_cli }} exec in these tasks (cinder, nova, mysql, ironic and TLS). Depends-On: Iff509f4dc09862a451ad5cf915aa7764a314c28c Change-Id: I7b11f44c9255294863879aaff88d0dd1672bff6e
This commit is contained in:
parent
da224f7a9c
commit
de798c5947
@ -816,6 +816,7 @@ outputs:
|
|||||||
params:
|
params:
|
||||||
DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
|
DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
|
||||||
DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
|
DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
|
||||||
|
CONTAINER_CLI: {get_param: ContainerCli}
|
||||||
template: |
|
template: |
|
||||||
- hosts: DEPLOY_SOURCE_HOST
|
- hosts: DEPLOY_SOURCE_HOST
|
||||||
name: Gather facts from undercloud
|
name: Gather facts from undercloud
|
||||||
@ -843,6 +844,8 @@ outputs:
|
|||||||
gather_facts: no
|
gather_facts: no
|
||||||
any_errors_fatal: yes
|
any_errors_fatal: yes
|
||||||
become: false
|
become: false
|
||||||
|
vars:
|
||||||
|
container_cli: CONTAINER_CLI
|
||||||
tasks:
|
tasks:
|
||||||
- include: external_upgrade_steps_tasks.yaml
|
- include: external_upgrade_steps_tasks.yaml
|
||||||
with_sequence: start=0 end={{external_upgrade_steps_max-1}}
|
with_sequence: start=0 end={{external_upgrade_steps_max-1}}
|
||||||
@ -859,6 +862,8 @@ outputs:
|
|||||||
gather_facts: no
|
gather_facts: no
|
||||||
any_errors_fatal: yes
|
any_errors_fatal: yes
|
||||||
become: false
|
become: false
|
||||||
|
vars:
|
||||||
|
container_cli: CONTAINER_CLI
|
||||||
tasks:
|
tasks:
|
||||||
- include: external_deploy_steps_tasks.yaml
|
- include: external_deploy_steps_tasks.yaml
|
||||||
with_sequence: start=1 end={{deploy_steps_max-1}}
|
with_sequence: start=1 end={{deploy_steps_max-1}}
|
||||||
|
@ -261,7 +261,7 @@ outputs:
|
|||||||
when: cinder_api_enabled|bool
|
when: cinder_api_enabled|bool
|
||||||
tags: validation
|
tags: validation
|
||||||
- name: Ensure all online data migrations for Cinder have been applied
|
- name: Ensure all online data migrations for Cinder have been applied
|
||||||
command: docker exec cinder_api cinder-manage db online_data_migrations
|
command: "{{ container_cli }} exec cinder_api cinder-manage db online_data_migrations"
|
||||||
tags: pre-upgrade
|
tags: pre-upgrade
|
||||||
when:
|
when:
|
||||||
- is_bootstrap_node|bool
|
- is_bootstrap_node|bool
|
||||||
@ -292,7 +292,7 @@ outputs:
|
|||||||
- when: step|int == 1
|
- when: step|int == 1
|
||||||
block:
|
block:
|
||||||
- name: Online data migration for Cinder
|
- name: Online data migration for Cinder
|
||||||
command: docker exec cinder_api cinder-manage db online_data_migrations
|
command: "{{ container_cli }} exec cinder_api cinder-manage db online_data_migrations"
|
||||||
delegate_to: "{{ groups['cinder_api'][0] }}"
|
delegate_to: "{{ groups['cinder_api'][0] }}"
|
||||||
become: true
|
become: true
|
||||||
tags:
|
tags:
|
||||||
|
@ -290,7 +290,7 @@ outputs:
|
|||||||
service: name=mariadb state=stopped enabled=no
|
service: name=mariadb state=stopped enabled=no
|
||||||
post_upgrade_tasks:
|
post_upgrade_tasks:
|
||||||
- name: Check and upgrade Mysql database after major version upgrade
|
- name: Check and upgrade Mysql database after major version upgrade
|
||||||
command: docker exec -u root mysql mysql_upgrade
|
command: "{{ container_cli }} exec -u root mysql mysql_upgrade"
|
||||||
when: step|int == 2
|
when: step|int == 2
|
||||||
fast_forward_upgrade_tasks:
|
fast_forward_upgrade_tasks:
|
||||||
- when:
|
- when:
|
||||||
|
@ -197,7 +197,7 @@ outputs:
|
|||||||
- ironic_httpd_enabled|bool
|
- ironic_httpd_enabled|bool
|
||||||
- httpd_running|bool
|
- httpd_running|bool
|
||||||
- name: Ensure all online data migrations for Ironic have been applied
|
- name: Ensure all online data migrations for Ironic have been applied
|
||||||
command: docker exec ironic_api ironic-dbsync --config-file /etc/ironic/ironic.conf online_data_migrations
|
command: "{{ container_cli }} exec ironic_api ironic-dbsync --config-file /etc/ironic/ironic.conf online_data_migrations"
|
||||||
tags: pre-upgrade
|
tags: pre-upgrade
|
||||||
when:
|
when:
|
||||||
- is_bootstrap_node|bool
|
- is_bootstrap_node|bool
|
||||||
@ -227,7 +227,7 @@ outputs:
|
|||||||
- when: step|int == 1
|
- when: step|int == 1
|
||||||
block:
|
block:
|
||||||
- name: Online data migration for Ironic
|
- name: Online data migration for Ironic
|
||||||
command: docker exec ironic_api ironic-dbsync --config-file /etc/ironic/ironic.conf online_data_migrations
|
command: "{{ container_cli }} exec ironic_api ironic-dbsync --config-file /etc/ironic/ironic.conf online_data_migrations"
|
||||||
delegate_to: "{{ groups['ironic_api'][0] }}"
|
delegate_to: "{{ groups['ironic_api'][0] }}"
|
||||||
become: true
|
become: true
|
||||||
tags:
|
tags:
|
||||||
|
@ -363,7 +363,7 @@ outputs:
|
|||||||
- nova_api_httpd_enabled|bool
|
- nova_api_httpd_enabled|bool
|
||||||
- httpd_running|bool
|
- httpd_running|bool
|
||||||
- name: Ensure all online data migrations for Nova have been applied
|
- name: Ensure all online data migrations for Nova have been applied
|
||||||
command: docker exec nova_api nova-manage db online_data_migrations
|
command: "{{ container_cli }} exec nova_api nova-manage db online_data_migrations"
|
||||||
tags: pre-upgrade
|
tags: pre-upgrade
|
||||||
when:
|
when:
|
||||||
- is_bootstrap_node|bool
|
- is_bootstrap_node|bool
|
||||||
@ -398,7 +398,7 @@ outputs:
|
|||||||
- when: step|int == 1
|
- when: step|int == 1
|
||||||
block:
|
block:
|
||||||
- name: Online data migration for Nova
|
- name: Online data migration for Nova
|
||||||
command: docker exec nova_api nova-manage db online_data_migrations
|
command: "{{ container_cli }} exec nova_api nova-manage db online_data_migrations"
|
||||||
delegate_to: "{{ groups['nova_api'][0] }}"
|
delegate_to: "{{ groups['nova_api'][0] }}"
|
||||||
become: true
|
become: true
|
||||||
tags:
|
tags:
|
||||||
|
@ -186,11 +186,11 @@ outputs:
|
|||||||
register: kolla_cert_exists
|
register: kolla_cert_exists
|
||||||
|
|
||||||
- name: set certificate group on host via container
|
- name: set certificate group on host via container
|
||||||
command: docker exec {{container_id.stdout}} chgrp haproxy {{kolla_dir}}{{cert_path}}
|
command: "{{ container_cli }} exec {{container_id.stdout}} chgrp haproxy {{kolla_dir}}{{cert_path}}"
|
||||||
when: kolla_cert_exists.stat.exists
|
when: kolla_cert_exists.stat.exists
|
||||||
|
|
||||||
- name: copy certificate from kolla directory to final location
|
- name: copy certificate from kolla directory to final location
|
||||||
command: docker exec {{container_id.stdout}} cp {{kolla_dir}}{{cert_path}} {{cert_path}}
|
command: "{{ container_cli }} exec {{container_id.stdout}} cp {{kolla_dir}}{{cert_path}} {{cert_path}}"
|
||||||
when: kolla_cert_exists.stat.exists
|
when: kolla_cert_exists.stat.exists
|
||||||
|
|
||||||
- name: send restart order to haproxy container
|
- name: send restart order to haproxy container
|
||||||
|
Loading…
Reference in New Issue
Block a user