--- # Copyright 2021 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: Render cephx key(s) in cifmw_cephadm_config_home become: true ansible.builtin.template: src: templates/ceph_key.j2 dest: "{{ cifmw_cephadm_config_home | default('/etc/ceph') }}/{{ cifmw_cephadm_cluster | default('ceph') }}.{{ item.name }}.keyring" mode: "0644" force: true owner: "{{ cifmw_cephadm_uid }}" group: "{{ cifmw_cephadm_uid }}" loop: "{{ cifmw_cephadm_keys| default([]) }}" when: - cifmw_cephadm_keys is defined - cifmw_cephadm_keys | length > 0 - name: Get ceph_cli ansible.builtin.include_tasks: ceph_cli.yml - name: Import cephx key(s) within the Ceph cluster ansible.builtin.command: cmd: >- {{ cifmw_cephadm_ceph_cli }} auth import -i {{ cifmw_cephadm_config_home | default('/etc/ceph') }}/{{ cifmw_cephadm_cluster | default('ceph') }}.{{ item.name }}.keyring become: true loop: "{{ cifmw_cephadm_keys| default([]) }}" changed_when: false when: - cifmw_cephadm_keys is defined - cifmw_cephadm_keys | length > 0