--- # Copyright 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 placement string block: - name: Collect the host and build the resulting host list ansible.builtin.set_fact: _hosts: "{{ _hosts|default([]) + [ item ] }}" with_items: "{{ groups[cifmw_ceph_target | default('computes')] | default([]) }}" - name: Collect the target hosts ansible.builtin.set_fact: placement: "{{ ''.join((placement|default(''), (item+' '))) }}" with_items: "{{ _hosts | unique }}" - name: Get ceph_cli ansible.builtin.include_tasks: ceph_cli.yml - name: Create a Ceph MDS spec ansible.builtin.template: src: templates/ceph_mds.yml.j2 dest: "{{ cifmw_ceph_mds_spec_path }}" mode: '0644' force: true - name: Get ceph_cli ansible.builtin.include_tasks: ceph_cli.yml vars: mount_spec: true cifmw_cephadm_spec: "{{ cifmw_ceph_mds_spec_path }}" - name: Apply cephfs volume ansible.builtin.command: | {{ cifmw_cephadm_ceph_cli }} fs volume create {{ cifmw_cephadm_cephfs_name }} '--placement={{ placement }}' changed_when: false become: true - name: Apply the MDS spec ansible.builtin.command: "{{ cifmw_cephadm_ceph_cli }} orch apply --in-file {{ cifmw_cephadm_container_spec }}" become: true