Skip to content

Instantly share code, notes, and snippets.

View supercow's full-sized avatar

James Sweeny supercow

View GitHub Profile
class parent1 {
include child1
anchor { 'parent1::start': } ->
Class['child1'] ->
anchor { 'parent1'::end': }
}
class parent2 {
include child2
anchor { 'parent2::start': } ->
---
parent::params:
- example1
- example2
Notice: Scope(Class[main]): String
Notice: Compiled catalog for stout.4c in environment production in 0.03 seconds
Notice: Finished catalog run in 0.02 seconds
$hosts = ['hosta','hostb','hostc']
range(0,count($hosts)-1).each |$num| {
$port = 8080 + $num
somemodule::someservice { $hosts[$num]:
listening_port => $port,
}
}
@supercow
supercow / output
Last active December 26, 2015 06:09
supercow@stout:~$ puppet apply /tmp/test.pp
Notice: Compiled catalog for stout.4c in environment production in 0.05 seconds
Notice: /Stage[main]//Ssh_authorized_key[supercow@doppelbock]/ensure: current_value absent, should be present (noop)
Notice: /Stage[main]//Ssh_authorized_key[supercow@Kriek]/ensure: current_value absent, should be present (noop)
Notice: /Stage[main]//Ssh_authorized_key[supercow@stout]/ensure: current_value absent, should be present (noop)
Notice: Class[Main]: Would have triggered 'refresh' from 3 events
Notice: Stage[main]: Would have triggered 'refresh' from 1 events
Notice: Finished catalog run in 0.03 seconds
if File.exists?('/tmp/test')
Facter.add('test_content') do
setcode do
File.read('/tmp/test')
end
end
end
$req = [System.Net.WebRequest]::Create('https://master:8140/production/certificate_status/certname_to_rm')
$req.Method = "DELETE"
$req.Accept = "pson"
$req.ContentLength = 0
# ignore ssl checks
$ssl_check = [System.Net.ServicePointManager]::ServerCertificateValidationCallback
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$req.GetResponse()
#!/bin/bash
curl -k -X DELETE -H "Accept: pson" https://master:8140/production/certificate_status/certname_to_rm
if ! $::package_installed {
file { 'download_rpm':
ensure => file,
path => '/tmp/my_package.rpm',
source => 'puppet:///files/my_package.rpm',
}
exec { 'install_package':
command => '/bin/rpm -i /tmp/my_package.rpm',
require => File['download_rpm'],
}
__git_ps1_unfucker() {
unalias -a
__git_ps1 "$@"
}
# ... SNIP ...
PS1_git='\[\033[01;37m\]$(__git_ps1_unfucker " (%s)")'
PS1="${PS1_user}${PS1_at}${PS1_host}${PS1_colon}${PS1_pwd}${PS1_git}${PS1_shell}"