Skip to content

Instantly share code, notes, and snippets.

View awaxa's full-sized avatar

Greg Kitson awaxa

View GitHub Profile
require 'puppetclassify'
module Puppet::Parser::Functions
newfunction(:generate_hiera_bindings, :type => :rvalue, :arity => 1, :doc => <<-EOS
it does stuff
EOS
) do |args|
classifier_url = args[0]
raise ArgumentError, "invalid classifier URI" unless classifier_url =~ URI.regexp('https')
Now drawing from 'Battery Power'
-InternalBattery-0 100%; discharging; 20:00 remaining
htop 0.8.2.2 aborted. Please report bug at http://htop.sf.net
0 htop 0x00000001087cb903 CRT_handleSIGSEGV + 30
1 libsystem_platform.dylib 0x00007fff8ebe4f1a _sigtramp + 26
2 ??? 0x000000000000002d 0x0 + 45
3 htop 0x00000001087cd6e8 Header_draw + 225
4 htop 0x00000001087cdf88 main + 1924
5 libdyld.dylib 0x00007fff8c7485c9 start + 1
6 ??? 0x0000000000000001 0x0 + 1
@awaxa
awaxa / noop.pp
Last active August 29, 2015 14:17
# set a global variable $::noop to true or false (without quotes) using an External Node Classifier
case "${::noop}" {
'true','false': {
ini_setting { "puppet.conf agent:noop=${::noop}":
ensure => present,
path => "${::settings::confdir}/puppet.conf",
section => 'agent',
setting => 'noop',
value => "${::noop}",
noop => false,
ini_setting { 'puppet agent splay':
ensure => present,
path => "${::settings::confdir}/puppet.conf",
section => 'agent',
setting => 'splay',
value => true,
}
ini_setting { 'puppet agent splaylimit':
ensure => present,
@awaxa
awaxa / -
Created March 13, 2015 18:36
modulepath = site:modules:$basemodulepath
config_version = /usr/bin/git --git-dir=$confdir/environments/$environment/.git rev-parse HEAD
mod 'stdlib',
:git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git',
:ref => '4.5.1'
mod 'ruby',
:git => 'https://github.com/puppetlabs/puppetlabs-ruby.git',
:ref => '0.4.0'
mod 'gcc',
:git => 'https://github.com/puppetlabs/puppetlabs-gcc.git',
@awaxa
awaxa / .gitignore
Last active August 29, 2015 14:16
shoehorn preseed into debian installer iso
/.vagrant
*.iso
file { '/opt/stuff.war':
ensure => file,
source => '/deploy/wars/stuff.war',
} ~>
exec { 'rm -rf /opt/deployed':
refreshonly => true,
} ~>
# exec { 'jar xf /opt/stuff.war':
# cwd => '/opt/deployed',
# } ~>
registry::value { 'Disable UAC':
key => 'HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System',
value => 'EnableLUA',
type => 'dword',
data => '0x00000000'
}