--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c162ac6e-257c-4c42-a856-0b2f99dbd7f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/305d7707-68ca-4814-940e-ef984fcb2c04%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/09cd7ee2-7231-499f-a05e-e4430389956a%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b519938d-da64-4674-8e6e-b98db1dcb9d4%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f9ece3eb-03cd-4a21-8dd1-30170127c83e%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ddff314a-d5e5-4f81-8e26-6eb63b665521%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/03325a33-6c90-46d6-8fe1-928456930478%40googlegroups.com.
shipper.pp
class profiles::logstash::shipper() {
$shipper_array = hiera_array('profiles::logstash::config_array')
define hash_extract() {
$shipper_hash = hiera_hash('profiles::logstash::config_settings')
$shipper_config = $shipper_hash[$name]
profiles::logstash::config {'shipper':
content => $shipper_config['content'],
order => $shipper_config['order'],
}
notice($shipper_config['content'])
notice($shipper_config['order'])
}
hash_extract{$shipper_array:}
class { 'logstash':
ensure => 'present',
version => '1.4.1-1_bd507eb',
status => 'enabled',
}
include logstash
}
I built a hiera_manifest functionality at my job. Essentially it allows you to call modules, classes and parameters and defined types all via hiera yaml.
I just put it up on Github to share: https://github.com/mlbam/hiera_manifest
This has slight advantages in that parameters are also put in place at the time of invocation of the module, class or type.
One thing to note is the difference in some syntax for resource definitions when using metaparameters. Also, when troubleshooting, the errors stick to the manifest sometimes and you don't get a proper error message for the module that throws the error.