Skip to content

Instantly share code, notes, and snippets.

View supercow's full-sized avatar

James Sweeny supercow

View GitHub Profile
package { 'A':
ensure => $version,
}
if $::package_a_version != $version {
exec { 'do something reasonable':
subscribe => Package['A'],
notify => Resource['the_next_thing'],
}
}
use console_inventory_service;
select r.restype 'Resource',r.title 'Title',h.name 'Exporting Host'
from resources as r
left join hosts as h on h.id = r.host_id
where r.exported=1
@supercow
supercow / init.pp
Last active December 15, 2015 21:09
# /etc/puppetlabs/puppet/users/init.pp
class users {
$users_list = hiera('users::users_list')
users::user { $users_list: }
}
notice "1 imported"
import "2.pp"
Debug: Received report to process from util.fusion.local
Debug: Processing report from util.fusion.local with processor Puppet::Reports::Fail
Error: Report processor failed: Oh crap.
Debug: Processing report from util.fusion.local with processor Puppet::Reports::Store
$rules = ["RewriteRule ^(/sub2/.*) /www/${::domain}\$1"]
apache::vhost { 'blah':
rewrite_rules => $rules,
}
notice: /Stage[main]/Copyfile/File[/etc/file.txt]/content: content changed '{md5}b35da899f493edca60224127f8cd5e9b' to '{md5}49e500f80eaf8cda0b48d1be009ad080'
notice: Finished catalog run in 0.45 seconds
All your catalog are belong to Craig
notice: /Stage[main]/Copyfile/File[/etc/file.txt]/content: content changed '{md5}47dbe29533f7223b9e66fb585ad494c8' to '{md5}49e500f80eaf8cda0b48d1be009ad080'
notice: Finished catalog run in 0.45 seconds
@supercow
supercow / output.sh
Created January 11, 2013 17:46
This is awful.
[root@james modules]# cat /tmp/one /tmp/two
three
three
@supercow
supercow / 192.168.1.0.yaml
Created December 9, 2012 18:59
Using Hiera for subnet based decisions in puppet 3.0.x
# in /etc/puppet/hieradata/
---
someclass::setting1: 'blah'
someclass::another_setting: 1234
someclass::array_setting:
- 'oneval'
- 'twoval'
- 'redval'
- 'blueval'