Skip to content

Instantly share code, notes, and snippets.

@supercow
Created December 9, 2012 18:59
Show Gist options
  • Save supercow/4246490 to your computer and use it in GitHub Desktop.
Save supercow/4246490 to your computer and use it in GitHub Desktop.
Using Hiera for subnet based decisions in puppet 3.0.x
# in /etc/puppet/hieradata/
---
someclass::setting1: 'blah'
someclass::another_setting: 1234
someclass::array_setting:
- 'oneval'
- 'twoval'
- 'redval'
- 'blueval'
---
:hierarchy:
- %{network_eth0}
- common
:backends:
- yaml
:yaml:
:datadir: '/etc/puppet/hieradata'
class someclass(
$setting1 = 'sane_default',
$another_setting = 'also sane default',
$array_setting = [],
) {
#puppet code using those variables...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment