Skip to content

Instantly share code, notes, and snippets.

View zipkid's full-sized avatar
💭
Eating 🍪

Stefan Goethals zipkid

💭
Eating 🍪
View GitHub Profile
@zipkid
zipkid / default.html.ep
Created May 31, 2012 19:43
content_for ...?
<!doctype html><html>
<head>
<title><%= title %></title>
<%= base_tag %>
%= content_for 'jsheader'
</head>
<body>
<ul>
<li><%= link_to index => begin %><%=l 'Index' %><% end %></li>
<li><%= link_to login => begin %><%=l 'Login' %><% end %></li>
@zipkid
zipkid / hieradata.yaml
Created June 6, 2012 14:55
Using hiera as node classifier.
:hierarchy:
- Nodes/%{fqdn}
- Domain/%{domain}
- %{environment}
- common
:backends:
- yaml
- puppet
environments:
- production:
environment: production
modulepath: /etc/puppet/modules:/etc/puppet-modules
manifest: $manifestdir/site.pp
- testing:
environment: testing
modulepath: /etc/puppet/modules:/etc/puppet-environment/testing
manifest: $manifestdir/site.pp
@zipkid
zipkid / Rakefile
Created June 8, 2012 08:03
Rakefile to perform puppet syntax and lint check
# Rakefile
require 'rubygems'
desc "Run puppet-lint."
task :lint do |t, args|
begin
require 'puppet-lint'
rescue LoadError
fail "Cannot load puppet-lint, please install gem : # gem install puppet-lint"
end
@zipkid
zipkid / Vagrantfile
Created June 9, 2012 20:03
Puppet testing Vagrantfile
Vagrant::Config.run do |config|
config.ssh.max_tries = 50
config.ssh.timeout = 300
# Master
config.vm.define :pm1 do |pm1_config|
pm1_config.vm.box = "CentOS-6.2-x86_64-minimal"
tomcat_instances:
- default:
server_port: 8005
http_connector_port: 8080
ajp_connector_port: 8009
@zipkid
zipkid / agent_debug_output
Created June 19, 2012 07:36
Hiera lookup issue...? Why does Hiera suddenly switch the lookup from the module name to the define name...?
hiera-1.0.0-0.1rc3.el6.noarch
hiera-puppet-1.0.0-0.1rc1.el6.noarch
puppet-server-3.0.0-0.1rc3.el6.noarch
puppet-3.0.0-0.1rc3.el6.noarch
[root@pm3 ~]# puppet agent -t --server pm3
Info: Retrieving plugin
Info: Loading facts in /etc/puppet-modules/puppet/lib/facter/facter_dot_d.rb
Info: Loading facts in /etc/puppet-modules/puppet/lib/facter/puppet_vardir.rb
@zipkid
zipkid / init.pp
Created June 19, 2012 11:29
Hiera class loader
class clsloader {
$klasses = hiera_array( 'classes', [] )
class { $klasses: }
}
/usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/create_resources.rb:1: warning: multiple values for a block parameter (2 for 1)
from /etc/puppet-modules/custom/lib/puppet/parser/functions/hiera_resources.rb:38
---
tomcat_instances:
rest_service_1:
server_port: 8005
http_connector_port: 8080
https_connector_port: 8443
ajp_connector_port: 8009
tomcat_user: root
tomcat_group: root
tomcat_maj_version: 7