]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rbd-mirror: follow up on recent rbd-mirror refactor
authorGuillaume Abrioux <gabrioux@redhat.com>
Mon, 1 Aug 2022 18:18:50 +0000 (20:18 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 2 Aug 2022 08:35:33 +0000 (10:35 +0200)
- ensure /var/lib/ceph/bootstrap-rbd-mirror exists
- always install ceph-base on rbdmirror nodes (otherwise, ceph-crash
  isn't present)

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml
roles/ceph-common/vars/main.yml
roles/ceph-rbd-mirror/tasks/configure_mirroring.yml

index d07e271d0bb154061f7a381057c132c13fb6937e..6b248a08e29706d304b3ac519a56d4442998d65e 100644 (file)
   serial: 1
   become: true
   pre_tasks:
+    - name: check for ceph rbd mirror services
+      command: systemctl show --no-pager --property=Id --state=enabled ceph-rbd-mirror@*  # noqa 303
+      changed_when: false
+      register: rbdmirror_services
+
     - name: stop non-containerized ceph rbd mirror(s)
       service:
-        name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_facts['hostname'] }}"
+        name: "{{ item.split('=')[1] }}"
         state: stopped
         enabled: no
+      loop: "{{ rbdmirror_services.stdout_lines }}"
 
     - name: remove old systemd unit files
       file:
index 1f51b204aca96355f770099b8f448ef5eed76220..edfafdfe1bacf5e9a6dc437a864e7b53af50d186 100644 (file)
@@ -10,6 +10,7 @@ debian_ceph_pkgs:
   - "{{ (ceph_test | bool) | ternary('ceph-test', 'ceph-common') }}"
   - "{{ (rgw_group_name in group_names) | ternary('radosgw', 'ceph-common') }}"
   - "{{ ((ceph_repository == 'rhcs') and (client_group_name in group_names)) | ternary('ceph-fuse', 'ceph-common') }}"
+  - "{{ (rbdmirror_group_name in group_names) | ternary('ceph-base', 'ceph-common') }}"
 
 redhat_ceph_pkgs:
   - "{{ (ceph_test | bool) | ternary('ceph-test', 'ceph-common') }}"
@@ -20,6 +21,7 @@ redhat_ceph_pkgs:
   - "{{ (client_group_name in group_names) | ternary('ceph-fuse', 'ceph-common') }}"
   - "{{ (client_group_name in group_names) | ternary('ceph-base', 'ceph-common') }}"
   - "{{ (rgw_group_name in group_names) | ternary('ceph-radosgw', 'ceph-common') }}"
+  - "{{ (rbdmirror_group_name in group_names) | ternary('ceph-base', 'ceph-common') }}"
 
 suse_ceph_pkgs:
   - "{{ (ceph_test | bool) | ternary('ceph-test', 'ceph-common') }}"
@@ -30,3 +32,4 @@ suse_ceph_pkgs:
   - "{{ (client_group_name in group_names) | ternary('ceph-fuse', 'ceph-common') }}"
   - "{{ (client_group_name in group_names) | ternary('ceph-base', 'ceph-common') }}"
   - "{{ (rgw_group_name in group_names) | ternary('ceph-radosgw', 'ceph-common') }}"
+  - "{{ (rbdmirror_group_name in group_names) | ternary('ceph-base', 'ceph-common') }}"
index 4c323df8d332f599d1b274049e007287f5b0039c..de547a7866bea830473d40927900059211fd7cd6 100644 (file)
       run_once: true
       no_log: "{{ no_log_on_ceph_key_tasks }}"
 
+    - name: ensure /var/lib/ceph/bootstrap-rbd-mirror exists
+      file:
+        path: /var/lib/ceph/bootstrap-rbd-mirror
+        state: directory
+        owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+        group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
+
     - name: copy ceph key(s)
       copy:
         dest: "/var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring"