Skip to content

Commit

Permalink
docker-to-podman: conditional docker commands
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dsavineau committed Jun 3, 2020
1 parent 8ae4bbd commit 1921ace
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions infrastructure-playbooks/docker-to-podman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: set_fact ceph_docker_version ceph_docker_version.stdout.split
set_fact:
ceph_docker_version: "{{ ceph_docker_version.stdout.split(' ')[2] }}"
- 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] }}"


tasks:
Expand Down

0 comments on commit 1921ace

Please sign in to comment.