+++ /dev/null
-#!/usr/bin/env bash
-
-set -e
-
-function run-sshd() {
- echo "Creating sshd server on $(hostname):$(hostname -i)"
- # SSH
- if [[ ! -f "/root/.ssh/id_rsa" ]]; then
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keygen -b 2048 -t rsa -f ~/.ssh/id_rsa -q -N ""
- fi
-
- cat ~/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
- if [[ ! -f "/root/.ssh/known_hosts" ]]; then
- ssh-keygen -A
- fi
-
- # change password
- echo "root:root" | chpasswd
- echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
- echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
-
- /usr/sbin/sshd
- echo "sshd finished"
-}
-
-function copy-cluster-ssh-key() {
- echo "Adding cluster ssh key to all hosts: ${HOST_IPS}"
- HOST_IPS=$(echo $HOST_IPS)
- for ip in $(echo $HOST_IPS)
- do
- if [[ ! $ip == $(hostname -i) ]]
- then
- echo $ip
- # copy cluster key
- sshpass -p "root" ssh-copy-id -f -o StrictHostKeyChecking=no -i /etc/ceph/ceph.pub "root@${ip}"
- fi
- done
- echo "Finished adding keys, you can now add existing hosts containers to the cluster!"
-}
-
-case $1 in
- run-sshd)
- run-sshd
- ;;
- copy-cluster-ssh-key)
- copy-cluster-ssh-key
- ;;
-esac
+++ /dev/null
-#!/usr/bin/env bash
-set -euxo pipefail
-
-# link so we can debug cephadm
-ln -s -f /cephadm/cephadm $CEPHADM_PATH
-chmod +x $CEPHADM_PATH
-
-
-EXTRA_ARGS=()
-if [[ -n "${SHARED_CEPH_FOLDER-}" ]]; then
- EXTRA_ARGS+=(--shared_ceph_folder "$SHARED_CEPH_FOLDER")
-fi
-
-docker load < /cephadm/box/docker/ceph/image/quay.ceph.image.tar
-
-# cephadm guid error because it sometimes tries to use quay.ceph.io/ceph-ci/ceph:<none>
-# instead of master's tag
-export CEPHADM_IMAGE=quay.ceph.io/ceph-ci/ceph:master
-echo "export CEPHADM_IMAGE=quay.ceph.io/ceph-ci/ceph:master" >> ~/.bashrc
-
-if [[ -n "$CEPHADM_IMAGE" ]]; then
- EXTRA_ARGS+=--skip-pull
-fi
-
-export CEPH_SOURCE_FOLDER=/ceph
-$CEPHADM_PATH --verbose bootstrap \
- --mon-ip "$(hostname -i)" \
- --allow-fqdn-hostname \
- --initial-dashboard-password admin \
- --dashboard-password-noupdate \
- --shared_ceph_folder /ceph \
- "${EXTRA_ARGS[@]}"
-
-# make sure vg and lvs are visible
-vgchange --refresh
-for((i=0;i<$NUM_OSDS;i++)); do
- echo "Creating osd.${i}"
- # create osd folder
- $CEPHADM_PATH ceph-volume --shared_ceph_folder /ceph lvm create --bluestore --no-tmpfs --data "/dev/vg1/lv${i}" --no-systemd
- echo "Deploying osd.${i}..."
- # deploy osd with osd data folder
- $CEPHADM_PATH deploy --name "osd.${i}"
- # FIX: this command should substitute lvm create + deploy but there is a 'type' file not found error in ceph-osd
- # $CEPHADM_PATH shell -- ceph orch daemon add osd "$(hostname):/dev/vg1/lv${i}"
- echo "osd.${i} deployed!"
-done;