Skip to content

Instantly share code, notes, and snippets.

View supercow's full-sized avatar

James Sweeny supercow

View GitHub Profile
notify {'Should see this.': }
exec { '/bin/false':
refreshonly => true, # Does not work
# refreshonly => false, # Does work
subscribe => Notify['Should see this.'],
}
notify { 'Should not see this.':
require => Exec['/bin/false'],
@supercow
supercow / hiera.yaml
Created July 24, 2012 22:21
Defining vhosts in Hiera, assigining them with an ENC
---
:hieradata:
- vhosts/%{hostname}/%{vhost_name}
- vhosts/%{vhost_name}
- vhosts/common.yaml
- common.yaml
:backends:
- yaml
file { 'long_ass_filename':
ensure => file,
path => '/var/www/some/really/freaking/long/path/name/do_you_want_to_repeat.html',
}
service { 'some_service':
ensure => running,
subscribe => File['long_ass_filename'],
}
package { 'blah'
ensure => '1.2.3.4',
provider => 'gem',
}
@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'
@supercow
supercow / output.sh
Created January 11, 2013 17:46
This is awful.
[root@james modules]# cat /tmp/one /tmp/two
three
three
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
$rules = ["RewriteRule ^(/sub2/.*) /www/${::domain}\$1"]
apache::vhost { 'blah':
rewrite_rules => $rules,
}
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