Skip to content

Instantly share code, notes, and snippets.

@robertstarmer
Last active December 26, 2015 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save robertstarmer/7134603 to your computer and use it in GitHub Desktop.
Save robertstarmer/7134603 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Set the ubuntu user password to something useable for VNC/KVM console access
passwd ubuntu <<EOF
ubuntu
ubuntu
EOF
# Since we have non-secure Dynamic DNS updates available in the ctocllab domain
# this will update a ctocllab.cisco.com entry
hostname=`hostname`
dns_server=`grep nameserver /etc/resolv.conf | head -1 | awk -F' ' '{print$2}'`
domain=`grep search /etc/resolv.conf | awk -F' ' '{print $2}'`
ip_addr=`ip addr show eth0 | grep 'inet ' | tr '/' ' ' | awk -F' ' '{print $2}'`
nsupdate <<EOF
server ${dns_server}
update delete ${hostname}.${domain}. A
update add ${hostname}.${domain}. 60 A ${ip_addr}
show
send
answer
EOF
echo "updated DNS with ${hostname}.${domain} at ${ip_address}"
sed -i 's/arch.*com/mirror.ctocllab.cisco.com/' /etc/apt/sources.list
apt-get update
apt-get install git -y
#cd /root
#git clone https://github.com/CiscoSystems/openstack-installer
#bash /root/openstack-installer/install-scripts/install.sh
cat > /tmp/done <<EOF
<H1> Your Build is Done! </H1>
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment