Created
December 9, 2012 18:59
-
-
Save supercow/4246490 to your computer and use it in GitHub Desktop.
Using Hiera for subnet based decisions in puppet 3.0.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in /etc/puppet/hieradata/ | |
--- | |
someclass::setting1: 'blah' | |
someclass::another_setting: 1234 | |
someclass::array_setting: | |
- 'oneval' | |
- 'twoval' | |
- 'redval' | |
- 'blueval' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
:hierarchy: | |
- %{network_eth0} | |
- common | |
:backends: | |
- yaml | |
:yaml: | |
:datadir: '/etc/puppet/hieradata' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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