Florian Koch
2012-Mar-15 19:47 UTC
[Puppet Users] trouble with hiera %{calling_module} and puppet defines
Hi, i have some trouble with hiera and %{calling_module}. i have: class tomcat::instance{ $instances = hiera(''tomcat_instances'') tomcat::installer{$instances:} } define tomcat::installer { require ''tomcat'' $instance_opts = hiera($name) $tomcat_user = $instance_opts[user] $tomcat_group = $instance_opts[group] $basedir = $instance_opts[basedir] $logdir = $instance_opts[logdir] $tomcat_name = $instance_opts[name] $tomcat_version=''6'' ... } i specify the tomcat names in a hiera file and run the define wit the names as array (so they get executed for each name) ''/var/lib/environments/test/hieradata''/tomcat/crowd.yaml --- tomcat_instances: - crowd1 - crowd2 crowd1: name: ''crowd1'' basedir: ''/srv'' logdir: ''/var/log'' user: ''crowd'' group: ''crowd'' crowd2: name: ''crowd2'' basedir: ''/srv'' logdir: ''/var/log'' user: ''crowd'' group: ''crowd'' my hiera.yaml --- :hierarchy: - %{calling_module}/%{fqdn} - %{hostbasename} - %{domain} - common :backends: - yaml :yaml: :datadir: ''/var/lib/environments/%{environment}/hieradata'' if i wrote the crowd.yaml content in the common.yaml all works, if its in the module subdirectory, puppet can not find the data from the hiera lookup in the tomcat::installer, but the call from the tomcat::instance class works, i get the right tomcat names in the error. any idea? rgds Florian -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/ZjdL5rHQxBYJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Gary Larizza
2012-Mar-15 20:33 UTC
Re: [Puppet Users] trouble with hiera %{calling_module} and puppet defines
Hi Florian, I believe since $calling_module is a variable out of Puppet and not Facter, that you will need to ALSO setup the Puppet backend, in addition to the YAML backend, in the hiera.yaml file so Hiera can get its value. On Fri, Mar 16, 2012 at 6:47 AM, Florian Koch < florian.koch1981@googlemail.com> wrote:> Hi, > > i have some trouble with hiera and %{calling_module}. > > i have: > > class tomcat::instance{ > > $instances = hiera(''tomcat_instances'') > > tomcat::installer{$instances:} > > } > > define tomcat::installer { > > require ''tomcat'' > > $instance_opts = hiera($name) > > $tomcat_user = $instance_opts[user] > $tomcat_group = $instance_opts[group] > $basedir = $instance_opts[basedir] > $logdir = $instance_opts[logdir] > $tomcat_name = $instance_opts[name] > > > $tomcat_version=''6'' > ... > } > > i specify the tomcat names in a hiera file and run the define wit the > names as array (so they get executed for each name) > > ''/var/lib/environments/test/hieradata''/tomcat/crowd.yaml > > --- > tomcat_instances: > - crowd1 > - crowd2 > > > crowd1: > name: ''crowd1'' > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > crowd2: > name: ''crowd2'' > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > my hiera.yaml > --- > :hierarchy: > - %{calling_module}/%{fqdn} > - %{hostbasename} > - %{domain} > - common > :backends: > - yaml > :yaml: > :datadir: ''/var/lib/environments/%{environment}/hieradata'' > > > if i wrote the crowd.yaml content in the common.yaml all works, if its in > the module subdirectory, puppet can not find the data from the hiera lookup > in the tomcat::installer, but the call from the tomcat::instance class > works, i get the right tomcat names in the error. > > any idea? > > rgds Florian > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/ZjdL5rHQxBYJ. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- Gary Larizza Professional Services Engineer Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Dennis Hoppe
2012-Mar-15 20:56 UTC
Re: [Puppet Users] trouble with hiera %{calling_module} and puppet defines
Hello Florian, Am 15.03.2012 20:47, schrieb Florian Koch:> i have some trouble with hiera and %{calling_module}.i have had a similiar problem. You need to submit the values to the define.> i have: > > class tomcat::instance{ > $instances = hiera(''tomcat_instances'') > tomcat::installer{$instances:} > } > > define tomcat::installer { > require ''tomcat'' > > $instance_opts = hiera($name) > $tomcat_user = $instance_opts[user] > $tomcat_group = $instance_opts[group] > $basedir = $instance_opts[basedir] > $logdir = $instance_opts[logdir] > $tomcat_name = $instance_opts[name] > > $tomcat_version=''6'' > ... > }You should try something like this: class tomcat::instance { $instances = hiera(''tomcat_instances'') tomcat::installer { $instances[name]: basedir => $instances[basedir], logdir => $instances[logdir], user => $instances[user], group => $instances[group], } } define tomcat::installer ($basedir, $logdir, $user, $group) { ... } I am using this method for my Icinga module (http://github.com/dhoppe/puppet-icinga). You should take a look at the following files: - examples/icinga.yaml - manifests/contact.pp - manifests/contact/contacts.pp Regards, Dennis
Florian Koch
2012-Mar-15 20:58 UTC
Re: [Puppet Users] trouble with hiera %{calling_module} and puppet defines
Hi Gary, hm for other classes it works , so i think the puppet backend is not needed (https://github.com/ripienaar/hiera-puppet/commit/a7350529a99e5d1bad8b03749661f3f4c7f00216), the problem is the define, i guess that a define won''t set $module_path correct, the hiera cass from the class tocat::instance works perfect. But i have found better solution, i use create_resources to build the defines, works really smart class tomcat::instance{ $instances = hiera(''tomcat_instances'') create_resources(''tomcat::installer'',$instances) } define tomcat::installer ($user,$group,$basedir,$logdir,$name){ ....} --- tomcat_instances: crowd1: name: ''cr1'' basedir: ''/srv'' logdir: ''/var/log'' user: ''crowd'' group: ''crowd'' crowd2: name: ''cr2'' basedir: ''/srv'' logdir: ''/var/log'' user: ''crowd'' group: ''crowd'' rgds Florian Am Donnerstag, 15. März 2012 21:33:17 UTC+1 schrieb Gary Larizza:> > Hi Florian, > > I believe since $calling_module is a variable out of Puppet and not > Facter, that you will need to ALSO setup the Puppet backend, in addition to > the YAML backend, in the hiera.yaml file so Hiera can get its value. > > On Fri, Mar 16, 2012 at 6:47 AM, Florian Koch < > florian.koch1981@googlemail.com> wrote: > >> Hi, >> >> i have some trouble with hiera and %{calling_module}. >> >> i have: >> >> class tomcat::instance{ >> >> $instances = hiera(''tomcat_instances'') >> >> tomcat::installer{$instances:} >> >> } >> >> define tomcat::installer { >> >> require ''tomcat'' >> >> $instance_opts = hiera($name) >> >> $tomcat_user = $instance_opts[user] >> $tomcat_group = $instance_opts[group] >> $basedir = $instance_opts[basedir] >> $logdir = $instance_opts[logdir] >> $tomcat_name = $instance_opts[name] >> >> >> $tomcat_version=''6'' >> ... >> } >> >> i specify the tomcat names in a hiera file and run the define wit the >> names as array (so they get executed for each name) >> >> ''/var/lib/environments/test/hieradata''/tomcat/crowd.yaml >> >> --- >> tomcat_instances: >> - crowd1 >> - crowd2 >> >> >> crowd1: >> name: ''crowd1'' >> basedir: ''/srv'' >> logdir: ''/var/log'' >> user: ''crowd'' >> group: ''crowd'' >> >> crowd2: >> name: ''crowd2'' >> basedir: ''/srv'' >> logdir: ''/var/log'' >> user: ''crowd'' >> group: ''crowd'' >> >> my hiera.yaml >> --- >> :hierarchy: >> - %{calling_module}/%{fqdn} >> - %{hostbasename} >> - %{domain} >> - common >> :backends: >> - yaml >> :yaml: >> :datadir: ''/var/lib/environments/%{environment}/hieradata'' >> >> >> if i wrote the crowd.yaml content in the common.yaml all works, if its in >> the module subdirectory, puppet can not find the data from the hiera lookup >> in the tomcat::installer, but the call from the tomcat::instance class >> works, i get the right tomcat names in the error. >> >> any idea? >> >> rgds Florian >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/puppet-users/-/ZjdL5rHQxBYJ. >> To post to this group, send email to puppet-users@googlegroups.com. >> To unsubscribe from this group, send email to >> puppet-users+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. >> > > > > -- > > Gary Larizza > Professional Services Engineer > Puppet Labs > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/c8Qv0i9cwEUJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Florian Koch
2012-Mar-15 21:06 UTC
Re: [Puppet Users] trouble with hiera %{calling_module} and puppet defines
Hi Dennis, i have found a better solution via create_resources (look at my reply to Gery) thanks anyway. rgds Florian Am Donnerstag, 15. März 2012 21:56:34 UTC+1 schrieb Dennis Hoppe:> > Hello Florian, > > Am 15.03.2012 20:47, schrieb Florian Koch: > > i have some trouble with hiera and %{calling_module}. > > i have had a similiar problem. You need to submit the values to the define. > > > i have: > > > > class tomcat::instance{ > > $instances = hiera(''tomcat_instances'') > > tomcat::installer{$instances:} > > } > > > > define tomcat::installer { > > require ''tomcat'' > > > > $instance_opts = hiera($name) > > $tomcat_user = $instance_opts[user] > > $tomcat_group = $instance_opts[group] > > $basedir = $instance_opts[basedir] > > $logdir = $instance_opts[logdir] > > $tomcat_name = $instance_opts[name] > > > > $tomcat_version=''6'' > > ... > > } > > You should try something like this: > > class tomcat::instance { > $instances = hiera(''tomcat_instances'') > > tomcat::installer { $instances[name]: > basedir => $instances[basedir], > logdir => $instances[logdir], > user => $instances[user], > group => $instances[group], > } > } > > define tomcat::installer ($basedir, $logdir, $user, $group) { > ... > } > > I am using this method for my Icinga module > (http://github.com/dhoppe/puppet-icinga). You should take a look at the > following files: > > - examples/icinga.yaml > - manifests/contact.pp > - manifests/contact/contacts.pp > > Regards, Dennis > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/pZQzqjg2Dj4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Gary Larizza
2012-Mar-15 23:25 UTC
Re: [Puppet Users] trouble with hiera %{calling_module} and puppet defines
Ahh, Good catch - thanks for replying back with the fix -Gary On Fri, Mar 16, 2012 at 7:58 AM, Florian Koch < florian.koch1981@googlemail.com> wrote:> Hi Gary, > > hm for other classes it works , so i think the puppet backend is not > needed > ( > https://github.com/ripienaar/hiera-puppet/commit/a7350529a99e5d1bad8b03749661f3f4c7f00216 > ), > the problem is the define, i guess that a define won''t set $module_path > correct, the hiera cass from the class tocat::instance works perfect. > > But i have found better solution, i use create_resources to build the > defines, works really smart > > > class tomcat::instance{ > > $instances = hiera(''tomcat_instances'') > > create_resources(''tomcat::installer'',$instances) > } > define tomcat::installer ($user,$group,$basedir,$logdir,$name){ ....} > --- > tomcat_instances: > crowd1: > name: ''cr1'' > > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > crowd2: > name: ''cr2'' > > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > > rgds Florian > Am Donnerstag, 15. März 2012 21:33:17 UTC+1 schrieb Gary Larizza: > >> Hi Florian, >> >> I believe since $calling_module is a variable out of Puppet and not >> Facter, that you will need to ALSO setup the Puppet backend, in addition to >> the YAML backend, in the hiera.yaml file so Hiera can get its value. >> >> On Fri, Mar 16, 2012 at 6:47 AM, Florian Koch < >> florian.koch1981@googlemail.**com <florian.koch1981@googlemail.com>>wrote: >> >>> Hi, >>> >>> i have some trouble with hiera and %{calling_module}. >>> >>> i have: >>> >>> class tomcat::instance{ >>> >>> $instances = hiera(''tomcat_instances'') >>> >>> tomcat::installer{$instances:} >>> >>> } >>> >>> define tomcat::installer { >>> >>> require ''tomcat'' >>> >>> $instance_opts = hiera($name) >>> >>> $tomcat_user = $instance_opts[user] >>> $tomcat_group = $instance_opts[group] >>> $basedir = $instance_opts[basedir] >>> $logdir = $instance_opts[logdir] >>> $tomcat_name = $instance_opts[name] >>> >>> >>> $tomcat_version=''6'' >>> ... >>> } >>> >>> i specify the tomcat names in a hiera file and run the define wit the >>> names as array (so they get executed for each name) >>> >>> ''/var/lib/environments/test/**hieradata''/tomcat/crowd.yaml >>> >>> --- >>> tomcat_instances: >>> - crowd1 >>> - crowd2 >>> >>> >>> crowd1: >>> name: ''crowd1'' >>> basedir: ''/srv'' >>> logdir: ''/var/log'' >>> user: ''crowd'' >>> group: ''crowd'' >>> >>> crowd2: >>> name: ''crowd2'' >>> basedir: ''/srv'' >>> logdir: ''/var/log'' >>> user: ''crowd'' >>> group: ''crowd'' >>> >>> my hiera.yaml >>> --- >>> :hierarchy: >>> - %{calling_module}/%{fqdn} >>> - %{hostbasename} >>> - %{domain} >>> - common >>> :backends: >>> - yaml >>> :yaml: >>> :datadir: ''/var/lib/environments/%{**environment}/hieradata'' >>> >>> >>> if i wrote the crowd.yaml content in the common.yaml all works, if its >>> in the module subdirectory, puppet can not find the data from the hiera >>> lookup in the tomcat::installer, but the call from the tomcat::instance >>> class works, i get the right tomcat names in the error. >>> >>> any idea? >>> >>> rgds Florian >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Puppet Users" group. >>> To view this discussion on the web visit https://groups.google.com/d/** >>> msg/puppet-users/-/**ZjdL5rHQxBYJ<https://groups.google.com/d/msg/puppet-users/-/ZjdL5rHQxBYJ> >>> . >>> To post to this group, send email to puppet-users@googlegroups.com. >>> To unsubscribe from this group, send email to puppet-users+unsubscribe@* >>> *googlegroups.com <puppet-users%2Bunsubscribe@googlegroups.com>. >>> For more options, visit this group at http://groups.google.com/** >>> group/puppet-users?hl=en<http://groups.google.com/group/puppet-users?hl=en> >>> . >>> >> >> >> >> -- >> >> Gary Larizza >> Professional Services Engineer >> Puppet Labs >> >> -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/puppet-users/-/c8Qv0i9cwEUJ. > > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- Gary Larizza Professional Services Engineer Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Martin Willemsma
2012-Mar-16 08:03 UTC
Re: [Puppet Users] trouble with hiera %{calling_module} and puppet defines
Hi Florian, Interesting post. I was planning the same sort of approach for apache vhosts with hiera and create_resources. This is good proof that the idea works. Are you using this approach in other modules as well, if so which? Regards, Martin 2012/3/16 Gary Larizza <gary@puppetlabs.com>:> Ahh, > > Good catch - thanks for replying back with the fix > > -Gary > > > On Fri, Mar 16, 2012 at 7:58 AM, Florian Koch > <florian.koch1981@googlemail.com> wrote: >> >> Hi Gary, >> >> hm for other classes it works , so i think the puppet backend is not >> needed >> >> (https://github.com/ripienaar/hiera-puppet/commit/a7350529a99e5d1bad8b03749661f3f4c7f00216), >> the problem is the define, i guess that a define won''t set $module_path >> correct, the hiera cass from the class tocat::instance works perfect. >> >> But i have found better solution, i use create_resources to build the >> defines, works really smart >> >> >> class tomcat::instance{ >> >> $instances = hiera(''tomcat_instances'') >> >> create_resources(''tomcat::installer'',$instances) >> } >> define tomcat::installer ($user,$group,$basedir,$logdir,$name){ ....} >> --- >> tomcat_instances: >> crowd1: >> name: ''cr1'' >> >> basedir: ''/srv'' >> logdir: ''/var/log'' >> user: ''crowd'' >> group: ''crowd'' >> >> crowd2: >> name: ''cr2'' >> >> basedir: ''/srv'' >> logdir: ''/var/log'' >> user: ''crowd'' >> group: ''crowd'' >> >> >> rgds Florian >> Am Donnerstag, 15. März 2012 21:33:17 UTC+1 schrieb Gary Larizza: >>> >>> Hi Florian, >>> >>> I believe since $calling_module is a variable out of Puppet and not >>> Facter, that you will need to ALSO setup the Puppet backend, in addition to >>> the YAML backend, in the hiera.yaml file so Hiera can get its value. >>> >>> On Fri, Mar 16, 2012 at 6:47 AM, Florian Koch >>> <florian.koch1981@googlemail.com> wrote: >>>> >>>> Hi, >>>> >>>> i have some trouble with hiera and %{calling_module}. >>>> >>>> i have: >>>> >>>> class tomcat::instance{ >>>> >>>> $instances = hiera(''tomcat_instances'') >>>> >>>> tomcat::installer{$instances:} >>>> >>>> } >>>> >>>> define tomcat::installer { >>>> >>>> require ''tomcat'' >>>> >>>> $instance_opts = hiera($name) >>>> >>>> $tomcat_user = $instance_opts[user] >>>> $tomcat_group = $instance_opts[group] >>>> $basedir = $instance_opts[basedir] >>>> $logdir = $instance_opts[logdir] >>>> $tomcat_name = $instance_opts[name] >>>> >>>> >>>> $tomcat_version=''6'' >>>> ... >>>> } >>>> >>>> i specify the tomcat names in a hiera file and run the define wit the >>>> names as array (so they get executed for each name) >>>> >>>> ''/var/lib/environments/test/hieradata''/tomcat/crowd.yaml >>>> >>>> --- >>>> tomcat_instances: >>>> - crowd1 >>>> - crowd2 >>>> >>>> >>>> crowd1: >>>> name: ''crowd1'' >>>> basedir: ''/srv'' >>>> logdir: ''/var/log'' >>>> user: ''crowd'' >>>> group: ''crowd'' >>>> >>>> crowd2: >>>> name: ''crowd2'' >>>> basedir: ''/srv'' >>>> logdir: ''/var/log'' >>>> user: ''crowd'' >>>> group: ''crowd'' >>>> >>>> my hiera.yaml >>>> --- >>>> :hierarchy: >>>> - %{calling_module}/%{fqdn} >>>> - %{hostbasename} >>>> - %{domain} >>>> - common >>>> :backends: >>>> - yaml >>>> :yaml: >>>> :datadir: ''/var/lib/environments/%{environment}/hieradata'' >>>> >>>> >>>> if i wrote the crowd.yaml content in the common.yaml all works, if its >>>> in the module subdirectory, puppet can not find the data from the hiera >>>> lookup in the tomcat::installer, but the call from the tomcat::instance >>>> class works, i get the right tomcat names in the error. >>>> >>>> any idea? >>>> >>>> rgds Florian >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Puppet Users" group. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msg/puppet-users/-/ZjdL5rHQxBYJ. >>>> To post to this group, send email to puppet-users@googlegroups.com. >>>> To unsubscribe from this group, send email to >>>> puppet-users+unsubscribe@googlegroups.com. >>>> For more options, visit this group at >>>> http://groups.google.com/group/puppet-users?hl=en. >>> >>> >>> >>> >>> -- >>> >>> Gary Larizza >>> Professional Services Engineer >>> Puppet Labs >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Puppet Users" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/puppet-users/-/c8Qv0i9cwEUJ. >> >> To post to this group, send email to puppet-users@googlegroups.com. >> To unsubscribe from this group, send email to >> puppet-users+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. > > > > > -- > > Gary Larizza > Professional Services Engineer > Puppet Labs > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en.-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Florian Koch
2012-Mar-16 11:31 UTC
Re: [Puppet Users] trouble with hiera %{calling_module} and puppet defines
Hi Martin, no currently only for the tomcat::instances. we currently change our modules to hiera, so maybe i find other cases. rgds Florian Am Freitag, 16. März 2012 09:03:44 UTC+1 schrieb mawi:> > Hi Florian, > Interesting post. I was planning the same sort of approach for apache > vhosts with hiera and create_resources. This is good proof that the > idea works. > > Are you using this approach in other modules as well, if so which? > > Regards, > > Martin > > 2012/3/16 Gary Larizza <gary@puppetlabs.com>: > > Ahh, > > > > Good catch - thanks for replying back with the fix > > > > -Gary > > > > > > On Fri, Mar 16, 2012 at 7:58 AM, Florian Koch > > <florian.koch1981@googlemail.com> wrote: > >> > >> Hi Gary, > >> > >> hm for other classes it works , so i think the puppet backend is not > >> needed > >> > >> ( > https://github.com/ripienaar/hiera-puppet/commit/a7350529a99e5d1bad8b03749661f3f4c7f00216 > ), > >> the problem is the define, i guess that a define won''t set $module_path > >> correct, the hiera cass from the class tocat::instance works perfect. > >> > >> But i have found better solution, i use create_resources to build the > >> defines, works really smart > >> > >> > >> class tomcat::instance{ > >> > >> $instances = hiera(''tomcat_instances'') > >> > >> create_resources(''tomcat::installer'',$instances) > >> } > >> define tomcat::installer ($user,$group,$basedir,$logdir,$name){ ....} > >> --- > >> tomcat_instances: > >> crowd1: > >> name: ''cr1'' > >> > >> basedir: ''/srv'' > >> logdir: ''/var/log'' > >> user: ''crowd'' > >> group: ''crowd'' > >> > >> crowd2: > >> name: ''cr2'' > >> > >> basedir: ''/srv'' > >> logdir: ''/var/log'' > >> user: ''crowd'' > >> group: ''crowd'' > >> > >> > >> rgds Florian > >> Am Donnerstag, 15. März 2012 21:33:17 UTC+1 schrieb Gary Larizza: > >>> > >>> Hi Florian, > >>> > >>> I believe since $calling_module is a variable out of Puppet and not > >>> Facter, that you will need to ALSO setup the Puppet backend, in > addition to > >>> the YAML backend, in the hiera.yaml file so Hiera can get its value. > >>> > >>> On Fri, Mar 16, 2012 at 6:47 AM, Florian Koch > >>> <florian.koch1981@googlemail.com> wrote: > >>>> > >>>> Hi, > >>>> > >>>> i have some trouble with hiera and %{calling_module}. > >>>> > >>>> i have: > >>>> > >>>> class tomcat::instance{ > >>>> > >>>> $instances = hiera(''tomcat_instances'') > >>>> > >>>> tomcat::installer{$instances:} > >>>> > >>>> } > >>>> > >>>> define tomcat::installer { > >>>> > >>>> require ''tomcat'' > >>>> > >>>> $instance_opts = hiera($name) > >>>> > >>>> $tomcat_user = $instance_opts[user] > >>>> $tomcat_group = $instance_opts[group] > >>>> $basedir = $instance_opts[basedir] > >>>> $logdir = $instance_opts[logdir] > >>>> $tomcat_name = $instance_opts[name] > >>>> > >>>> > >>>> $tomcat_version=''6'' > >>>> ... > >>>> } > >>>> > >>>> i specify the tomcat names in a hiera file and run the define wit the > >>>> names as array (so they get executed for each name) > >>>> > >>>> ''/var/lib/environments/test/hieradata''/tomcat/crowd.yaml > >>>> > >>>> --- > >>>> tomcat_instances: > >>>> - crowd1 > >>>> - crowd2 > >>>> > >>>> > >>>> crowd1: > >>>> name: ''crowd1'' > >>>> basedir: ''/srv'' > >>>> logdir: ''/var/log'' > >>>> user: ''crowd'' > >>>> group: ''crowd'' > >>>> > >>>> crowd2: > >>>> name: ''crowd2'' > >>>> basedir: ''/srv'' > >>>> logdir: ''/var/log'' > >>>> user: ''crowd'' > >>>> group: ''crowd'' > >>>> > >>>> my hiera.yaml > >>>> --- > >>>> :hierarchy: > >>>> - %{calling_module}/%{fqdn} > >>>> - %{hostbasename} > >>>> - %{domain} > >>>> - common > >>>> :backends: > >>>> - yaml > >>>> :yaml: > >>>> :datadir: ''/var/lib/environments/%{environment}/hieradata'' > >>>> > >>>> > >>>> if i wrote the crowd.yaml content in the common.yaml all works, if its > >>>> in the module subdirectory, puppet can not find the data from the > hiera > >>>> lookup in the tomcat::installer, but the call from the > tomcat::instance > >>>> class works, i get the right tomcat names in the error. > >>>> > >>>> any idea? > >>>> > >>>> rgds Florian > >>>> > >>>> -- > >>>> You received this message because you are subscribed to the Google > >>>> Groups "Puppet Users" group. > >>>> To view this discussion on the web visit > >>>> https://groups.google.com/d/msg/puppet-users/-/ZjdL5rHQxBYJ. > >>>> To post to this group, send email to puppet-users@googlegroups.com. > >>>> To unsubscribe from this group, send email to > >>>> puppet-users+unsubscribe@googlegroups.com. > >>>> For more options, visit this group at > >>>> http://groups.google.com/group/puppet-users?hl=en. > >>> > >>> > >>> > >>> > >>> -- > >>> > >>> Gary Larizza > >>> Professional Services Engineer > >>> Puppet Labs > >>> > >> -- > >> You received this message because you are subscribed to the Google > Groups > >> "Puppet Users" group. > >> To view this discussion on the web visit > >> https://groups.google.com/d/msg/puppet-users/-/c8Qv0i9cwEUJ. > >> > >> To post to this group, send email to puppet-users@googlegroups.com. > >> To unsubscribe from this group, send email to > >> puppet-users+unsubscribe@googlegroups.com. > >> For more options, visit this group at > >> http://groups.google.com/group/puppet-users?hl=en. > > > > > > > > > > -- > > > > Gary Larizza > > Professional Services Engineer > > Puppet Labs > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Puppet Users" group. > > To post to this group, send email to puppet-users@googlegroups.com. > > To unsubscribe from this group, send email to > > puppet-users+unsubscribe@googlegroups.com. > > For more options, visit this group at > > http://groups.google.com/group/puppet-users?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/tkX6nPJ1AvkJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Juan José Presa Rodal
2012-Mar-16 14:24 UTC
Re: [Puppet Users] trouble with hiera %{calling_module} and puppet defines
Hi Florian. great and smart method. But I''ve found a problem. If i have a hash with two dimensions I''m losing the information of the first dimension. Explained: yaml: --- routers: router1: ip: 1.2.3.4 ports: 1: foo: true bar: false 2: foo: false bar: false router2: ip: 5.6.7.8 ports: 1: foo: true bar: true 2: foo: false bar: true manifest: create_resources(''foo::map'',$routers) } define foo::map ($ip,$ports) { create_resources(''ports::map'',$ports) } define ports::map ($foo,$bar) { } When catalog reaches ports::map, catalog have lost information about original router name. Is it correct? Or am I missing something? Thanks in advance. El jueves 15 de marzo de 2012 21:58:01 UTC+1, Florian Koch escribió:> > Hi Gary, > > hm for other classes it works , so i think the puppet backend is not > needed > ( > https://github.com/ripienaar/hiera-puppet/commit/a7350529a99e5d1bad8b03749661f3f4c7f00216 > ), > the problem is the define, i guess that a define won''t set $module_path > correct, the hiera cass from the class tocat::instance works perfect. > > But i have found better solution, i use create_resources to build the > defines, works really smart > > class tomcat::instance{ > > $instances = hiera(''tomcat_instances'') > > create_resources(''tomcat::installer'',$instances) > } > define tomcat::installer ($user,$group,$basedir,$logdir,$name){ ....} > --- > tomcat_instances: > crowd1: > name: ''cr1'' > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > crowd2: > name: ''cr2'' > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > > rgds Florian > Am Donnerstag, 15. März 2012 21:33:17 UTC+1 schrieb Gary Larizza: >> >> Hi Florian, >> >> I believe since $calling_module is a variable out of Puppet and not >> Facter, that you will need to ALSO setup the Puppet backend, in addition to >> the YAML backend, in the hiera.yaml file so Hiera can get its value. >> >> On Fri, Mar 16, 2012 at 6:47 AM, Florian Koch < >> florian.koch1981@googlemail.com> wrote: >> >>> Hi, >>> >>> i have some trouble with hiera and %{calling_module}. >>> >>> i have: >>> >>> class tomcat::instance{ >>> >>> $instances = hiera(''tomcat_instances'') >>> >>> tomcat::installer{$instances:} >>> >>> } >>> >>> define tomcat::installer { >>> >>> require ''tomcat'' >>> >>> $instance_opts = hiera($name) >>> >>> $tomcat_user = $instance_opts[user] >>> $tomcat_group = $instance_opts[group] >>> $basedir = $instance_opts[basedir] >>> $logdir = $instance_opts[logdir] >>> $tomcat_name = $instance_opts[name] >>> >>> >>> $tomcat_version=''6'' >>> ... >>> } >>> >>> i specify the tomcat names in a hiera file and run the define wit the >>> names as array (so they get executed for each name) >>> >>> ''/var/lib/environments/test/hieradata''/tomcat/crowd.yaml >>> >>> --- >>> tomcat_instances: >>> - crowd1 >>> - crowd2 >>> >>> >>> crowd1: >>> name: ''crowd1'' >>> basedir: ''/srv'' >>> logdir: ''/var/log'' >>> user: ''crowd'' >>> group: ''crowd'' >>> >>> crowd2: >>> name: ''crowd2'' >>> basedir: ''/srv'' >>> logdir: ''/var/log'' >>> user: ''crowd'' >>> group: ''crowd'' >>> >>> my hiera.yaml >>> --- >>> :hierarchy: >>> - %{calling_module}/%{fqdn} >>> - %{hostbasename} >>> - %{domain} >>> - common >>> :backends: >>> - yaml >>> :yaml: >>> :datadir: ''/var/lib/environments/%{environment}/hieradata'' >>> >>> >>> if i wrote the crowd.yaml content in the common.yaml all works, if its >>> in the module subdirectory, puppet can not find the data from the hiera >>> lookup in the tomcat::installer, but the call from the tomcat::instance >>> class works, i get the right tomcat names in the error. >>> >>> any idea? >>> >>> rgds Florian >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Puppet Users" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/puppet-users/-/ZjdL5rHQxBYJ. >>> To post to this group, send email to puppet-users@googlegroups.com. >>> To unsubscribe from this group, send email to >>> puppet-users+unsubscribe@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/puppet-users?hl=en. >>> >> >> >> >> -- >> >> Gary Larizza >> Professional Services Engineer >> Puppet Labs >> >>-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/6G9ZMTBEku4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jan Ivar Beddari
2012-Mar-16 16:27 UTC
Re: [Puppet Users] trouble with hiera %{calling_module} and puppet defines
On 15. mars 2012 22:06, Florian Koch wrote:> Hi Dennis, > > i have found a better solution via create_resources (look at my reply to > Gery)Not neccessarily better in my mind because ..> You should try something like this: > > class tomcat::instance { > $instances = hiera(''tomcat_instances'') > > tomcat::installer { $instances[name]: > basedir => $instances[basedir], > logdir => $instances[logdir], > user => $instances[user], > group => $instances[group], > } > } > > define tomcat::installer ($basedir, $logdir, $user, $group) { > ... > }.. this code is easier to explain and follow. Not to be underestimated! :-) -- http://www.uib.no/personer/Jan.Ivar.Beddari -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Florian Koch
2012-Mar-16 17:48 UTC
Re: [Puppet Users] trouble with hiera %{calling_module} and puppet defines
hi, yes better depends on personal preferences Am Freitag, 16. März 2012 17:27:41 UTC+1 schrieb Jan Ivar Beddari:> > On 15. mars 2012 22:06, Florian Koch wrote: > > Hi Dennis, > > > > i have found a better solution via create_resources (look at my reply to > > Gery) > > Not neccessarily better in my mind because .. > > > You should try something like this: > > > > class tomcat::instance { > > $instances = hiera(''tomcat_instances'') > > > > tomcat::installer { $instances[name]: > > basedir => $instances[basedir], > > logdir => $instances[logdir], > > user => $instances[user], > > group => $instances[group], > > } > > } > > > > define tomcat::installer ($basedir, $logdir, $user, $group) { > > ... > > } > > .. this code is easier to explain and follow. > > Not to be underestimated! :-) > > > -- > http://www.uib.no/personer/Jan.Ivar.Beddari > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/hSxs_BzeLJEJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
SteveTraylen
2012-May-14 14:46 UTC
Re: [Puppet Users] trouble with hiera %{calling_module} and puppet defines
On Thursday, 15 March 2012 21:58:01 UTC+1, Florian Koch wrote:> > Hi Gary, > > hm for other classes it works , so i think the puppet backend is not > needed > ( > https://github.com/ripienaar/hiera-puppet/commit/a7350529a99e5d1bad8b03749661f3f4c7f00216 > ), > the problem is the define, i guess that a define won''t set $module_path > correct, the hiera cass from the class tocat::instance works perfect. > > Just on that last point is it a bug that $calling_module is not set withina define and so can''t be used in the hiera search path when defines are being used? I think so I''ll submit it shortly unless there is comment. It seems you can however use $modue_name in a hiera search path and this is passed to hiera from puppet okay. Not sure of the difference between $module_name and $calling_module but former goes against the hiera examples of course. Steve.> But i have found better solution, i use create_resources to build the > defines, works really smart > > class tomcat::instance{ > > $instances = hiera(''tomcat_instances'') > > create_resources(''tomcat::installer'',$instances) > } > define tomcat::installer ($user,$group,$basedir,$logdir,$name){ ....} > --- > tomcat_instances: > crowd1: > name: ''cr1'' > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > crowd2: > name: ''cr2'' > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > > rgds Florian > Am Donnerstag, 15. März 2012 21:33:17 UTC+1 schrieb Gary Larizza: >> >> Hi Florian, >> >> I believe since $calling_module is a variable out of Puppet and not >> Facter, that you will need to ALSO setup the Puppet backend, in addition to >> the YAML backend, in the hiera.yaml file so Hiera can get its value. >> >> On Fri, Mar 16, 2012 at 6:47 AM, Florian Koch < >> florian.koch1981@googlemail.com> wrote: >> >>> Hi, >>> >>> i have some trouble with hiera and %{calling_module}. >>> >>> i have: >>> >>> class tomcat::instance{ >>> >>> $instances = hiera(''tomcat_instances'') >>> >>> tomcat::installer{$instances:} >>> >>> } >>> >>> define tomcat::installer { >>> >>> require ''tomcat'' >>> >>> $instance_opts = hiera($name) >>> >>> $tomcat_user = $instance_opts[user] >>> $tomcat_group = $instance_opts[group] >>> $basedir = $instance_opts[basedir] >>> $logdir = $instance_opts[logdir] >>> $tomcat_name = $instance_opts[name] >>> >>> >>> $tomcat_version=''6'' >>> ... >>> } >>> >>> i specify the tomcat names in a hiera file and run the define wit the >>> names as array (so they get executed for each name) >>> >>> ''/var/lib/environments/test/hieradata''/tomcat/crowd.yaml >>> >>> --- >>> tomcat_instances: >>> - crowd1 >>> - crowd2 >>> >>> >>> crowd1: >>> name: ''crowd1'' >>> basedir: ''/srv'' >>> logdir: ''/var/log'' >>> user: ''crowd'' >>> group: ''crowd'' >>> >>> crowd2: >>> name: ''crowd2'' >>> basedir: ''/srv'' >>> logdir: ''/var/log'' >>> user: ''crowd'' >>> group: ''crowd'' >>> >>> my hiera.yaml >>> --- >>> :hierarchy: >>> - %{calling_module}/%{fqdn} >>> - %{hostbasename} >>> - %{domain} >>> - common >>> :backends: >>> - yaml >>> :yaml: >>> :datadir: ''/var/lib/environments/%{environment}/hieradata'' >>> >>> >>> if i wrote the crowd.yaml content in the common.yaml all works, if its >>> in the module subdirectory, puppet can not find the data from the hiera >>> lookup in the tomcat::installer, but the call from the tomcat::instance >>> class works, i get the right tomcat names in the error. >>> >>> any idea? >>> >>> rgds Florian >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Puppet Users" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/puppet-users/-/ZjdL5rHQxBYJ. >>> To post to this group, send email to puppet-users@googlegroups.com. >>> To unsubscribe from this group, send email to >>> puppet-users+unsubscribe@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/puppet-users?hl=en. >>> >> >> >> >> -- >> >> Gary Larizza >> Professional Services Engineer >> Puppet Labs >> >>On Thursday, 15 March 2012 21:58:01 UTC+1, Florian Koch wrote:> > Hi Gary, > > hm for other classes it works , so i think the puppet backend is not > needed > ( > https://github.com/ripienaar/hiera-puppet/commit/a7350529a99e5d1bad8b03749661f3f4c7f00216 > ), > the problem is the define, i guess that a define won''t set $module_path > correct, the hiera cass from the class tocat::instance works perfect. > > But i have found better solution, i use create_resources to build the > defines, works really smart > > class tomcat::instance{ > > $instances = hiera(''tomcat_instances'') > > create_resources(''tomcat::installer'',$instances) > } > define tomcat::installer ($user,$group,$basedir,$logdir,$name){ ....} > --- > tomcat_instances: > crowd1: > name: ''cr1'' > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > crowd2: > name: ''cr2'' > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > > rgds Florian > Am Donnerstag, 15. März 2012 21:33:17 UTC+1 schrieb Gary Larizza: >> >> Hi Florian, >> >> I believe since $calling_module is a variable out of Puppet and not >> Facter, that you will need to ALSO setup the Puppet backend, in addition to >> the YAML backend, in the hiera.yaml file so Hiera can get its value. >> >> On Fri, Mar 16, 2012 at 6:47 AM, Florian Koch < >> florian.koch1981@googlemail.com> wrote: >> >>> Hi, >>> >>> i have some trouble with hiera and %{calling_module}. >>> >>> i have: >>> >>> class tomcat::instance{ >>> >>> $instances = hiera(''tomcat_instances'') >>> >>> tomcat::installer{$instances:} >>> >>> } >>> >>> define tomcat::installer { >>> >>> require ''tomcat'' >>> >>> $instance_opts = hiera($name) >>> >>> $tomcat_user = $instance_opts[user] >>> $tomcat_group = $instance_opts[group] >>> $basedir = $instance_opts[basedir] >>> $logdir = $instance_opts[logdir] >>> $tomcat_name = $instance_opts[name] >>> >>> >>> $tomcat_version=''6'' >>> ... >>> } >>> >>> i specify the tomcat names in a hiera file and run the define wit the >>> names as array (so they get executed for each name) >>> >>> ''/var/lib/environments/test/hieradata''/tomcat/crowd.yaml >>> >>> --- >>> tomcat_instances: >>> - crowd1 >>> - crowd2 >>> >>> >>> crowd1: >>> name: ''crowd1'' >>> basedir: ''/srv'' >>> logdir: ''/var/log'' >>> user: ''crowd'' >>> group: ''crowd'' >>> >>> crowd2: >>> name: ''crowd2'' >>> basedir: ''/srv'' >>> logdir: ''/var/log'' >>> user: ''crowd'' >>> group: ''crowd'' >>> >>> my hiera.yaml >>> --- >>> :hierarchy: >>> - %{calling_module}/%{fqdn} >>> - %{hostbasename} >>> - %{domain} >>> - common >>> :backends: >>> - yaml >>> :yaml: >>> :datadir: ''/var/lib/environments/%{environment}/hieradata'' >>> >>> >>> if i wrote the crowd.yaml content in the common.yaml all works, if its >>> in the module subdirectory, puppet can not find the data from the hiera >>> lookup in the tomcat::installer, but the call from the tomcat::instance >>> class works, i get the right tomcat names in the error. >>> >>> any idea? >>> >>> rgds Florian >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Puppet Users" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/puppet-users/-/ZjdL5rHQxBYJ. >>> To post to this group, send email to puppet-users@googlegroups.com. >>> To unsubscribe from this group, send email to >>> puppet-users+unsubscribe@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/puppet-users?hl=en. >>> >> >> >> >> -- >> >> Gary Larizza >> Professional Services Engineer >> Puppet Labs >> >>On Thursday, 15 March 2012 21:58:01 UTC+1, Florian Koch wrote:> > Hi Gary, > > hm for other classes it works , so i think the puppet backend is not > needed > ( > https://github.com/ripienaar/hiera-puppet/commit/a7350529a99e5d1bad8b03749661f3f4c7f00216 > ), > the problem is the define, i guess that a define won''t set $module_path > correct, the hiera cass from the class tocat::instance works perfect. > > But i have found better solution, i use create_resources to build the > defines, works really smart > > class tomcat::instance{ > > $instances = hiera(''tomcat_instances'') > > create_resources(''tomcat::installer'',$instances) > } > define tomcat::installer ($user,$group,$basedir,$logdir,$name){ ....} > --- > tomcat_instances: > crowd1: > name: ''cr1'' > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > crowd2: > name: ''cr2'' > basedir: ''/srv'' > logdir: ''/var/log'' > user: ''crowd'' > group: ''crowd'' > > > rgds Florian > Am Donnerstag, 15. März 2012 21:33:17 UTC+1 schrieb Gary Larizza: >> >> Hi Florian, >> >> I believe since $calling_module is a variable out of Puppet and not >> Facter, that you will need to ALSO setup the Puppet backend, in addition to >> the YAML backend, in the hiera.yaml file so Hiera can get its value. >> >> On Fri, Mar 16, 2012 at 6:47 AM, Florian Koch < >> florian.koch1981@googlemail.com> wrote: >> >>> Hi, >>> >>> i have some trouble with hiera and %{calling_module}. >>> >>> i have: >>> >>> class tomcat::instance{ >>> >>> $instances = hiera(''tomcat_instances'') >>> >>> tomcat::installer{$instances:} >>> >>> } >>> >>> define tomcat::installer { >>> >>> require ''tomcat'' >>> >>> $instance_opts = hiera($name) >>> >>> $tomcat_user = $instance_opts[user] >>> $tomcat_group = $instance_opts[group] >>> $basedir = $instance_opts[basedir] >>> $logdir = $instance_opts[logdir] >>> $tomcat_name = $instance_opts[name] >>> >>> >>> $tomcat_version=''6'' >>> ... >>> } >>> >>> i specify the tomcat names in a hiera file and run the define wit the >>> names as array (so they get executed for each name) >>> >>> ''/var/lib/environments/test/hieradata''/tomcat/crowd.yaml >>> >>> --- >>> tomcat_instances: >>> - crowd1 >>> - crowd2 >>> >>> >>> crowd1: >>> name: ''crowd1'' >>> basedir: ''/srv'' >>> logdir: ''/var/log'' >>> user: ''crowd'' >>> group: ''crowd'' >>> >>> crowd2: >>> name: ''crowd2'' >>> basedir: ''/srv'' >>> logdir: ''/var/log'' >>> user: ''crowd'' >>> group: ''crowd'' >>> >>> my hiera.yaml >>> --- >>> :hierarchy: >>> - %{calling_module}/%{fqdn} >>> - %{hostbasename} >>> - %{domain} >>> - common >>> :backends: >>> - yaml >>> :yaml: >>> :datadir: ''/var/lib/environments/%{environment}/hieradata'' >>> >>> >>> if i wrote the crowd.yaml content in the common.yaml all works, if its >>> in the module subdirectory, puppet can not find the data from the hiera >>> lookup in the tomcat::installer, but the call from the tomcat::instance >>> class works, i get the right tomcat names in the error. >>> >>> any idea? >>> >>> rgds Florian >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Puppet Users" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/puppet-users/-/ZjdL5rHQxBYJ. >>> To post to this group, send email to puppet-users@googlegroups.com. >>> To unsubscribe from this group, send email to >>> puppet-users+unsubscribe@googlegroups.com. >>> For more options, visit this group at >>> http://groups.google.com/group/puppet-users?hl=en. >>> >> >> >> >> -- >> >> Gary Larizza >> Professional Services Engineer >> Puppet Labs >> >>-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Z-b9ls6o4f0J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.