docker2podman: skip some role imports from handler

when running docker-to-podman playbook, there's no need to call
`ceph-config` and `ceph-rgw` from the role `ceph-handler`.
It can even have side effects when coming from a baremetal cluster that
was previously migrated using the switch-to-containers playbook. Indeed
it might complain about missing .target systemd unit since they are
removed during that migration.

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

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 70f19be367)
pull/6447/head
Guillaume Abrioux 2021-04-09 11:02:12 +02:00
parent 03793da772
commit e84c42b33f
3 changed files with 8 additions and 6 deletions

View File

@ -65,6 +65,11 @@
gather_facts: false gather_facts: false
become: true become: true
tasks: tasks:
- name: set_fact docker2podman and container_binary
set_fact:
docker2podman: True
container_binary: podman
- import_role: - import_role:
name: ceph-defaults name: ceph-defaults
- import_role: - import_role:
@ -72,11 +77,6 @@
- import_role: - import_role:
name: ceph-handler name: ceph-handler
- name: set_fact docker2podman and container_binary
set_fact:
docker2podman: True
container_binary: podman
- name: install podman - name: install podman
package: package:
name: podman name: podman

View File

@ -6,4 +6,5 @@
- name: set_fact container_binary - name: set_fact container_binary
set_fact: set_fact:
container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_facts['distribution'] == 'Fedora') or (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '8') else 'docker' }}" container_binary: "{{ 'podman' if (podman_binary.stat.exists and ansible_facts['distribution'] == 'Fedora') or (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version'] == '8') else 'docker' }}"
when: not docker2podman | default(false) | bool

View File

@ -51,6 +51,7 @@
- name: rgw multi-instances related tasks - name: rgw multi-instances related tasks
when: when:
- not docker2podman | default(false) | bool
- inventory_hostname in groups.get(rgw_group_name, []) - inventory_hostname in groups.get(rgw_group_name, [])
- handler_rgw_status | bool - handler_rgw_status | bool
block: block: