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
% sudo ruby ruby-supervisorctl.rb | |
[ | |
[0] [ | |
[0] { | |
:state => 30, | |
:stdout_logfile => "/tmp/falsetest-stdout---supervisor-bqdUwO.log", | |
:now => 1286783537, | |
:start => 1286783530, | |
:group => "falsetest", |
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 first run fails because there is no 'importantserver' placeholder resource. | |
frontend1(~) % puppet apply --storeconfigs --config ./puppet.conf pull.pp | |
Could not find dependency Placeholder[importantserver] for File[/tmp/y] at /home/jordan/pull.pp:12 | |
# Have another server export this resource | |
ops(~/pp) % puppet apply --storeconfigs --config ./puppet.conf push.pp | |
# Try again, which works because the exported resource is found. | |
frontend1(~) !1! % puppet apply --storeconfigs --config ./puppet.conf pull.pp | |
notice: /Stage[main]/Bar/File[/tmp/y]/content: content changed '{md5}5a2f711ba4198f0db5e6b9e38a8f2d64' to '{md5}53cadf1c93f077aae3747e6507d7aa8e' |
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
define placeholder($ready) { | |
# Nothing to do, it's a placeholder! | |
} | |
class bar { | |
/* Should override the above */ | |
$placeholder = "superserver" | |
placeholder { | |
"$placeholder": | |
ready => false; |
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
include 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
up () { | |
if [ "$#" -eq 0 ] | |
then | |
echo "Up to where?" | |
return 1 | |
fi | |
times=$1 | |
target="$2" | |
while [ $times -gt 0 ] | |
do |
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
snack(~) % rm /tmp/flag | |
snack(~) % echo "Hello" > /tmp/original | |
snack(~) % sudo puppet apply unmanaged-notify.pp | |
notice: /Stage[main]//File[/tmp/flag]/ensure: defined content as '{md5}09f7e02f1290be211da707a266f153b3' | |
notice: /Stage[main]//Exec[hello world]: Triggered 'refresh' from 1 events | |
# Won't exec 'hello world' again because no change occured to /tmp/original: | |
snack(~) % sudo puppet apply unmanaged-notify.pp | |
# Now change /tmp/original: |
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
snack(~) % ruby puppet-package-over-ssh.rb snack apache2.2-common latest | |
Package[apache2.2-common] ensure => latest status: {:status=>"installed", :provider=>:apt, :error=>"ok", :desired=>"install", :name=>"apache2.2-common", :ensure=>"2.2.14-5ubuntu8.3"} | |
snack(~) % ruby puppet-package-over-ssh.rb snack sl latest | |
Package[sl] ensure => latest status: {:status=>"installed", :provider=>:apt, :error=>"ok", :desired=>"install", :name=>"sl", :ensure=>"3.03-16"} | |
# There's a bug where 'latest' seems to be ignored. If you try to use 'absent' it still installs anyway. I'm not familiar with puppet internals so this bug should be easy to fix. | |
snack(~) % ruby puppet-package-over-ssh.rb snack sl absent | |
Package[sl] ensure => absent status: {:status=>"installed", :provider=>:apt, :error=>"ok", :desired=>"install", :name=>"sl", :ensure=>"3.03-16"} |
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
Usage: puppet-package-over-ssh.rb HOST PACKAGE ACTION | |
% ruby puppet-package-over-ssh.rb snack sl uninstall | |
Package[sl] uninstall status: {:status=>"not-installed", :error=>"ok", :desired=>"unknown", :ensure=>:purged, :name=>"sl", :provider=>:apt} | |
% ruby puppet-package-over-ssh.rb snack sl install | |
Package[sl] install status: {:status=>"installed", :error=>"ok", :desired=>"install", :ensure=>"3.03-16", :name=>"sl", :provider=>:apt} | |
% ruby puppet-package-over-ssh.rb snack fancypants install | |
Could not install package Package[fancypants]: Execution of 'ssh snack sudo "/usr/bin/apt-get" "-q" "-y" "-o" "DPkg::Options::=--force-confold" "install" "fancypants"' returned 100: Reading package lists... | |
Building dependency tree... |
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 ruby | |
# | |
require "rubygems" | |
require "puppet" # gem puppet | |
require "ap" # gem awesome_print | |
# Need to define a type for each type we want to have. | |
# Otherwise, unknown types are errors in puppet. | |
Puppet::Type.newtype(:input) do |
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
require "rubygems" | |
require "ffi" | |
module Grok | |
extend FFI::Library | |
ffi_lib "grok.so" | |
# class for grok_t | |
# Attributes with '__' prefixes are not for your consumption; they | |
# are internal to libgrok. |
OlderNewer