Skip to content

Instantly share code, notes, and snippets.

@rockpapergoat
Last active December 12, 2015 09:09
Show Gist options
  • Save rockpapergoat/4749841 to your computer and use it in GitHub Desktop.
Save rockpapergoat/4749841 to your computer and use it in GitHub Desktop.
dynamic node definition with hiera. not sure if this will work as intended.
/etc/puppet/hiera.yaml:
---
:backends:
- yaml
:yaml:
:datadir: /etc/puppet/hieradata
:hierarchy:
- %{::clientcert}
- %{::role}
- common
/etc/puppet/manifests/site.pp:
node default {
$role = hiera("role")
include $role
}
/etc/puppet/hieradata/web1.example.com.yaml:
---
role: roles::www
/etc/puppet/hieradata/db3.example.com.yaml:
---
role: roles::postgresql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment