Build osd caps section when there's at least >= 1 pool

When Ceph is deployed by TripleO but no services using
it are explicitly enabled in TripleO, an empty pool list
if generated (for the same reason), and the osd caps
results in an empty string, turning the cluster in a
non healthy status.
This patch introduces two new tasks to selectively create
osd caps when profiles >= 0.

Closes-Bug: #1917440
Change-Id: Id165c19121c9036a33b10d6b6d51f3bdc528307b
This commit is contained in:
Francesco Pantano 2021-03-02 10:58:43 +01:00
parent 4a6b7c55f9
commit 594642ba8f
No known key found for this signature in database
GPG Key ID: 0458D4D1F41BD75C
1 changed files with 10 additions and 1 deletions

View File

@ -29,7 +29,16 @@
- name: set openstack client caps
set_fact:
osp_client_caps: {'mgr': 'allow *', 'mon': 'profile rbd', 'osd': "{{ profiles | regex_replace('\\, $', '') }}"}
osp_client_default_caps: {'mgr': 'allow *', 'mon': 'profile rbd'}
- name: set openstack client osd(s) caps
set_fact:
osp_client_osd_caps: {'osd': "{{ profiles | regex_replace('\\, $', '') }}"}
when: profiles|length > 0
- name: Combine caps
set_fact:
osp_client_caps: "{{ osp_client_default_caps | combine(osp_client_osd_caps|default({})) }}"
- name: set openstack client key
set_fact: