Skip to content

Instantly share code, notes, and snippets.

@zipkid
Created June 6, 2012 14:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zipkid/2882372 to your computer and use it in GitHub Desktop.
Save zipkid/2882372 to your computer and use it in GitHub Desktop.
Using hiera as node classifier.
:hierarchy:
- Nodes/%{fqdn}
- Domain/%{domain}
- %{environment}
- common
:backends:
- yaml
- puppet
:yaml:
:datadir: '/etc/puppet/hieradata'
:puppet:
:datasource: data
classes:
- puppet::agent
- ntp
- resolv
#- motd
# global defaults
# backup file changes to the puppet server
# Only for complete files managed by puppet!
filebucket { 'puppet':
server => puppet
}
File {
backup => 'puppet',
}
# PATH setting
Exec {
path => '/usr/bin:/usr/sbin/:/bin:/sbin'
}
# Stages
stage { 'pre': before => Stage[main] }
stage { 'post': require => Stage[main] }
#class {
# "installsource::repo": stage => pre
# "nagios::nrpe::checks": stage => post
#}
# Default stuff for ALL nodes
node default
{
include common
}
class common {
$classes = hiera( 'classes', [] )
class { $classes: }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment