. /etc/sysconfig/heat-params set -x ssh_cmd="ssh -F /srv/magnum/.ssh/config root@localhost" if [ ! -z "$HTTP_PROXY" ]; then export HTTP_PROXY fi if [ ! -z "$HTTPS_PROXY" ]; then export HTTPS_PROXY fi if [ ! -z "$NO_PROXY" ]; then export NO_PROXY fi if [ -n "$ETCD_VOLUME_SIZE" ] && [ "$ETCD_VOLUME_SIZE" -gt 0 ]; then attempts=60 while [ ${attempts} -gt 0 ]; do device_name=$($ssh_cmd ls /dev/disk/by-id | grep ${ETCD_VOLUME:0:20} | head -n1) if [ -n "${device_name}" ]; then break fi echo "waiting for disk device" sleep 0.5 $ssh_cmd udevadm trigger let attempts-- done if [ -z "${device_name}" ]; then echo "ERROR: disk device does not exist" >&2 exit 1 fi device_path=/dev/disk/by-id/${device_name} fstype=$($ssh_cmd blkid -s TYPE -o value ${device_path} || echo "") if [ "${fstype}" != "xfs" ]; then $ssh_cmd mkfs.xfs -f ${device_path} fi $ssh_cmd mkdir -p /var/lib/etcd echo "${device_path} /var/lib/etcd xfs defaults 0 0" >> /etc/fstab $ssh_cmd mount -a $ssh_cmd chown -R etcd.etcd /var/lib/etcd $ssh_cmd chmod 755 /var/lib/etcd fi if [ "$(echo $USE_PODMAN | tr '[:upper:]' '[:lower:]')" == "true" ]; then cat > /etc/systemd/system/etcd.service < /etc/etcd/etcd.conf.yaml <> /etc/etcd/etcd.conf.yaml <> /etc/etcd/etcd.conf.yaml < /etc/etcd/etcd.conf <> /etc/etcd/etcd.conf <> /etc/etcd/etcd.conf fi