[train-only] Set oc_container_cli for checks during ffu

Furing FFWD workflow, the validation gets triggered as part of the
pre-upgrade group. When it gets triggered, the environment is in
state where the Undercloud has been upgrade to OSP16.1 (container
engine is podman) but the Overcloud nodes are still on OSP13
(container engine is still docker).

This patch is similar to I46c4fbe0ef7b281d77bff82483eb0b48b4570bb3
to check which container cli should be used.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1963872

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: I15b105d03193a83ab7bbf3e911cbb37974a54495
This commit is contained in:
Gael Chamoulaud (Strider) 2021-05-27 12:02:42 +02:00
parent c906f181a0
commit 4dd513cee6
No known key found for this signature in database
GPG Key ID: 4119D0305C651D66
1 changed files with 16 additions and 6 deletions

View File

@ -1,10 +1,20 @@
---
- name: Set oc_container_cli fact for the Overcloud nodes
set_fact:
oc_container_cli: "{{ hostvars[inventory_hostname].container_cli | default('podman', true) }}"
when:
- "'overcloud' in group_names"
- oc_container_cli is not defined
- when: "'overcloud' in group_names"
block:
- name: Check for docker cli
stat:
path: "/var/run/docker.sock"
register: check_docker_cli
check_mode: false
- name: Set oc_container_cli fact for the Overcloud nodes
set_fact:
oc_container_cli: |-
{% set oc_container_cli = 'podman' %}
{% if check_docker_cli.stat.exists|bool %}
{% set oc_container_cli = 'docker' %}
{% endif %}
{{ oc_container_cli }}
- when: "'Undercloud' in group_names"
block: