-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.yml
86 lines (75 loc) · 3.99 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
# Copyright 2024 Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
#
# 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.
# Ceph release.
ceph_release: "{{ _ceph_release }}"
# Ceph version.
ceph_version: "{{ _ceph_version[ceph_release] }}"
# Ceph fsid.
ceph_fsid: "{{ hostvars[groups['ceph_mon'][0]].ansible_machine_id | to_uuid }}"
# Ceph Monitor initial members.
ceph_mon_initial_members: >-
{%- set _ns = namespace() -%}
{%- set _ns._params = [] -%}
{%- for host in groups['ceph_mon'] -%}
{%- set _ns._params = _ns._params + [host] -%}
{%- endfor -%}
{{ _ns._params | join(',') }}
# Ceph Monitor host.
ceph_mon_host: >-
{%- set _ns = namespace() -%}
{%- set _ns._params = [] -%}
{%- for host in groups['ceph_mon'] -%}
{%- set _ns._params = _ns._params + [hostvars[host].ansible_default_ipv4.address] -%}
{%- endfor -%}
{{ _ns._params | join(',') }}
# Ceph public network.
ceph_public_network: "{{ (ansible_default_ipv4.network + '/' + ansible_default_ipv4.prefix) }}"
# Ceph cluster network.
ceph_cluster_network: "{{ (ansible_default_ipv4.network + '/' + ansible_default_ipv4.prefix) }}"
# Ceph global configs.
ceph_common_config:
- { state: present, section: global, option: cluster_network, value: "{{ ceph_cluster_network }}" }
- { state: present, section: global, option: fsid, value: "{{ ceph_fsid }}" }
- { state: present, section: global, option: mon_host, value: "{{ ceph_mon_host }}" }
- { state: present, section: global, option: mon_initial_members, value: "{{ ceph_mon_initial_members }}" }
- { state: present, section: global, option: public_network, value: "{{ ceph_public_network }}" }
- { state: present, section: global, option: auth_client_required, value: cephx }
- { state: present, section: global, option: auth_cluster_required, value: cephx }
- { state: present, section: global, option: auth_service_required, value: cephx }
- { state: present, section: global, option: mon_max_pg_per_osd, value: "1024" }
- { state: present, section: global, option: mon_osd_backfillfull_ratio, value: "0.9" }
- { state: present, section: global, option: mon_osd_full_ratio, value: "0.95" }
- { state: present, section: global, option: mon_osd_nearfull_ratio, value: "0.85" }
- { state: present, section: global, option: mon_pg_warn_max_object_skew, value: "-1" }
- { state: present, section: global, option: mon_warn_on_pool_no_redundancy, value: "false" }
- { state: present, section: global, option: osd_pool_default_min_size, value: "1" }
- { state: present, section: global, option: osd_pool_default_pg_autoscale_mode, value: "on" }
- { state: present, section: global, option: osd_pool_default_pg_num, value: "8" }
- { state: present, section: global, option: osd_pool_default_pgp_num, value: "8" }
- { state: present, section: global, option: osd_pool_default_size, value: "1" }
- { state: present, section: client, option: client_oc_max_dirty, value: "16777216" }
- { state: present, section: client, option: client_oc_size, value: "33554432" }
- { state: present, section: client, option: client_oc_target_dirty, value: "8388608" }
# Kernel modules.
ceph_modprobe:
- { state: present, option: ceph }
- { state: present, option: rbd }
# Entries for sysctl.
ceph_sysctl:
- { state: present, name: fs.file-max, value: "26234859" }
- { state: present, name: kernel.pid_max, value: "4194303" }
- { state: present, name: vm.min_free_kbytes, value: "65536" }
- { state: present, name: vm.swappiness, value: "0" }
- { state: present, name: vm.zone_reclaim_mode, value: "0" }