Re: [Puppet Users] Plugins and Hiera

2012-03-27 Thread Gary Larizza
Yes, I should update that. It looks for a variable IN SCOPE that matches the variable you've used in your hierarchy. Let me put that in for a blog update. On Tue, Mar 27, 2012 at 7:47 AM, pablo wrote: > Hi, > > You are indeed absolutely right, and I am very happy about that. Thanks!! > > I t

Re: [Puppet Users] Plugins and Hiera

2012-03-27 Thread pablo
Hi, You are indeed absolutely right, and I am very happy about that. Thanks!! I think the confusion is coming from here: http://puppetlabs.com/blog/first-look-installing-and-using-hiera/ There it constantly says "it queries Facter", which turns out to be wrong. BR/Pablo On 03/25/2012 06:20 P

Re: [Puppet Users] Plugins and Hiera

2012-03-25 Thread Jan Ivar Beddari
On 03/24/2012 10:58 AM, Fernandez Pablo wrote: Hi, That would define $primary_group as a variable, not as a fact. Indeed, what I want to do is: :backends: - puppet :hierarchy: - %{primary_group} :puppet: :datasource: data And that requires primary_group to be a fact. No, that's not

RE: [Puppet Users] Plugins and Hiera

2012-03-25 Thread Fernandez Pablo
1 PM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] Plugins and Hiera On second-thought, #3 would be out of the question if you wanted to use %{primary_group} as a hierarchy level in Hiera. You will need to either write a fact to determine the group based on something atomic about the

Re: [Puppet Users] Plugins and Hiera

2012-03-24 Thread Gary Larizza
On second-thought, #3 would be out of the question if you wanted to use %{primary_group} as a hierarchy level in Hiera. You will need to either write a fact to determine the group based on something atomic about the system or do something at provision time. Do you have this node-to-primary/second

Re: [Puppet Users] Plugins and Hiera

2012-03-24 Thread Gary Larizza
On Fri, Mar 23, 2012 at 3:42 AM, Pablo Fernandez wrote: > ** > > Dear all, > > > > This is a continuation of another thread, but I think the question > diverged enough to create a new one. > > > > I have a hiera hierarchy like this: > > :hierarchy: > > - %{fqdn} > > - %{secundary_group} > > - %{pr

Re: [Puppet Users] Plugins and Hiera

2012-03-24 Thread Luke Bigum
o be a fact. Any other ideas? Thanks! Pablo From: puppet-users@googlegroups.com [puppet-users@googlegroups.com] on behalf of Luke Bigum [luke.bi...@lmax.com] Sent: Friday, March 23, 2012 2:52 PM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] Plugins and Hiera Ok, I wo

RE: [Puppet Users] Plugins and Hiera

2012-03-24 Thread Fernandez Pablo
From: puppet-users@googlegroups.com [puppet-users@googlegroups.com] on behalf of Luke Bigum [luke.bi...@lmax.com] Sent: Friday, March 23, 2012 2:52 PM To: puppet-users@googlegroups.com Subject: Re: [Puppet Users] Plugins and Hiera Ok, I would say to try hiera-puppet then. I was going to

Re: [Puppet Users] Plugins and Hiera

2012-03-23 Thread Luke Bigum
Ok, I would say to try hiera-puppet then. I was going to quote you a list post but you're actually the OP so maybe you've already tried and it hasn't worked so well. I don't use it myself so this is all theoretical, but could you not do something like this: class module::data { if (tagged(gr

Re: [Puppet Users] Plugins and Hiera

2012-03-23 Thread Pablo Fernandez
Hi, Thanks for the code. My problem is a bit more complex than that... I want to define something within puppet, that gets converted into a fact, and is loaded before puppet. It's a bit chicken-egg problem: - I need the fact to be able to select within the hiera hierarchy. - I want to set up th

Re: [Puppet Users] Plugins and Hiera

2012-03-23 Thread Luke Bigum
Hi Pablo, The Ruby part of Facts is a little daunting at first but not too difficult, here's an example with some added comments: #This custom fact simple tests if a file exists and sets the fact true #or false. #simple conditional logic to decide whether this Fact gets set or not if File.exis

[Puppet Users] Plugins and Hiera

2012-03-23 Thread Pablo Fernandez
Dear all, This is a continuation of another thread, but I think the question diverged enough to create a new one. I have a hiera hierarchy like this: :hierarchy: - %{fqdn} - %{secundary_group} - %{primary_group} - %{productname} - all And I need to define the secondary/primary groups as fa