Skip to content

Instantly share code, notes, and snippets.

@tdeckers-cisco
Created April 7, 2014 18:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdeckers-cisco/10026005 to your computer and use it in GitHub Desktop.
Save tdeckers-cisco/10026005 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Pass a raw link to this document into the post-create box:
# https://gist.githubusercontent.com/tdeckers-cisco/10026005/raw/cloudinit-admin.sh
#
#echo "root:ugh+hum" | chpasswd
# ENABLE SECOND NIC
cat > /etc/sysconfig/network-scripts/ifcfg-eth1 <<EOF
DEVICE=eth1
TYPE=Ethernet
BOOTPROTO=dhcp
ONBOOT=yes
EOF
ifup eth1
# INSTALLING EPEL
yum -y install wget
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
mv -n epel-release-6-8.noarch.rpm //usr/local/src
rpm -ivh /usr/local/src/epel-release-6-8.noarch.rpm
# INSTALL ANSIBLE (for managing rest of our hosts)
easy_install pip
yum -y install gcc python-devel
pip install ansible
mkdir /etc/ansible
# ADD ANSIBLE INVENTORY PLUGIN
pip install python-novaclient # requires novaclient
pip install python-heatclient
pip install python-neutronclient
mkdir -p /etc/ansible/lib/inventory
cd /etc/ansible/lib/inventory
wget https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/nova.py
# link /etc/ansible/hosts -> nova.py (ansible will fetch list of hosts from there)
# nova.py requires a nova.ini file to be present.
# INSTALL GIT
yum -y install git
# FINISH CONFIGURATION USING ANSIBLE PLAYBOOK
# this assumes forwarding of localhost:80 to gitlab.cisco.com:80
# ansible-pull -U http://localhost/tdeckers/ciscocloud-2tier.git -d /opt/config -i initial_hosts site.yml
# Download openstack credentials from Openstack dashboard and:
# nova keypair-add --pub-key ~/.ssh/id_rsa.pub admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment