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
class debian::apt($apt_ver='latest', $dpkg_ver='latest', $aptitude_ver='latest') { | |
package{'apt': ensure => $apt_ver; | |
'dpkg': ensure => $dpkg_ver; | |
'aptitude': ensure => $aptitude_ver; | |
} | |
} |
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
case $cloud { | |
'rackspace': { | |
Host <<| tag == 'normal_server_private-rackspace' |>> | |
Host <<| tag == 'normal_server_public-us-east-1' |>> | |
Host <<| tag == 'normal_server_public-us-west-1' |>> | |
} | |
'ec2',default: { |
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
$apt_key = 'http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc' | |
file {'/etc/apt/sources.list.d/vargrant.conf': | |
ensure => file, | |
content => "deb http://download.virtualbox.org/virtualbox/debian ${lsbdistcodename} contrib", | |
notify => Exec['apt-get-update'], | |
before => Package['virtualbox-4.0'], | |
} | |
exec {'apt-key': |
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
#! /usr/bin/perl -w | |
use Carp; | |
my $username = getpwuid($<); | |
my $testuser = 'root'; | |
if ( $username eq $testuser ){ | |
print 'yep' | |
} else { |
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
import eventlet | |
cloudfiles = eventlet.import_patched('cloudfiles') | |
username = 'foo' | |
api_key = 'bar' | |
buckets = ['list', 'of', 'buckets', 'to', 'create'] | |
cf_pool = pools.Pool(create=lambda: cloudfiles.get_connection(username, api_key) |
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
#!/usr/bin/env python | |
import boto | |
import sys | |
ec2 = boto.connect_ec2() | |
# cat a file that contains ec2 instance ids into me and | |
# I will eat them up and turn them off | |
for instance in sys.stdin: |
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 | |
if [ -z "$1" ] | |
then | |
echo "must feed me a FQDN of a server you want to delete!!!!" | |
exit 1 | |
fi | |
/usr/bin/puppet node clean --unexport $1 | |
/etc/puppet/tools/kill_node_in_storedconfigs_db.rb $1 > /dev/null |
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
import boto | |
s3 = boto.connect_s3() | |
bucket = s3.get_bucket('robs-super-bucket') | |
d = bucket.new_key() | |
file1 = open('testfile.txt', 'r') | |
file2 = open('otherfile.txt', 'r') | |
# build the hash from file1 |
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
if File.exist?("/usr/bin/adinfo") | |
%x{/usr/bin/adinfo}.each do |line| | |
if line =~ /^(.+):(\s+)(.+)$/ | |
var = $1; val =$3 | |
# this will add centrify_ to each facter key, and | |
# replace spaces in the keys with _'s, and dropcase | |
Facter.add("centrify_" + var.gsub(/\s+/, "_").downcase()) do | |
setcode { val.chomp() } | |
end |
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
echo "Acquire::http::Pipeline-Depth "0";" | sudo tee -a /etc/apt/apt.conf.d/90localsettings |
OlderNewer