From b225682189b872f490fa285a67e5d0d1e5351ed0 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Thu, 10 Nov 2011 12:57:59 -0800 Subject: [PATCH] progress on getting a working test configuration --- tools/build_uec.sh | 23 +++++++++++++++++++++ tools/jenkins/adapters/euca.sh | 7 ++++++- tools/jenkins/configurations/kvm.sh | 3 +++ tools/jenkins/jenkins_home/build_jenkins.sh | 7 +++++++ tools/setup_stack_user.sh | 4 ---- 5 files changed, 39 insertions(+), 5 deletions(-) diff --git a/tools/build_uec.sh b/tools/build_uec.sh index bbb8b37c79..2fb8b500a8 100755 --- a/tools/build_uec.sh +++ b/tools/build_uec.sh @@ -187,6 +187,29 @@ cat > localrc < $vm_dir/uec/user-data< /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< $TOP_DIR/addresses diff --git a/tools/jenkins/jenkins_home/build_jenkins.sh b/tools/jenkins/jenkins_home/build_jenkins.sh index 567a05629c..1a3407f200 100755 --- a/tools/jenkins/jenkins_home/build_jenkins.sh +++ b/tools/jenkins/jenkins_home/build_jenkins.sh @@ -10,6 +10,13 @@ if [[ $EUID -ne 0 ]]; then exit 1 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 CUR_DIR=$(cd $(dirname "$0") && pwd) diff --git a/tools/setup_stack_user.sh b/tools/setup_stack_user.sh index 231a20f332..fcb97333c2 100755 --- a/tools/setup_stack_user.sh +++ b/tools/setup_stack_user.sh @@ -49,10 +49,6 @@ grep -q "^#includedir.*/etc/sudoers.d" $STAGING_DIR/etc/sudoers || cp $TOP_DIR/files/sudo/* $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 function cp_it { if [ -e $1 ] || [ -d $1 ]; then