Skip to content

Commit 39f12f9

Browse files
authored
Add a way to specify mon/mgr count (#39)
1 parent 6621bb9 commit 39f12f9

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

roles/cephadm/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ All Ceph hosts must be in the `ceph` group.
4040
* `cephadm_ssh_public_key`: Location where ssh public key used by cephadm will be saved (default: /etc/ceph/cephadm.pub)
4141
* `cephadm_ssh_private_key`: Location where ssh private key used by cephadm will be saved (default: /etc/ceph/cephadm.id)
4242
* `cephadm_ssh_user`: Pre-existing user name that should be used for bootstrapping the cluster. User must have passwordless sudo enabled. Since 1.4.0 (default: `ansible_user`)
43+
* MONs and MGRs
44+
* `cephadm_mon_count`: Number of MONs to deploy (default: equals to number of hosts in `mons` Ansible group)
45+
* `cephadm_mgr_count`: Number of MGRs to deploy (default: equals to number of hosts in `mgrs` Ansible group)
4346
* OSDs
4447
* `cephadm_osd_devices`: List of /dev/device paths to use (e.g. for multipath devices that can't be used using an OSD spec)
4548
Example:

roles/cephadm/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ cephadm_install_ceph_cli: False
2020
cephadm_ssh_public_key: "/etc/ceph/cephadm.pub"
2121
cephadm_ssh_private_key: "/etc/ceph/cephadm.id"
2222
cephadm_ssh_user: "{{ ansible_user }}"
23+
# MONs and MGRs
24+
cephadm_mon_count: "{{ groups.get('mons', []) | length }}"
25+
cephadm_mgr_count: "{{ groups.get('mgrs', []) | length }}"
2326
# Networking
2427
cephadm_admin_interface: "{{ cephadm_public_interface }}"
2528
cephadm_public_interface: ""

roles/cephadm/templates/cluster.yml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ labels:
2121
---
2222
service_type: mon
2323
placement:
24+
count: {{ cephadm_mon_count }}
2425
label: "mon"
2526
---
2627
service_type: mgr
2728
placement:
29+
count: {{ cephadm_mgr_count }}
2830
label: "mgr"
2931
---
3032
service_type: crash

0 commit comments

Comments
 (0)