b3e7560e80
In some cases, like AZ scenarios, deployments may interact with several clusters at a time, while they will be distinguished by the cluster_name. However, ceph_client role now assumes that cluster name is `ceph` without any way to override such assumption. Change-Id: I9dcad1e1c63294f4f59a1755507904808acb785e
69 lines
2.0 KiB
YAML
69 lines
2.0 KiB
YAML
---
|
|
# Copyright 2015, Serge van Ginderachter <serge@vanginderachter.be>
|
|
#
|
|
# 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: Provide ceph configuration directory
|
|
file:
|
|
dest: /etc/ceph
|
|
state: directory
|
|
owner: root
|
|
group: root
|
|
mode: "0755"
|
|
|
|
- name: Get ceph.conf and store contents when ceph_conf_file is not defined
|
|
slurp:
|
|
src: "/etc/ceph/{{ ceph_cluster_name }}.conf"
|
|
register: ceph_conf_content_mon
|
|
delegate_to: '{{ ceph_mon_host }}'
|
|
changed_when: false
|
|
when:
|
|
- ceph_conf_file is not defined
|
|
|
|
- name: Register ceph_conf fact when ceph_conf_file is not defined
|
|
set_fact:
|
|
ceph_conf: "{{ ceph_conf_content_mon.content | b64decode }}"
|
|
when:
|
|
- ceph_conf_file is not defined
|
|
|
|
- name: Register ceph_conf fact when ceph_conf_file is defined
|
|
set_fact:
|
|
ceph_conf: "{{ ceph_conf_file }}\n\n"
|
|
when:
|
|
- ceph_conf_file is defined
|
|
|
|
- name: Create ceph.conf from mon host
|
|
openstack.config_template.config_template:
|
|
content: '{{ ceph_conf }}'
|
|
dest: "/etc/ceph/{{ ceph_cluster_name }}.conf"
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
config_type: ini
|
|
config_overrides: '{{ ceph_client_ceph_conf_overrides }}'
|
|
notify:
|
|
- Restart os services
|
|
|
|
- name: Detect correct group for extra config
|
|
set_fact:
|
|
ceph_in_extra_config_group: True
|
|
when:
|
|
- ceph_extra_confs is defined
|
|
- inventory_hostname in groups[item]
|
|
with_items: "{{ ceph_extra_config_groups }}"
|
|
|
|
- include_tasks: ceph_config_extra.yml
|
|
when:
|
|
- ceph_in_extra_config_group is defined
|
|
- ceph_in_extra_config_group | bool
|