Skip to content

Instantly share code, notes, and snippets.

@benagricola
Created May 1, 2013 12:04
Show Gist options
  • Save benagricola/5494926 to your computer and use it in GitHub Desktop.
Save benagricola/5494926 to your computer and use it in GitHub Desktop.
Profiles and Roles with Hiera / Puppet 3
---
:backends:
- yaml
- gpg
:gpg:
:datadir: '/etc/puppet/hiera'
:yaml:
:datadir: '/etc/puppet/hiera'
:logger: console
:hierarchy:
- nodes/%{::clientcert}-%{calling_module}
- role/%{calling_class}
- profile/%{calling_class}
- common/%{calling_module}
- common/common
class profile {
$roles = hiera_array('profile::roles',[])
include $roles
}
class profile::puppetmaster inherits profile {}
class profile::dedicated-db inherits profile {}
---
roles:
- puppetmaster
- puppetdb
- webserver
class role {
$classes = hiera_array('role::classes',[])
include $classes
}
class role::puppetmaster inherits role {}
class role::puppetdb inherits role {}
---
role::classes:
- puppet::db
- postgresql
- psql_tools
node default {
include $::profile
}
@linuxdan
Copy link

Did you try module_name ?
I had better luck with it than calling_class

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment