default the root password to admin password and don't fail if group already exists
This commit is contained in:
parent
c2b3cf7ff8
commit
7d45a0fa60
1 changed files with 5 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue