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:
Emilien Macchi 2018-11-05 11:44:31 -05:00
parent da224f7a9c
commit de798c5947
6 changed files with 14 additions and 9 deletions

View File

@ -816,6 +816,7 @@ outputs:
params:
DEPLOY_SOURCE_HOST: {get_param: deployment_source_hosts}
DEPLOY_TARGET_HOST: {get_param: deployment_target_hosts}
CONTAINER_CLI: {get_param: ContainerCli}
template: |
- hosts: DEPLOY_SOURCE_HOST
name: Gather facts from undercloud
@ -843,6 +844,8 @@ outputs:
gather_facts: no
any_errors_fatal: yes
become: false
vars:
container_cli: CONTAINER_CLI
tasks:
- include: external_upgrade_steps_tasks.yaml
with_sequence: start=0 end={{external_upgrade_steps_max-1}}
@ -859,6 +862,8 @@ outputs:
gather_facts: no
any_errors_fatal: yes
become: false
vars:
container_cli: CONTAINER_CLI
tasks:
- include: external_deploy_steps_tasks.yaml
with_sequence: start=1 end={{deploy_steps_max-1}}

View File

@ -261,7 +261,7 @@ outputs:
when: cinder_api_enabled|bool
tags: validation
- 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
when:
- is_bootstrap_node|bool
@ -292,7 +292,7 @@ outputs:
- when: step|int == 1
block:
- 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] }}"
become: true
tags:

View File

@ -290,7 +290,7 @@ outputs:
service: name=mariadb state=stopped enabled=no
post_upgrade_tasks:
- 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
fast_forward_upgrade_tasks:
- when:

View File

@ -197,7 +197,7 @@ outputs:
- ironic_httpd_enabled|bool
- httpd_running|bool
- 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
when:
- is_bootstrap_node|bool
@ -227,7 +227,7 @@ outputs:
- when: step|int == 1
block:
- 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] }}"
become: true
tags:

View File

@ -363,7 +363,7 @@ outputs:
- nova_api_httpd_enabled|bool
- httpd_running|bool
- 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
when:
- is_bootstrap_node|bool
@ -398,7 +398,7 @@ outputs:
- when: step|int == 1
block:
- 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] }}"
become: true
tags:

View File

@ -186,11 +186,11 @@ outputs:
register: kolla_cert_exists
- 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
- 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
- name: send restart order to haproxy container