]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/ci/cephadm/bootstrap-cluster.sh
import quincy beta 17.1.0
[ceph.git] / ceph / src / pybind / mgr / dashboard / ci / cephadm / bootstrap-cluster.sh
1 #!/usr/bin/env bash
2
3 set -x
4
5 export PATH=/root/bin:$PATH
6 mkdir /root/bin
7
8 cp /mnt/{{ ceph_dev_folder }}/src/cephadm/cephadm /root/bin/cephadm
9 chmod +x /root/bin/cephadm
10 mkdir -p /etc/ceph
11 mon_ip=$(ifconfig eth0 | grep 'inet ' | awk '{ print $2}')
12
13 bootstrap_extra_options='--allow-fqdn-hostname --dashboard-password-noupdate'
14 bootstrap_extra_options_not_expanded='--skip-monitoring-stack'
15 {% if expanded_cluster is not defined %}
16 bootstrap_extra_options+=" ${bootstrap_extra_options_not_expanded}"
17 {% endif %}
18
19 cephadm bootstrap --mon-ip $mon_ip --initial-dashboard-password {{ admin_password }} --shared_ceph_folder /mnt/{{ ceph_dev_folder }} ${bootstrap_extra_options}
20
21 fsid=$(cat /etc/ceph/ceph.conf | grep fsid | awk '{ print $3}')
22 cephadm_shell="cephadm shell --fsid ${fsid} -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring"
23
24 {% for number in range(1, nodes) %}
25 ssh-copy-id -f -i /etc/ceph/ceph.pub -o StrictHostKeyChecking=no root@{{ prefix }}-node-0{{ number }}
26 {% if expanded_cluster is defined %}
27 ${cephadm_shell} ceph orch host add {{ prefix }}-node-0{{ number }}
28 {% endif %}
29 {% endfor %}
30
31 {% if expanded_cluster is defined %}
32 ${cephadm_shell} ceph orch apply osd --all-available-devices
33 {% endif %}