From 7d45a0fa601fab0e4e7237f8920e049744a94c4a Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Wed, 26 Oct 2011 08:51:15 -0700 Subject: [PATCH] default the root password to admin password and don't fail if group already exists --- tools/build_kvm.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/build_kvm.sh b/tools/build_kvm.sh index 32c7bf6..ea135f6 100755 --- a/tools/build_kvm.sh +++ b/tools/build_kvm.sh @@ -19,9 +19,6 @@ set -o xtrace TOOLS_DIR=$(cd $(dirname "$0") && pwd) TOP_DIR=$TOOLS_DIR/.. -# Configure the root password of the vm -ROOT_PASSWORD=${ROOT_PASSWORD:-password} - # Where to store files and instances KVMSTACK_DIR=${KVMSTACK_DIR:-/opt/kvmstack} @@ -44,6 +41,10 @@ fi # Source params 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) DIST_NAME=${DIST_NAME:-natty} IMAGE_FNAME=$DIST_NAME.raw @@ -260,7 +261,7 @@ iface eth0 inet static EOF # 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 cp -pr $TOOLS_DIR/.. $ROOTFS/$DEST/devstack echo "root:$ROOT_PASSWORD" | chroot $ROOTFS chpasswd