Skip to content

Instantly share code, notes, and snippets.

@timcharper
Created December 30, 2008 07:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save timcharper/41551 to your computer and use it in GitHub Desktop.
Save timcharper/41551 to your computer and use it in GitHub Desktop.
# put on the server
# put in /etc/puppet/custom/plugins/facter/custom_facts.rb
require 'yaml'
if File.exist?("/etc/puppet/custom_facts.yml")
YAML.load_file("/etc/puppet/custom_facts.yml").each do |key, value|
Facter.add(key.to_sym) do
setcode { value }
end
end
end
# put on each client, /etc/puppet/customfacts.yml
serverrole: app_server
datacenter: rackspace
# put these settings in config for each client
[puppetd]
pluginsync = true
server = myserver.mydomain.com
certname = general
# these commands go on the puppetmaster server
# put in /etc/puppet/manifests/site.pp
# process server roles
node default {
case $serverrole {
app_server: {
include general
include apache
include rails
}
db_server: {
include general
include database
include replication
}
default: {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment