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
Facter.add("root") do | |
setcode do | |
case Facter.value('operatingsystem') | |
when /openbsd/i: 'wheel' | |
else 'root' | |
end | |
end | |
end |
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
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 |
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
#!/usr/bin/env ruby | |
require 'puppet' | |
require 'puppet/configurer' | |
Puppet.settings.parse | |
c = Puppet::Configurer.new | |
c.download_plugins | |
c.download_fact_plugins |
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
node 'test.example.com' { | |
bind::server { $::fqdn: | |
config_file => 'puppet:///path/to/your/custom/config/file.conf', | |
} | |
} |
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
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]") | |
} |
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
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 |
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
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') |
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
# 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': |
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
class foo { | |
notify { 'test': | |
message => $name, # This is still in Class[foo] scope | |
} | |
} | |
class foo { | |
mynotify { '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
class foo($template = 'foo.erb') { | |
file { '/tmp/foo': | |
source => $template, | |
} | |
} | |
# Use generic template | |
class { 'foo': } | |
# Override the template |