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
$foo = inline_template('<%= (1..100).to_a.join(" ")%>') | |
$foo2 = inline_template("<%= (1..100).to_a.each { | n | if n % 15 == 0 then 'fizzbuzz' elsif n % 5 == 0 then 'buzz' elsif n % 3 == 0 then 'fizz' else n end }%>") | |
notify { | |
"Fizzaaaa": | |
message => $foo, | |
} | |
$things = split($foo, ' ') |
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
Environments Instead of Stages | |
============================== | |
This WebZone post recommends (ab)using puppet environments to do bootstrap/staging. | |
----------------------------------------------------------------------------------- | |
Puppet stages is a pretty important idea. Its existence accepts the idea that configuration management is hard. Since configuration management is hard some advanced tools are needed. Advanced tools will likely not be installed by default so we need some concept of staging in order to get the system to a state where the advanced tool works properly. | |
The problem is Puppet stages come up short in a couple of places: |
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 | |
#Don't run random scripts from the internet | |
exit | |
#this is for when you've broken an ganeti node, its still onish, but drbd has stopped communicating | |
failed_node=$1 | |
affected_nodes=`gnt-instance list -o name,snodes | grep $failed_node | cut -d " " -f 1 ` | |
#drbdsetup /dev/drbd22 net 10.208.8.23:11176 10.208.8.21:11176 C -A discard-zero-changes -B consensus | |
port=13337 #be sure to make sure iptables isn't just blocking the drbd port range |
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
COLOR magenta | |
{ | |
# matches the date | |
^(... ..).*$ | |
^.*([0-9][0-9]\.[0-9]%).*$ | |
} | |
COLOR cyan | |
{ | |
^.*\[=*>(\.*)].*$ |
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 subprocess, commands | |
while True: | |
foo = commands.getoutput('ping -c 1 marine.cat.pdx.edu | grep "ms" | cut -d "=" -f 4') | |
# foo = sub.Popen("ping -c 1 marine.cat.pdx.edu") | |
# print foo | |
foo = foo.split(" ")[0] | |
#print "#"*int(float(foo)*100) |
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/zsh | |
link_base=http://support.ntp.org | |
relative_links=`curl http://support.ntp.org/bin/view/Servers/StratumOneTimeServers 2>/dev/null | grep Col1 | grep Servers | awk '{print $6}' | cut -d \" -f 2 | grep -v '<a' | grep -v nofollow` | |
for url_end in `echo "$relative_links" ` | |
do | |
#echo "$link_base$url_end" | |
curl $link_base$url_end 2>/dev/null | grep -A1 Address | grep -v Address | tr '\n' ' ' | read v4 v6; #echo 4: $v4; echo 6: $v6 | |
curl $link_base$url_end 2>/dev/null | grep -A1 CountryCode | grep -v CountryCode | tr '\n' ' ' | read countrycode ; #echo Country: $countrycode |
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
# the following is for enabling write access to the web gui | |
if $readonly_web == false { | |
file_line {. | |
'/etc/nagios3/nagios.cfg-external-commands-yes': | |
line => "check_external_commands=1", | |
path => '/etc/nagios3/nagios.cfg', | |
notify => Service['nagios3'], | |
require => Package['nagios3']; | |
'/etc/nagios3/cgi.cfg-all_service_commands': |
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
# handle null input (translate to <@> special case) | |
R$@ $@ <@> | |
# strip group: syntax (not inside angle brackets!) and trailing semicolon | |
R$* $: $1 <@> mark addresses | |
R$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr> | |
R@ $* <@> $: @ $1 unmark @host:... | |
R$* [ IPv6 : $+ ] <@> $: $1 [ IPv6 : $2 ] unmark IPv6 addr | |
R$* :: $* <@> $: $1 :: $2 unmark node::addr | |
R:include: $* <@> $: :include: $1 unmark :include:... |
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
[nibz@chandra ~]$ \curl -L https://get.rvm.io | bash -s stable | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 184 100 184 0 0 144 0 0:00:01 0:00:01 --:--:-- 1202 | |
100 13784 100 13784 0 0 5390 0 0:00:02 0:00:02 --:--:-- 55136 | |
Downloading RVM from wayneeseguin branch stable | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 124 100 124 0 0 317 0 --:--:-- --:--:-- --:--:-- 420 | |
100 1081k 100 1081k 0 0 512k 0 0:00:02 0:00:02 --:--:-- 1367k |
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/sh | |
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm | |
rpm -ivh http://yum.puppetlabs.com/el/5/products/i386/puppetlabs-release-5-7.noarch.rpm | |
yum update | |
yum install puppet |