--- # 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: Create Ceph Pools become: true when: - cifmw_cephadm_pools is defined - cifmw_cephadm_pools | length > 0 block: - name: Get ceph_cli ansible.builtin.include_tasks: ceph_cli.yml - name: Create RBD pools # Good to have pool creation for cephfs application type so that # it helps nfs ganesha in adoption context when: item.application in ['rbd', 'cephfs'] ansible.builtin.command: cmd: >- {{ cifmw_cephadm_ceph_cli }} osd pool create {{ item.name }} {{ item.pg_num | default('') }} {{ item.rule_name | default('replicated_rule') }} --autoscale-mode {{ item.pg_autoscale | default('on') }} loop: "{{ cifmw_cephadm_pools | default([]) }}" changed_when: false - name: Enable application on Ceph RBD pools when: item.application in ['rbd', 'cephfs'] ansible.builtin.command: cmd: >- {{ cifmw_cephadm_ceph_cli }} osd pool application enable {{ item.name }} {{ item.application }} loop: "{{ cifmw_cephadm_pools | default([]) }}" changed_when: false - name: Configure the RBD trash purge scheduler when: - cifmw_cephadm_enable_trash_scheduler | default(false) - cifmw_cephadm_pools is defined - cifmw_cephadm_pools | length > 0 block: - name: Get the RBD ceph_cli ansible.builtin.include_tasks: ceph_cli.yml vars: ceph_command: rbd - name: Set trash interval when: item.trash_purge_enabled | default(false) ansible.builtin.command: cmd: >- {{ cifmw_cephadm_ceph_cli }} trash purge schedule add {{ cifmw_cephadm_rbd_trash_interval | default(15) }} --pool {{ item.name }} changed_when: false become: true loop: "{{ cifmw_cephadm_pools | default([]) }}"