Commit 13ca0531 authored by Guillaume Abrioux's avatar Guillaume Abrioux
Browse files

common: improve keyrings generation



There is no need to get n * number of nodes the different keyrings.
Adding a `run_once: true` here avoid running a ceph command too many
times which could be impacting large cluster deployment.
Signed-off-by: default avatarGuillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 9bad239d)
parent 5b24c66f
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
with_items: with_items:
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
with_items: with_items:
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
- { name: "client.bootstrap-mds", path: "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring", copy_key: true } - { name: "client.bootstrap-mds", path: "/var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring", copy_key: true }
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
register: _mgr_keys register: _mgr_keys
with_items: "{{ _mgr_keys }}" with_items: "{{ _mgr_keys }}"
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
- { name: "client.bootstrap-rgw", path: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true } - { name: "client.bootstrap-rgw", path: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true }
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
- { name: "client.bootstrap-rgw", path: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true } - { name: "client.bootstrap-rgw", path: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true }
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
- { name: "client.bootstrap-osd", path: "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring", copy_key: true } - { name: "client.bootstrap-osd", path: "/var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring", copy_key: true }
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
......
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} auth get {{ item.name }}" command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} auth get {{ item.name }}"
register: _osp_keys register: _osp_keys
with_items: "{{ openstack_keys }}" with_items: "{{ openstack_keys }}"
run_once: true
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
- name: copy ceph key(s) if needed - name: copy ceph key(s) if needed
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
- { name: "client.bootstrap-rbd-mirror", path: "/var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring", copy_key: true } - { name: "client.bootstrap-rbd-mirror", path: "/var/lib/ceph/bootstrap-rbd-mirror/{{ cluster }}.keyring", copy_key: true }
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
- { name: "client.bootstrap-rgw", path: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true } - { name: "client.bootstrap-rgw", path: "/var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring", copy_key: true }
- { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" } - { name: "client.admin", path: "/etc/ceph/{{ cluster }}.client.admin.keyring", copy_key: "{{ copy_admin_key }}" }
delegate_to: "{{ groups.get(mon_group_name)[0] }}" delegate_to: "{{ groups.get(mon_group_name)[0] }}"
run_once: true
when: when:
- cephx | bool - cephx | bool
- item.copy_key | bool - item.copy_key | bool
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment