Skip to content

Commit

Permalink
docker2podman: skip some role imports from handler
Browse files Browse the repository at this point in the history
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 70f19be)
  • Loading branch information
guits committed Apr 12, 2021
1 parent 03793da commit e84c42b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions infrastructure-playbooks/docker-to-podman.yml
Expand Up @@ -65,18 +65,18 @@
gather_facts: false
become: true
tasks:
- name: set_fact docker2podman and container_binary
set_fact:
docker2podman: True
container_binary: podman

- import_role:
name: ceph-defaults
- import_role:
name: ceph-facts
- import_role:
name: ceph-handler

- name: set_fact docker2podman and container_binary
set_fact:
docker2podman: True
container_binary: podman

- name: install podman
package:
name: podman
Expand Down
3 changes: 2 additions & 1 deletion roles/ceph-facts/tasks/container_binary.yml
Expand Up @@ -6,4 +6,5 @@

- name: set_fact container_binary
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
1 change: 1 addition & 0 deletions roles/ceph-handler/tasks/main.yml
Expand Up @@ -51,6 +51,7 @@

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

0 comments on commit e84c42b

Please sign in to comment.