progress on getting a working test configuration
This commit is contained in:
parent
72c84f7999
commit
b225682189
5 changed files with 39 additions and 5 deletions
|
@ -187,6 +187,29 @@ cat > localrc <<LOCAL_EOF
|
||||||
ROOTSLEEP=0
|
ROOTSLEEP=0
|
||||||
`cat $TOP_DIR/localrc`
|
`cat $TOP_DIR/localrc`
|
||||||
LOCAL_EOF
|
LOCAL_EOF
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Setup stack user with our key
|
||||||
|
if [ -e ~/.ssh/id_rsa.pub ]; then
|
||||||
|
cat > $vm_dir/uec/user-data<<EOF
|
||||||
|
mkdir -p /opt/stack
|
||||||
|
useradd stack -s /bin/bash -d /opt/stack -G libvirtd || true
|
||||||
|
echo stack:pass | chpasswd
|
||||||
|
mkdir -p /opt/stack/.ssh
|
||||||
|
echo `cat ~/.ssh/id_rsa.pub` > /opt/stack/.ssh/authorized_keys
|
||||||
|
chown -R stack /opt/stack
|
||||||
|
chmod 700 /opt/stack/.ssh
|
||||||
|
chmod 600 /opt/stack/.ssh/authorized_keys
|
||||||
|
|
||||||
|
grep -q "^#includedir.*/etc/sudoers.d" /etc/sudoers ||
|
||||||
|
echo "#includedir /etc/sudoers.d" >> /etc/sudoers
|
||||||
|
( umask 226 && echo "stack ALL=(ALL) NOPASSWD:ALL" \
|
||||||
|
> /etc/sudoers.d/50_stack_sh )
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run stack.sh
|
||||||
|
cat > $vm_dir/uec/user-data<<EOF
|
||||||
./stack.sh
|
./stack.sh
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Echo commands, exit on error
|
||||||
|
set -o xtrace
|
||||||
|
set -o errexit
|
||||||
|
|
||||||
echo "$0 SUCCESS!"
|
TOP_DIR=$(cd ../../.. && pwd)
|
||||||
|
HEAD_IP=`cat $TOP_DIR/addresses | grep HEAD | cut -d "=" -f2`
|
||||||
|
ssh stack@$HEAD_IP 'cd devstack && source openrc && cd exercises && ./euca.sh'
|
||||||
|
|
|
@ -49,3 +49,6 @@ $RC
|
||||||
EOF
|
EOF
|
||||||
cd tools
|
cd tools
|
||||||
sudo ./build_uec.sh
|
sudo ./build_uec.sh
|
||||||
|
|
||||||
|
# Make the address of the instances available to test runners
|
||||||
|
echo HEAD=`cat /var/lib/libvirt/dnsmasq/$BASE_NAME.leases | cut -d " " -f3` > $TOP_DIR/addresses
|
||||||
|
|
|
@ -10,6 +10,13 @@ if [[ $EUID -ne 0 ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Make sure user has configured an ssh pubkey
|
||||||
|
if [ ! -e /root/.ssh/id_rsa.pub ]; then
|
||||||
|
echo "Public key is missing. This is used to ssh into your instances."
|
||||||
|
echo "Please run ssh-keygen before proceeding"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# This directory
|
# This directory
|
||||||
CUR_DIR=$(cd $(dirname "$0") && pwd)
|
CUR_DIR=$(cd $(dirname "$0") && pwd)
|
||||||
|
|
||||||
|
|
|
@ -49,10 +49,6 @@ grep -q "^#includedir.*/etc/sudoers.d" $STAGING_DIR/etc/sudoers ||
|
||||||
cp $TOP_DIR/files/sudo/* $STAGING_DIR/etc/sudoers.d/
|
cp $TOP_DIR/files/sudo/* $STAGING_DIR/etc/sudoers.d/
|
||||||
sed -e "s,%USER%,$USER,g" -i $STAGING_DIR/etc/sudoers.d/*
|
sed -e "s,%USER%,$USER,g" -i $STAGING_DIR/etc/sudoers.d/*
|
||||||
|
|
||||||
# and has sudo ability (in the future this should be limited to only what
|
|
||||||
# stack requires)
|
|
||||||
echo "stack ALL=(ALL) NOPASSWD: ALL" >> $STAGING_DIR/etc/sudoers
|
|
||||||
|
|
||||||
# Gracefully cp only if source file/dir exists
|
# Gracefully cp only if source file/dir exists
|
||||||
function cp_it {
|
function cp_it {
|
||||||
if [ -e $1 ] || [ -d $1 ]; then
|
if [ -e $1 ] || [ -d $1 ]; then
|
||||||
|
|
Loading…
Reference in a new issue