This file contains hidden or 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
{ | |
"use1a-pri-puppet-01": "\u001b[0;32mInfo\u001b[0m: Retrieving plugin\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /etc/puppet/modules/varnish/lib/facter/varnish_version.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /var/lib/puppet/lib/facter/root_home.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /var/lib/puppet/lib/facter/varnish_version.rb\r\n\u001b[0;32mInfo\u001b[0m: Caching catalog for use1a-pri-puppet-01.social.local\r\n\u001b[0;32mInfo\u001b[0m: Applying configuration version '1352413667'\r\n/Stage[main]/Base/Ser |
This file contains hidden or 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 | |
DATE=`date +"%a"` | |
DVOLNAME=datalv | |
LVOLNAME=journallv | |
VOLGR=datavg | |
DVOLPATH=/dev/$VOLGR/$DVOLNAME | |
LVOLPATH=/dev/$VOLGR/$LVOLNAME | |
DSNAME=`echo ${DVOLNAME}_ss_${DATE} | tr '[A-Z]' '[a-z]'` | |
LSNAME=`echo ${LVOLNAME}_ss_${DATE} | tr '[A-Z]' '[a-z]'` |
This file contains hidden or 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
@task | |
def mongo_perf(): | |
sudo('apt-get install -y tcsh git-core scons g++ libpcre++-dev libboost-dev libreadline-dev libboost-program-options-dev libboost-thread-dev libboost-filesystem-dev libboost-date-time-dev python-pip build-essential python-dev') | |
with cd('/var/tmp'): | |
sudo('wget http://downloads.mongodb.org/cxx-driver/mongodb-linux-x86_64-v2.0-latest.tgz') | |
sudo('tar zxvf mongodb-linux-x86_64-v2.0-latest.tgz') | |
with cd('/var/tmp/mongo-cxx-driver-v2.0'): | |
sudo('scons') | |
sudo('scons install') | |
sudo('git clone https://github.com/mongodb/mongo-perf.git') |
This file contains hidden or 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
@task | |
def setup_fs_mongodb_aws(): | |
env.warn_only = True | |
sudo('puppetd --test') | |
env.warn_only = False | |
sudo("for i in `cat /proc/mdstat | grep md | awk '{print $1}'`; do mdadm --stop /dev/$i; done") | |
sudo('mdadm --create --force --assume-clean -R /dev/md0 -l10 --chunk=256 --raid-devices=4 /dev/xvdf /dev/xvdg /dev/xvdh /dev/xvdi') | |
sudo('echo "`mdadm --detail --scan`" | tee -a /etc/mdadm.conf') | |
sudo('blockdev --setra 128 /dev/md0') | |
sudo('blockdev --setra 128 /dev/xvdf') |
This file contains hidden or 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
from fabric.api import * | |
from fabric.operations import local,put | |
import subprocess | |
import os | |
@task | |
def deploy_small_ec2_instance(): | |
local('/usr/bin/ec2-run-instances ami-6dacf728 --instance-type m1.small --region us-west-1 --key ${EC2_KEYPAIR} --user-data-file user-data.sh --group ${SGROUP}') | |
@task |
This file contains hidden or 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
from fabric.api import * | |
from fabric.operations import local,put | |
import paramiko | |
import socket | |
import subprocess | |
import os | |
@task | |
# @parallel | |
def puppetd_test(): |
This file contains hidden or 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
from fabric.api import * | |
from fabric.operations import local,put | |
from fabric.colors import * | |
from pymongo import * | |
import sys | |
import difflib | |
import paramiko | |
import socket | |
import subprocess | |
import os |
This file contains hidden or 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
from fabric.api import * | |
from fabric.operations import local,put | |
import paramiko | |
import socket | |
import subprocess | |
import os | |
import mongod | |
import puppet | |
def _is_host_up(host, port): |
This file contains hidden or 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
@task | |
def rolling_upgrade(hostname): | |
""" Rolling upgrade of mongodb """ | |
users.root() | |
## Make initial connection to determine which member is the primary node | |
conn = Connection('%s'%(hostname)) | |
db = conn.local | |
isMaster = db.command("isMaster") | |
primary = (isMaster['primary']) | |
primary = primary.replace(":27017","") |
This file contains hidden or 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
@task | |
def test(stable_pkgs_url): | |
run('echo "export PACKAGESITE=\'%s\'" >> ~/.zshenv' %(stable_pkgs_url)) |