export PATH=/root/bin:$PATH
mkdir /root/bin
-export CEPHADM_IMAGE='quay.ceph.io/ceph-ci/ceph:main'
+export CEPHADM_IMAGE="${CEPHADM_IMAGE:-quay.ceph.io/ceph-ci/ceph:main}"
CEPHADM="/root/bin/cephadm"
CEPHADM_SRC="/mnt/{{ ceph_dev_folder }}/src/cephadm/cephadm"
# {% if expanded_cluster is not defined %}
# bootstrap_extra_options+=" ${bootstrap_extra_options_not_expanded}"
# {% endif %}
+
+shell_image=''
+
quick_install_options=''
{% if quick_install is defined %}
- quick_install_options="--image localhost:5000/ceph"
+ export CEPHADM_IMAGE="${CEPHADM_IMAGE:-quay.ceph.io/ceph-ci/ceph:main}"
+ quick_install_options="--image localhost:5000/ceph"
+ shell_image="--image localhost:5000/ceph"
+
{% endif %}
if [[ ${NODES} -lt 2 ]]; then
$CEPHADM ${quick_install_options} bootstrap --mon-ip $mon_ip --initial-dashboard-password {{ admin_password }} ${bootstrap_extra_options}
-fsid=$(cat /etc/ceph/ceph.conf | grep fsid | awk '{ print $3}')
-cephadm_shell="$CEPHADM shell --fsid ${fsid} -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring"
+fsid=$(awk '/fsid/ {print $3}' /etc/ceph/ceph.conf)
+cephadm_shell="$CEPHADM ${shell_image} shell --fsid ${fsid} -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring"
+
+{% if quick_install is defined %}
+ ${cephadm_shell} ceph config set global container_image localhost:5000/ceph
+{% endif %}
+
for number in $(seq 1 $((NODES - 1))); do
LAST_OCTET=$((NODE_IP_OFFSET + $number))
{% if quick_install is defined %}
- /root/load-podman-image.sh
{% endif %}
+ {% if custom_image is defined %}
+ - export CEPHADM_IMAGE={{custom_image}}
+ {% endif %}
- sed -i "s/SELINUX=enforcing/SELINUX=permissive/" /etc/selinux/config
- setenforce 0
{% if number == 0 %}
;;
-i=*|--ceph-image=*)
CEPHADM_IMAGE="${arg#*=}"
+ echo "Using custom Ceph image: $CEPHADM_IMAGE"
+ extra_args+=" -P custom_image=${CEPHADM_IMAGE}"
;;
-h|--help)
show_help
esac
done
-image_name=$(echo "$CEPHADM_IMAGE")
-
+image_name="${CEPHADM_IMAGE:-quay.ceph.io/ceph-ci/ceph:main}"
extra_args+=" -P nodes=${NODES}"
if [[ ${use_cached_image} == false ]]; then
printf "Pulling the image: %s\n" "$image_name"
- podman pull "${image_name}"
+ podman pull "$image_name"
fi
rm -f ceph_image.tar
printf "Saving the image: %s\n" "$image_name"
-podman save -o ceph_image.tar "${image_name}"
+podman save -o ceph_image.tar "$image_name"
# build cephadm binary if it does not exist
printf "\nChecking for cephadm binary...\n"