FYI, just wanted to share this as it allows you to create defined types via hiera.
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. On Thursday, 29 May 2014 12:27:51 UTC-4, Brian Wilkins wrote: > > I am trying to use hiera to populate a defined type to feed the > puppet-logstash module. So far, I have been unable to send the data from my > hiera file to my defined type. I have tested my defined type and it is > working, I just can't seem to populate the variables. It tells me that > $content and $order are not set. > > /etc/puppet/modules/profiles/manifests/logstash/shipper.pp: > > class profiles::logstash::shipper() { > > $shipper_config = hiera('profiles::logstash::config') > create_resources('config', $shipper_config) > > notice("${shipper_config[name]}") > class { 'logstash': > ensure => 'present', > version => '1.4.1-1_bd507eb', > status => 'enabled', > } > > profiles::logstash::config { $name: > content => $content, > order => $order, > } > > include logstash > } > > /etc/puppet/modules/profiles/manifests/logstash/config.pp: > > define profiles::logstash::config( > $content = undef, > $order = undef, > ) { > logstash::configfile { $name: > content => $content, > order => $order > } > } > > /etc/puppet/data/node/els4172.els.dev.yaml: > > classes: > - os::repo > - profiles::logstash::shipper > > profiles::logstash::config: > input_file: > content: 'this is a test' > order: '10' > > > My notice is not called, it does not display a thing. Did I use > create_resources correctly? > > > > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/3823a10e-a3e8-48c4-ab22-1b264b45d58f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.