Use container_cli instead of docker to run mysql upgrade command.

We can't assume that docker will be in the environment anymore.

Change-Id: I99d08d19c708a1e5fff92d14bf30ceb849153d8f
This commit is contained in:
Sofer Athlan-Guyot 2019-03-13 11:17:10 +01:00 committed by Emilien Macchi
parent 8895739702
commit c693ba6648

View File

@ -557,12 +557,13 @@ outputs:
shell:
str_replace:
template:
'/usr/bin/docker run --rm --log-driver=syslog -u root --net=host UPGRADE_ENV UPGRADE_VOLUMES "UPGRADE_IMAGE" /bin/bash -ecx "UPGRADE_SCRIPT"'
'CONTAINER_CLI run --rm --log-driver=syslog -u root --net=host UPGRADE_ENV UPGRADE_VOLUMES "UPGRADE_IMAGE" /bin/bash -ecx "UPGRADE_SCRIPT"'
params:
UPGRADE_ENV: '-e "KOLLA_CONFIG_STRATEGY=COPY_ALWAYS"'
UPGRADE_IMAGE: *mysql_image_pcmklatest
UPGRADE_VOLUMES: "-v {{ mysql_upgrade_db_bind_mounts | union(['/tmp/mariadb-upgrade:/var/log/mariadb:rw']) | join(' -v ')}}"
UPGRADE_SCRIPT: "{{mysql_upgrade_script}}"
CONTAINER_CLI: "{{ container_cli }}"
when: mysql_containerized|bool
- name: Upgrade Mysql database from the host
shell: /bin/bash -ecx "{{mysql_upgrade_script}}"