Skip to content

Instantly share code, notes, and snippets.

@beddari
Created April 11, 2012 10:34
Show Gist options
  • Save beddari/2358533 to your computer and use it in GitHub Desktop.
Save beddari/2358533 to your computer and use it in GitHub Desktop.
Mapping dev,test,qa,prod with hiera?
# Idea being that %{env} is set to one of {dev, qa, test} but not set in prod.
# Prod values will be used where no env-specific data is set.
# Any ideas of different or better ways to do this? Is this tree too deep?
---
:hierarchy:
- %{env}/%{variant}_%{role}_%{group}_%{location}
- %{variant}_%{role}_%{group}_%{location}
- %{env}/%{variant}_%{role}_%{group}
- %{variant}_%{role}_%{group}
- %{env}/%{variant}_%{role}
- %{variant}_%{role}
- %{env}/%{variant}
- %{variant}
- %{env}/common
- common
:backends:
- yaml
:yaml:
:datadir: '/etc/puppet/hieradata'
So a tree of files could look like ..
.
├── common.yaml
├── dev
│   ├── common.yaml
│   └── rhel6_pg_external_vagrant.yaml
├── rhel6_pg_external.yaml
├── rhel6_pg.yaml
└── rhel6.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment