docker-to-podman: conditional docker commands

The docker commands should be based on the container_binary variable
otherwise running the playbook on a host without docker (like podman
only) will failed.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1829985

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
pull/5408/head
Dimitri Savineau 2020-05-12 11:38:47 -04:00 committed by Dimitri Savineau
parent 8ae4bbd8ca
commit 1921ace52d
1 changed files with 11 additions and 8 deletions

View File

@ -55,15 +55,18 @@
- import_role:
name: ceph-handler
- name: get docker version
command: docker --version
changed_when: false
check_mode: no
register: ceph_docker_version
- name: with docker configuration
when: container_binary == 'docker'
block:
- name: get docker version
command: docker --version
changed_when: false
check_mode: no
register: ceph_docker_version
- name: set_fact ceph_docker_version ceph_docker_version.stdout.split
set_fact:
ceph_docker_version: "{{ ceph_docker_version.stdout.split(' ')[2] }}"
- name: set_fact ceph_docker_version ceph_docker_version.stdout.split
set_fact:
ceph_docker_version: "{{ ceph_docker_version.stdout.split(' ')[2] }}"
tasks: