Vaidas Jablonskis
2012-Sep-21 11:16 UTC
[Puppet Users] hiera() variables with the same name lookup in different modules
Hi poeple, I seem to have a slight issue with Hiera. Let''s say I have a number or different modules and they have multiple variables, but some of the variables have the same name like other modules. For instance $password variable in module "foo" and $password variable in module "bar". How can I distinguish them from each other in my hiera yaml files? I am aware of %{calling_module}, but that requires adding more items into my hierarchy and making management of yaml data files painful. My current hierarchy looks similar to the below one: - %{environment}/nodes/%{fqdn} - %{environment}/common Thanks in advance for your thoughts and responses. -- Vaidas -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit groups.google.com/d/msg/puppet-users/-/WFeDd54qrI8J. 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 groups.google.com/group/puppet-users?hl=en.
R.I.Pienaar
2012-Sep-21 11:21 UTC
Re: [Puppet Users] hiera() variables with the same name lookup in different modules
----- Original Message -----> From: "Vaidas Jablonskis" <jablonskis@gmail.com> > To: puppet-users@googlegroups.com > Sent: Friday, September 21, 2012 12:16:11 PM > Subject: [Puppet Users] hiera() variables with the same name lookup in different modules > > Hi poeple, > > I seem to have a slight issue with Hiera. Let''s say I have a number > or different modules and they have multiple variables, but some of > the variables have the same name like other modules. For instance > $password variable in module "foo" and $password variable in module > "bar". > > How can I distinguish them from each other in my hiera yaml files? I > am aware of %{calling_module}, but that requires adding more items > into my hierarchy and making management of yaml data files painful.if class mysql needs password and class ftp needs password then name the data mysql::password and ftp::password, use that as keys for the call to hiera does that work? -- 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 groups.google.com/group/puppet-users?hl=en.
Vaidas Jablonskis
2012-Sep-21 12:47 UTC
Re: [Puppet Users] hiera() variables with the same name lookup in different modules
It does! Thanks a lot. Simple, but powerful. On Friday, 21 September 2012 12:21:42 UTC+1, R.I. Pienaar wrote:> > > > ----- Original Message ----- > > From: "Vaidas Jablonskis" <jablo...@gmail.com <javascript:>> > > To: puppet...@googlegroups.com <javascript:> > > Sent: Friday, September 21, 2012 12:16:11 PM > > Subject: [Puppet Users] hiera() variables with the same name lookup in > different modules > > > > Hi poeple, > > > > I seem to have a slight issue with Hiera. Let''s say I have a number > > or different modules and they have multiple variables, but some of > > the variables have the same name like other modules. For instance > > $password variable in module "foo" and $password variable in module > > "bar". > > > > How can I distinguish them from each other in my hiera yaml files? I > > am aware of %{calling_module}, but that requires adding more items > > into my hierarchy and making management of yaml data files painful. > > if class mysql needs password and class ftp needs password then name the > data mysql::password and ftp::password, use that as keys for the call > to hiera > > does that work? >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit groups.google.com/d/msg/puppet-users/-/l0my6rsiv9IJ. 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 groups.google.com/group/puppet-users?hl=en.