Last active
December 26, 2015 10:09
-
-
Save robertstarmer/7134603 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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