tripleo-ansible/tripleo_ansible/roles/tripleo_cephadm/tasks/mds.yaml
Francesco Pantano 158481b8ea
Deploy RGW, MDS, Ganesha and Ceph Dashboard using cephadm
This change adds the mkspec module which is able to build
a daemon specific spec and apply it against the deployed
Ceph cluster.
In addition, multiple tasks have been added with the purpose
of integrating all the scenario004 services and properly
manage the cephadm playbook flow according to the enabled
services.

Change-Id: I35e57abddc64310a6422174fe191bd328588d7cd
2021-03-12 10:20:07 +01:00

78 lines
3.1 KiB
YAML

---
# 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.
# Assumes the following module is in ANSIBLE_LIBRARY=/usr/share/ansible/library/
# https://github.com/ceph/ceph-ansible/blob/master/library/ceph_pool.py
# Using two tasks with a boolean due to the ansible bug: https://github.com/ansible/ansible/issues/68364
- name: Collect the host and build the resulting host list
set_fact:
_hosts: "{{ _hosts|default([]) + [ hostvars[item].canonical_hostname ] }}"
with_items: "{{ groups['ceph_mds'] }}"
when: tripleo_cephadm_fqdn | bool
- name: Collect the host and build the resulting host list
set_fact:
_hosts: "{{ _hosts|default([]) + [ hostvars[item].inventory_hostname ] }}"
with_items: "{{ groups['ceph_mds'] }}"
when: not tripleo_cephadm_fqdn | bool
- name: Create the mds Daemon spec definition
become: true
ceph_mkspec:
service_type: mds
apply: true
hosts: "{{ _hosts }}"
render_path: "{{ tripleo_cephadm_spec_home }}"
register: spc
environment:
CEPH_CONTAINER_IMAGE: "{{ tripleo_cephadm_container_ns + '/' + tripleo_cephadm_container_image + ':' + tripleo_cephadm_container_tag }}"
CEPH_CONTAINER_BINARY: "{{ tripleo_cephadm_container_cli }}"
- name: create filesystem pools
ceph_pool:
name: "{{ item.name }}"
cluster: "{{ tripleo_cephadm_cluster }}"
pg_num: "{{ item.pg_num | default(omit) }}"
pgp_num: "{{ item.pgp_num | default(omit) }}"
size: "{{ item.size | default(omit) }}"
min_size: "{{ item.min_size | default(omit) }}"
pool_type: "{{ item.type | default('replicated') }}"
rule_name: "{{ item.rule_name | default(omit) }}"
erasure_profile: "{{ item.erasure_profile | default(omit) }}"
pg_autoscale_mode: "{{ item.pg_autoscale_mode | default(omit) }}"
target_size_ratio: "{{ item.target_size_ratio | default(omit) }}"
environment:
CEPH_CONTAINER_IMAGE: "{{ tripleo_cephadm_container_ns + '/' + tripleo_cephadm_container_image + ':' + tripleo_cephadm_container_tag }}"
CEPH_CONTAINER_BINARY: "{{ tripleo_cephadm_container_cli }}"
with_items: "{{ cephfs_pools }}"
become: true
vars:
cephfs_pools:
- "{{ cephfs_data_pool }}"
- "{{ cephfs_metadata_pool }}"
- name: create ceph filesystem
ceph_fs:
name: "{{ cephfs|default('cephfs') }}"
cluster: "{{ tripleo_cephadm_cluster }}"
data: "{{ cephfs_data_pool.name }}"
metadata: "{{ cephfs_metadata_pool.name }}"
become: true
environment:
CEPH_CONTAINER_IMAGE: "{{ tripleo_cephadm_container_ns + '/' + tripleo_cephadm_container_image + ':' + tripleo_cephadm_container_tag }}"
CEPH_CONTAINER_BINARY: "{{ tripleo_cephadm_container_cli }}"