]>
Commit | Line | Data |
---|---|---|
b3b6e05e TL |
1 | #!/usr/bin/env bash |
2 | ||
20effc67 TL |
3 | set -x |
4 | ||
b3b6e05e TL |
5 | export PATH=/root/bin:$PATH |
6 | mkdir /root/bin | |
522d829b TL |
7 | |
8 | cp /mnt/{{ ceph_dev_folder }}/src/cephadm/cephadm /root/bin/cephadm | |
b3b6e05e TL |
9 | chmod +x /root/bin/cephadm |
10 | mkdir -p /etc/ceph | |
11 | mon_ip=$(ifconfig eth0 | grep 'inet ' | awk '{ print $2}') | |
522d829b | 12 | |
20effc67 TL |
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} | |
522d829b | 20 | |
b3b6e05e | 21 | fsid=$(cat /etc/ceph/ceph.conf | grep fsid | awk '{ print $3}') |
a4b75251 | 22 | cephadm_shell="cephadm shell --fsid ${fsid} -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring" |
522d829b | 23 | |
b3b6e05e | 24 | {% for number in range(1, nodes) %} |
20effc67 | 25 | ssh-copy-id -f -i /etc/ceph/ceph.pub -o StrictHostKeyChecking=no root@{{ prefix }}-node-0{{ number }} |
522d829b | 26 | {% if expanded_cluster is defined %} |
20effc67 | 27 | ${cephadm_shell} ceph orch host add {{ prefix }}-node-0{{ number }} |
522d829b | 28 | {% endif %} |
b3b6e05e | 29 | {% endfor %} |
522d829b TL |
30 | |
31 | {% if expanded_cluster is defined %} | |
a4b75251 | 32 | ${cephadm_shell} ceph orch apply osd --all-available-devices |
522d829b | 33 | {% endif %} |