Skip to content

Instantly share code, notes, and snippets.

View rodjek's full-sized avatar
👓
Looking for work

Tim Sharpe rodjek

👓
Looking for work
View GitHub Profile
Facter.add("root") do
setcode do
case Facter.value('operatingsystem')
when /openbsd/i: 'wheel'
else 'root'
end
end
end
mon1.rs :0: ~ » gem install sensu
ERROR: While executing gem ... (NoMethodError)
undefined method `call' for nil:NilClass
mon1.rs :1: ~ » wget http://rubygems.org/gems/sensu-0.8.1.gem
--2011-11-09 19:04:09-- http://rubygems.org/gems/sensu-0.8.1.gem
Resolving rubygems.org... 72.4.120.124
Connecting to rubygems.org|72.4.120.124|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://production.cf.rubygems.org/gems/sensu-0.8.1.gem [following]
--2011-11-09 19:04:10-- http://production.cf.rubygems.org/gems/sensu-0.8.1.gem
@rodjek
rodjek / sync_puppet_plugins.rb
Created December 14, 2011 01:30
Manual puppet pluginsync
#!/usr/bin/env ruby
require 'puppet'
require 'puppet/configurer'
Puppet.settings.parse
c = Puppet::Configurer.new
c.download_plugins
c.download_fact_plugins
@rodjek
rodjek / node.pp
Created December 31, 2011 07:42
modules/bind/manifests/server.pp
node 'test.example.com' {
bind::server { $::fqdn:
config_file => 'puppet:///path/to/your/custom/config/file.conf',
}
}
@rodjek
rodjek / command.pp
Created January 16, 2012 06:29
augeas nrpe command editor
define nrpe::command($command, $ensure='present') {
Augeas {
context => '/files/etc/nrpe.cfg',
}
case $ensure {
absent,present: {}
default: {
fail("Invalid ensure value passed to Nrpe::Command[$name]")
}
@rodjek
rodjek / gist:1872728
Created February 21, 2012 01:12
Win?
debug: Automatically importing test from gems
debug: Importing /Users/tsharpe/rubygems/vendor/test-0.0.1/manifests/init.pp
debug: importing '/Users/tsharpe/rubygems/vendor/test-0.0.1/manifests/init.pp' in environment production
debug: Automatically imported test from test into production
...
debug: Finishing transaction 2207753260
debug: Loaded state in 0.00 seconds
debug: Loaded state in 0.00 seconds
info: Applying configuration version '1329786658'
notice: foo
@rodjek
rodjek / init.pp
Created June 22, 2012 05:20 — forked from sarguru/init.pp
the main class
class qmail {
$domain = hiera('domain')
$basedn = hiera('basedn')
$deepofix_password = hiera('deepofix_password')
$cluster = hiera('mail_cluster')
$concurrency = hiera('smtpd_concurrency')
$maxrcpt = hiera('maxrcpt')
$qmail_queue = hiera('qmail_queue')
$smtp_port = hiera('smtp_port')
@rodjek
rodjek / nodes.pp
Created July 5, 2012 05:28 — forked from cloudartisan/nodes.pp
Want to define a different security group for each server range
# First option, make elasticsearch a parameterised class
node /^tcsearch(0[1-9]|10)\.deskstaging\.com$/ inherits staging {
class { 'elasticsearch':
security_group => 'foo',
}
}
node /^tcsearch2[0-9]\.deskstaging\.com$/ inherits staging {
class { 'elasticsearch':
class foo {
notify { 'test':
message => $name, # This is still in Class[foo] scope
}
}
class foo {
mynotify { 'test': }
}
@rodjek
rodjek / test.pp
Created September 16, 2012 20:47
class foo($template = 'foo.erb') {
file { '/tmp/foo':
source => $template,
}
}
# Use generic template
class { 'foo': }
# Override the template