Skip to content

Instantly share code, notes, and snippets.

View zipkid's full-sized avatar
💭
Eating 🍪

Stefan Goethals zipkid

💭
Eating 🍪
View GitHub Profile
# global defaults
# backup file changes to the puppet server
# Only for complete files managed by puppet!
filebucket { 'puppet':
server => puppet
}
File {
backup => 'puppet',
yumrepos:
epel6:
descr: Extra Packages for Enterprise Linux 6 - $basearch
mirrorlist: https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
enabled: 1
gpgcheck: 1
gpgkey: http://be.mirror.eurid.eu/epel/RPM-GPG-KEY-EPEL-6
failovermethod: priority
@zipkid
zipkid / gist:3496753
Created August 28, 2012 09:56
presign puppet cert
1. Generate a pre-signed certificate for client1.example.com with the following command:
puppet cert --generate client1.example.com
Puppet will now generate and sign a client certificate in the name of client1. example.com.
2. Transfer the three required files; the private key, the client certificate, and the CA certificate, to the new client. These are found in the following locations:
/etc/puppet/ssl/private_keys/client1.example.com.pem
/etc/puppet/ssl/certs/client1.example.com.pem
/etc/puppet/ssl/certs/ca.pem
Transfer these to the corresponding directories on the client, and it will then be authenticated without the certificate request step. Note that the location of Puppet's SSL certs varies according to the ssldir setting in puppet.conf.
Vagrant::Config.run do |config|
config.vm.box = "CentOS-6.0-x86_64-VB-4.1.8"
config.ssh.max_tries = 50
config.ssh.timeout = 300
config.vm.network :hostonly, "192.168.11.44"
config.vm.customize ["modifyvm", :id, "--memory", "380"]
# Stages
stage { 'repo': before => Stage[package] }
stage { 'package': before => Stage[main] }
stage { 'post': require => Stage[main] }
class{ 'hiera_package': stage => package }
@zipkid
zipkid / gist:3608113
Created September 3, 2012 09:31
default undefined for hiera?
$test_var = hiera('test_var',undef)
$cont = inline_template( "<% if @test_var %>test_var : <%= test_var %><% end %>" )
notify{ "This is test_var '$test_var' - template $cont": }
@zipkid
zipkid / hiera.yaml
Created September 6, 2012 12:19
Hiera puppet lookup Puppet 3
---
:hierarchy:
- common
:backends:
- puppet
:puppet:
datasource: data
@zipkid
zipkid / gist:3665338
Created September 7, 2012 11:25
IRC #vagrant on Freenode
12:52 < Freeaqingme> Does anybody know if there are ubuntu baseboxes available that run puppet v3 ?
12:55 < adaro> wasn't puppet 3 discontinued or something
12:56 < Freeaqingme> huh
12:56 < Freeaqingme> it's in RC stage
12:56 < Freeaqingme> so stable coming up soon.
12:56 < Freeaqingme> at least that's what I know
12:56 < zipkid> It is.
12:56 < zipkid> 2.7.19 is the current v.
12:57 < Freeaqingme> yeah, but we're setting up a new infrastructure from scratch. So figured we might as well go for 3
12:57 < zipkid> Freeaqingme: it's just a question of removing the current puppet and installing the new v from yum.puppetlabs.com no sweat.
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter
templatedir=$confdir/templates
prerun_command=/etc/puppet/etckeeper-commit-pre
postrun_command=/etc/puppet/etckeeper-commit-post
@zipkid
zipkid / gist:3706206
Created September 12, 2012 12:10
install multiple packages
class package::install( $packages = hiera_hash('packages', {} ) )
{
if( $packages )
{
create_resources( package, $packages )
}
}