Skip to content

Instantly share code, notes, and snippets.

View robertstarmer's full-sized avatar

Robert Starmer robertstarmer

View GitHub Profile
#!/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
@robertstarmer
robertstarmer / cobbler-ucs-power.template
Created October 23, 2013 05:46
ucs power template - for cobbler
#if $power_address and $power_address.count(':') > 0
#set (power_address, org) = $power_address.split(':', 1)
#set $org_arg = "-s %s" % $org
#else
#set $org_arg = ""
#end if
#set $z_arg = "-z"
fence_cisco_ucs $org_arg $z_arg -a "$power_address" -l "$power_user" -p "$power_pass" -n "$power_id" -o "$power_mode"
@robertstarmer
robertstarmer / add_cobbler_nodes.py
Created October 22, 2013 06:59
a script for adding nodes to cobbler based on a yaml formatted file.
#!/usr/bin/python
""" A quick script to load up the test physical systems
into cobbler. This should allow for faster build times, even
with some manual intervention
"""
"""
sudo cobbler system add --name="cloud-os-09.cisco.com"
--mac-address="00:25:B5:00:00:03"
--ip-address="192.168.100.9"
@robertstarmer
robertstarmer / preseed-cobbler
Created October 22, 2013 06:29
preseed elements to enable puppet 'openstack-installer' cobbler
d-i pkgsel/include string openssh-server vim vlan lvm2 ntp puppet
d-i preseed/early_command string wget -O /dev/null http://$http_server:$http_port/cblr/svc/op/trig/mode/pre/system/$system_name
d-i preseed/late_command string in-target puppet agent --test --waitforcert 0 || true;\
wget -O /dev/null http://$http_server:$http_port/cblr/svc/op/nopxe/system/$system_name ; \
wget -O /dev/null http://$http_server:$http_port/cblr/svc/op/trig/mode/post/system/$system_name ; \
sed -e 's/START=no/START=yes/' -i /target/etc/default/puppet ;\
sed -e "/logdir/ a pluginsync=true" -i /target/etc/puppet/puppet.conf ; \
sed -e "/logdir/ a server=alpha-build.ctocllab.cisco.com" -i /target/etc/puppet/puppet.conf ; \
build_server_ip=$http_server bash <(curl -fsS https://raw.github.com/CiscoSystems/openstack-installer/master/install-scripts/setup.sh) ;\
true
#!/bin/bash
source ${openrc:-~/openrc}
ext_net=${ext_net:-external}
no_gw=${no_gw:-nogw}
hostname=${1:-test}
key_name=${key_name:-public}
flavor=${flavor:-2}
image=${image:-precise-x86_64}
user_data=${user_data:-~/user.data}
net_id=`neutron net-list | grep ${ext_net} | awk -F' ' '{print $2}'`
@robertstarmer
robertstarmer / user-data-ns.sh
Last active December 25, 2015 13:49
a user-data script that configures DNS via nsupdate
#!/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
@robertstarmer
robertstarmer / gist:6106854
Created July 29, 2013 19:07
Set up a single node.
#!/bin/bash
apt-get update && apt-get dist-upgrade -y && apt-get puppet git -y
sed -e "s/127.0.1.1.*/`facter ipaddress`\t`facter fqdn`\t`facter hostname`/" -i /etc/hosts
sed -e '/logdir/ a pluginsync=true' -i /etc/puppet/puppet.conf
sed -e "/logdir/ a server=<%= puppetmaster %>" -i /etc/puppet/puppet.conf
sed -e 's/START=no/START=yes/' -i /etc/default/puppet
echo -e "server <%= puppetmaster %> iburst" > /etc/ntp.conf
echo '8021q' >> /etc/modules
# This document serves as an example of how to deploy
# basic multi-node openstack environments.
# In this scenario Quantum is using OVS with GRE Tunnels
# Swift is not included.
$configure_network_interfaces = true
$vm_net_ip = $ipaddress
$libvirt_type = 'kvm'
########### Proxy Configuration ##########
# If you use an HTTP/HTTPS proxy, uncomment this setting and specify the correct proxy URL.
# If you do not use an HTTP/HTTPS proxy, leave this setting commented out.
@robertstarmer
robertstarmer / prod-site.pp
Last active December 15, 2015 13:39
site.pp for eng. prod cluster
# This document serves as an example of how to deploy
# basic multi-node openstack environments.
# In this scenario Quantum is using OVS with GRE Tunnels
# Swift is not included.
########### Proxy Configuration ##########
# If you use an HTTP/HTTPS proxy, uncomment this setting and specify the correct proxy URL.
# If you do not use an HTTP/HTTPS proxy, leave this setting commented out.
$proxy = "http://proxy.esl.cisco.com:80/"
@robertstarmer
robertstarmer / cd-iso-recreate.sh
Last active December 14, 2015 20:59
Script to repackage an ubuntu server install CD
# From: https://help.ubuntu.com/community/InstallCDCustomization/Scripts
# http://creativecommons.org/licenses/by-sa/3.0/
#
# Script by Leigh Purdie
#
# 1) Install a Ubuntu system, and remove packages according to your
# requirements using synaptic.
# Don't install any new packages that are NOT available from the CD,
# at this stage, unless you include the packages in an 'extras' directory.
#