Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-06-02 Thread jcbollinger
On Thursday, May 29, 2014 2:39:15 PM UTC-5, Brian Wilkins wrote: Solved it using this tip.. it's odd but it works: http://serverfault.com/a/538877/26514 That's odd only inasmuch as the original problem in that serverfault question was different from yours. The OP was trying to achieve a

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-06-02 Thread Brian Wilkins
FWIW, this is my working solution and I think it is much better: /etc/puppet/modules/profiles/manifests/logstash/config.pp: class profiles::logstash::config { $brokers = $profiles::logstash::brokers $cluster = $profiles::logstash::cluster if (!empty($brokers)) and (empty($cluster)) {

[Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Brian Wilkins
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

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Doug Forster
profiles::logstash::config: input_file: content: 'this is a test' order: '10' Should probably be profiles::logstash::config: content: 'this is a test' order: '10' On Thu, May 29, 2014 at 10:27 AM, Brian Wilkins bwilk...@gmail.com wrote: I am trying to use hiera to populate

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Brian Wilkins
Oh ok, makes sense. I did that and now I get can't convert String into Hash at /etc/puppet/modules/profiles/manifests/logstash/shipper.pp:15 My shipper.pp class profiles::logstash::shipper() { $shipper_config = hiera('profiles::logstash::config', {})

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Doug Forster
Try setting your notice(${shipper_config}) before create resources and see what it prints out. On Thu, May 29, 2014 at 10:47 AM, Brian Wilkins bwilk...@gmail.com wrote: Oh ok, makes sense. I did that and now I get can't convert String into Hash at

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Brian Wilkins
It prints out: order10contentthis is a test It concatenated it all together. On Thursday, May 29, 2014 12:59:09 PM UTC-4, Doug_F wrote: Try setting your notice(${shipper_config}) before create resources and see what it prints out. On Thu, May 29, 2014 at 10:47 AM, Brian Wilkins

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Doug Forster
Just a thought try changing $shipper_config = hiera('profiles::logstash::config', {}) = $shipper_config = hiera_hash('profiles::logstash::config', {}) On Thu, May 29, 2014 at 11:01 AM, Brian Wilkins bwilk...@gmail.com wrote: It prints out: order10contentthis is a test It concatenated it

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Brian Wilkins
Same problem. I see it concatenated in the notice. On Thursday, May 29, 2014 1:05:39 PM UTC-4, Doug_F wrote: Just a thought try changing $shipper_config = hiera('profiles::logstash::config', {}) = $shipper_config = hiera_hash('profiles::logstash::config', {}) On Thu, May 29, 2014 at

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Doug Forster
FYI this is how I ended up doing my logstash config module. It works but the content is not in Hiera we have flat files we manage. $logstash_configs = [ 'app1', 'app2', 'app3', ] logstash::configfile { Banner: source =

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Doug Forster
If you use hiera on the server does it show up as a hash? On Thu, May 29, 2014 at 11:08 AM, Brian Wilkins bwilk...@gmail.com wrote: Same problem. I see it concatenated in the notice. On Thursday, May 29, 2014 1:05:39 PM UTC-4, Doug_F wrote: Just a thought try changing $shipper_config

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Brian Wilkins
On puppetmaster: $ sudo hiera --debug profiles::logstash::config ::fqdn=hostname DEBUG: Thu May 29 13:12:56 -0400 2014: Hiera YAML backend starting DEBUG: Thu May 29 13:12:56 -0400 2014: Looking up profiles::logstash::config in YAML backend DEBUG: Thu May 29 13:12:56 -0400 2014: Looking for

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Doug Forster
Maybe try your hiera command right inside your create_resources. On Thu, May 29, 2014 at 11:13 AM, Brian Wilkins bwilk...@gmail.com wrote: On puppetmaster: $ sudo hiera --debug profiles::logstash::config ::fqdn=hostname DEBUG: Thu May 29 13:12:56 -0400 2014: Hiera YAML backend starting

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Brian Wilkins
Same problem. It seems like I am close. If only it didn't put all the data together as one string. On Thursday, May 29, 2014 1:17:07 PM UTC-4, Doug_F wrote: Maybe try your hiera command right inside your create_resources. On Thu, May 29, 2014 at 11:13 AM, Brian Wilkins

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Doug Forster
I think I figured out what was wrong. Dynamic data bindings may be mapping the inputs to the profiles::logstash::config defined type. Also I was in error in modifying your hiera data. Try this: create_resources('profiles::logstash::config', hiera_hash('profiles::logstash::config_settings')) In

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Brian Wilkins
Hmm, that's not working either. Doesn't look like it is populating my define now. Hmm On Thursday, May 29, 2014 1:56:43 PM UTC-4, Doug_F wrote: I think I figured out what was wrong. Dynamic data bindings may be mapping the inputs to the profiles::logstash::config defined type. Also I was in

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Doug Forster
Does it show up properly if you lookup on the server? On Thu, May 29, 2014 at 12:09 PM, Brian Wilkins bwilk...@gmail.com wrote: Hmm, that's not working either. Doesn't look like it is populating my define now. Hmm On Thursday, May 29, 2014 1:56:43 PM UTC-4, Doug_F wrote: I think I

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Brian Wilkins
Yep! $ sudo hiera --debug profiles::logstash::config_settings ::fqdn=hostname DEBUG: Thu May 29 14:24:29 -0400 2014: Hiera YAML backend starting DEBUG: Thu May 29 14:24:29 -0400 2014: Looking up profiles::logstash::config_settings in YAML backend DEBUG: Thu May 29 14:24:29 -0400 2014: Looking

Re: [Puppet Users] Using Hiera to Populate Defined Type in Puppet 3.6

2014-05-29 Thread Brian Wilkins
Solved it using this tip.. it's odd but it works: http://serverfault.com/a/538877/26514 shipper.pp class profiles::logstash::shipper() { $shipper_array = hiera_array('profiles::logstash::config_array') define hash_extract() { $shipper_hash =