default the root password to admin password and don't fail if group already exists

This commit is contained in:
Jesse Andrews 2011-10-26 08:51:15 -07:00
parent c2b3cf7ff8
commit 7d45a0fa60

View file

@ -19,9 +19,6 @@ set -o xtrace
TOOLS_DIR=$(cd $(dirname "$0") && pwd) TOOLS_DIR=$(cd $(dirname "$0") && pwd)
TOP_DIR=$TOOLS_DIR/.. TOP_DIR=$TOOLS_DIR/..
# Configure the root password of the vm
ROOT_PASSWORD=${ROOT_PASSWORD:-password}
# Where to store files and instances # Where to store files and instances
KVMSTACK_DIR=${KVMSTACK_DIR:-/opt/kvmstack} KVMSTACK_DIR=${KVMSTACK_DIR:-/opt/kvmstack}
@ -44,6 +41,10 @@ fi
# Source params # Source params
source ./stackrc source ./stackrc
# Configure the root password of the vm to be the same as ``ADMIN_PASSWORD``
ROOT_PASSWORD=${ADMIN_PASSWORD:-password}
# Base image (natty by default) # Base image (natty by default)
DIST_NAME=${DIST_NAME:-natty} DIST_NAME=${DIST_NAME:-natty}
IMAGE_FNAME=$DIST_NAME.raw IMAGE_FNAME=$DIST_NAME.raw
@ -260,7 +261,7 @@ iface eth0 inet static
EOF EOF
# User configuration for the instance # User configuration for the instance
chroot $ROOTFS groupadd libvirtd chroot $ROOTFS groupadd libvirtd || true
chroot $ROOTFS useradd stack -s /bin/bash -d $DEST -G libvirtd chroot $ROOTFS useradd stack -s /bin/bash -d $DEST -G libvirtd
cp -pr $TOOLS_DIR/.. $ROOTFS/$DEST/devstack cp -pr $TOOLS_DIR/.. $ROOTFS/$DEST/devstack
echo "root:$ROOT_PASSWORD" | chroot $ROOTFS chpasswd echo "root:$ROOT_PASSWORD" | chroot $ROOTFS chpasswd