diff --git a/roles/ceph-mon/tasks/ceph_keys.yml b/roles/ceph-mon/tasks/ceph_keys.yml index 2ddf38527..186d385f6 100644 --- a/roles/ceph-mon/tasks/ceph_keys.yml +++ b/roles/ceph-mon/tasks/ceph_keys.yml @@ -103,10 +103,6 @@ when: - cephx -- name: set_fact bootstrap_rbd_keyring - set_fact: - bootstrap_rbd_keyring: "/var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring" - - name: copy keys to the ansible server fetch: src: "{{ item }}" @@ -117,7 +113,8 @@ - /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring - /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring - /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring - - "{{ bootstrap_rbd_keyring | default([]) }}" + - /var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring + - /var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring when: - cephx - inventory_hostname == groups[mon_group_name] | last diff --git a/roles/ceph-mon/tasks/docker/copy_configs.yml b/roles/ceph-mon/tasks/docker/copy_configs.yml index 304d04371..f5a5fa917 100644 --- a/roles/ceph-mon/tasks/docker/copy_configs.yml +++ b/roles/ceph-mon/tasks/docker/copy_configs.yml @@ -8,6 +8,7 @@ - /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring - /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring - /var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring + - /var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring - name: stat for ceph config and keys stat: diff --git a/roles/ceph-rbd-mirror/tasks/common.yml b/roles/ceph-rbd-mirror/tasks/common.yml index 3750e2d06..ca168ab19 100644 --- a/roles/ceph-rbd-mirror/tasks/common.yml +++ b/roles/ceph-rbd-mirror/tasks/common.yml @@ -1,8 +1,8 @@ --- - name: copy rbd-mirror bootstrap key copy: - src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring" - dest: "/var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring" + src: "{{ fetch_directory }}/{{ fsid }}/var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring" + dest: "/var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring" owner: "{{ ceph_uid if containerized_deployment else 'ceph' }}" group: "{{ ceph_uid if containerized_deployment else 'ceph' }}" mode: "{{ ceph_keyring_permissions }}" diff --git a/roles/ceph-rbd-mirror/tasks/docker/copy_configs.yml b/roles/ceph-rbd-mirror/tasks/docker/copy_configs.yml deleted file mode 100644 index 7cd7b94b1..000000000 --- a/roles/ceph-rbd-mirror/tasks/docker/copy_configs.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -- name: set_fact ceph_config_keys - set_fact: - ceph_config_keys: - - /etc/ceph/{{ cluster }}.client.admin.keyring - - /var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring - -- name: stat for ceph config and keys - stat: - path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}" - delegate_to: localhost - with_items: "{{ ceph_config_keys }}" - changed_when: false - become: false - failed_when: false - check_mode: no - register: statconfig - when: item | length > 0 - -- name: try to fetch ceph config and keys - copy: - src: "{{ fetch_directory }}/{{ fsid }}/{{ item.0 }}" - dest: "{{ item.0 }}" - owner: root - group: root - mode: 0644 - changed_when: false - with_together: - - "{{ ceph_config_keys }}" - - "{{ statconfig.results }}" - when: - - not item.1.get('skipped') - - item.1.stat.exists == true diff --git a/roles/ceph-rbd-mirror/tasks/pre_requisite.yml b/roles/ceph-rbd-mirror/tasks/pre_requisite.yml index 29f917b89..ba2a1c6f2 100644 --- a/roles/ceph-rbd-mirror/tasks/pre_requisite.yml +++ b/roles/ceph-rbd-mirror/tasks/pre_requisite.yml @@ -9,7 +9,14 @@ - package-install - name: create rbd-mirror keyring - command: ceph --cluster {{ cluster }} --name client.bootstrap-rbd --keyring /var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring auth get-or-create client.rbd-mirror.{{ ansible_hostname }} mon 'profile rbd' osd 'profile rbd' -o /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring + command: > + ceph --cluster {{ cluster }} + --name client.bootstrap-rbd-mirror + --keyring /var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring + auth get-or-create client.rbd-mirror.{{ ansible_hostname }} + mon 'profile rbd-mirror' + osd 'profile rbd' + -o /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring args: creates: /etc/ceph/{{ cluster }}.client.rbd-mirror.{{ ansible_hostname }}.keyring changed_when: false diff --git a/tests/functional/tests/rbd-mirror/test_rbd_mirror.py b/tests/functional/tests/rbd-mirror/test_rbd_mirror.py index 7bdd15494..7d12b268b 100644 --- a/tests/functional/tests/rbd-mirror/test_rbd_mirror.py +++ b/tests/functional/tests/rbd-mirror/test_rbd_mirror.py @@ -37,7 +37,7 @@ class TestRbdMirrors(object): docker_exec_cmd = '' hostname = node["vars"]["inventory_hostname"] cluster = node['cluster_name'] - cmd = "sudo {docker_exec_cmd} ceph --name client.bootstrap-rbd --keyring /var/lib/ceph/bootstrap-rbd/{cluster}.keyring --cluster={cluster} --connect-timeout 5 -f json -s".format( + cmd = "sudo {docker_exec_cmd} ceph --name client.bootstrap-rbd-mirror --keyring /var/lib/ceph/bootstrap-rbd-mirror/{cluster}.keyring --cluster={cluster} --connect-timeout 5 -f json -s".format( docker_exec_cmd=docker_exec_cmd, hostname=hostname, cluster=cluster