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
@rodjek
rodjek / fact_spec.rb
Created June 21, 2018 00:21
Facter stubbing examples
require 'rspec'
require 'facter'
describe 'facter_value' do
context 'when stubbing Facter::Util::Collection#fact' do
before(:each) do
stub_fact = instance_double(Facter::Util::Fact, :value => 'foo')
allow(Facter.collection).to receive(:fact).with(:test_fact).and_return(stub_fact)
end
@rodjek
rodjek / windows.ps1
Created August 10, 2017 04:01
windows.ps1
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')
choco -y install ruby vim
@rodjek
rodjek / keybase.md
Created May 13, 2017 02:50
keybase.md

Keybase proof

I hereby claim:

  • I am rodjek on github.
  • I am rodjek (https://keybase.io/rodjek) on keybase.
  • I have a public key ASC7CNRlpA-1t5WuR-nH2PJoyCoFb9Uhra3DJ0x-eJen4go

To claim this, I am signing this object:

@rodjek
rodjek / csvx.xml
Last active August 29, 2015 14:17
<csvx:document xmlns:csvx="http://lol">
<csvx:header>
<csvx:value>title 1</csvx:value>
<csvx:value>title 2</csvx:value>
<csvx:value>title 3</csvx:value>
</csvx:header>
<csvx:row>
<csvx:value>item1</csvx:value>
<csvx:value>item2</csvx:value>
<csvx:value>item3</csvx:value>
class foo(
$bar,
$baz = true,
$gronk = false,
) {
# ...
}
@rodjek
rodjek / servers.pp
Created October 14, 2013 20:02 — forked from supercow/servers.pp
$hosts = ['hosta','hostb','hostc']
range(0,count($hosts)-1).each |$num| {
$port = 8080 + $num
somemodule::someservice { $hosts[$num]:
listening_port => $port,
}
}
@rodjek
rodjek / 0_description.md
Last active December 19, 2015 03:18
check_puppet_run_health

check_puppet_run_health

A Nagios check that connects to PuppetDB and determines the Puppet agent run health on a host.

Requires

  • PuppetDB
  • A puppetmaster configured to send reports to PuppetDB

States

@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
class foo {
notify { 'test':
message => $name, # This is still in Class[foo] scope
}
}
class foo {
mynotify { 'test': }
}
@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':