]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
docker2podman: skip some role imports from handler
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 9 Apr 2021 09:02:12 +0000 (11:02 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 12 Apr 2021 11:30:09 +0000 (13:30 +0200)
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 70f19be367390aeca43340711d380ce4825e02b5)

infrastructure-playbooks/docker-to-podman.yml
roles/ceph-facts/tasks/container_binary.yml
roles/ceph-handler/tasks/main.yml

index 16bde3e63d35f06c1684f14767eb9f099680dea6..92d297ea6294e62c6f2fb48333c7d7a8fb745253 100644 (file)
   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:
     - 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
index 44249419f4e3f4125b64723576fa52d1b3b67f41..0054f7848ce38ae13ae260e184981431e16789ca 100644 (file)
@@ -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' }}"
\ No newline at end of file
+    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
\ No newline at end of file
index 099ad3b3039dc5be6b4fda0708d4ecfc69657351..a8c76f5198156b8ce5876a27b6ae4f156151defd 100644 (file)
@@ -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: