tripleo-ansible/tripleo_ansible/roles/tripleo_ceph_work_dir/tasks/build_config_overrides.yml

44 lines
1.7 KiB
YAML

---
# Copyright 2020 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: build ceph orphan set
set_fact:
ceph_orphan: |-
{% set ceph_orphan = {} %}
{% for key, value in (ceph_config_overrides | default({})).items() %}
{% if not (['global', 'mon', 'mgr', 'osd', 'mds', 'client']) | intersect([key]) %}
{% set _ = ceph_orphan.__setitem__(key, value) %}
{% endif %}
{% endfor %}
{{ ceph_orphan }}
- name: clean ceph_config_overrides list
set_fact:
config_overrides: "{{ config_overrides|default({})|combine({item.key: item.value}, recursive=True) }}"
when:
- not (ceph_orphan.keys() | intersect([item.key]))
with_dict: "{{ ceph_config_overrides|default({}) }}"
- name: ceph_config_overrides w/o orphans
set_fact:
ceph_orphan: "{{ {'global': ceph_orphan|default({}) } }}"
when: ceph_orphan.keys() | length > 0
- name: build ceph config overrides
set_fact:
ceph_overrides: "{'ceph_conf_overrides': {{ ceph_default_overrides|default({}) |combine(config_overrides|default({}), recursive=True)
|combine(ceph_rgw_config_overrides|default({}), recursive=True)|combine(ceph_orphan|default({}), recursive=True)}} }"