Re: [Puppet Users] Re: hiera default values for a variable

2012-12-06 Thread Peter Brown
I worked out my problem. I spelt hierarchy wrong in my hiera.yaml file... On 7 December 2012 13:00, Peter Brown wrote: > On 7 December 2012 12:11, Ryan Cunningham > wrote: > >> I'm actually having this exact same problem. In my hiera.yaml file I had >> a hierarchy including two facts and then

Re: [Puppet Users] Re: hiera default values for a variable

2012-12-06 Thread Peter Brown
On 7 December 2012 12:11, Ryan Cunningham wrote: > I'm actually having this exact same problem. In my hiera.yaml file I had a > hierarchy including two facts and then some strings derived from facter > facts. > Nice to know I am not completely insane. When I run puppet agent --test the hiera var

Re: [Puppet Users] Re: hiera default values for a variable

2012-12-06 Thread Ryan Cunningham
I'm actually having this exact same problem. In my hiera.yaml file I had a hierarchy including two facts and then some strings derived from facter facts. When I run puppet agent --test the hiera vars in files named for the node's $fqdn, etc. aren't found, but if I puppet apply specifying my sit

Re: [Puppet Users] Re: hiera default values for a variable

2012-12-06 Thread Peter Brown
On Dec 7, 2012 12:08 AM, "jcbollinger" wrote: > > > > On Tuesday, December 4, 2012 8:10:00 PM UTC-6, Pete wrote: >> >> >> One last question. >> I use a node level variable to specify the location of a node. >> I use this for setting variables specific to that location like different puppet master

Re: [Puppet Users] Re: hiera default values for a variable

2012-12-06 Thread jcbollinger
On Tuesday, December 4, 2012 8:10:00 PM UTC-6, Pete wrote: > > > One last question. > I use a node level variable to specify the location of a node. > I use this for setting variables specific to that location like different > puppet master ip and nagios ip for the office and such. > I want to u

Re: [Puppet Users] Re: hiera default values for a variable

2012-12-05 Thread Peter Brown
On 6 December 2012 14:08, Chad Huneycutt wrote: > On Wed, Dec 5, 2012 at 9:29 PM, Peter Brown wrote: > > On 5 December 2012 21:10, Vaidas Jablonskis > wrote: > >> On Wednesday, 5 December 2012 02:10:00 UTC, Pete wrote: > >>> On 4 December 2012 21:17, Vaidas Jablonskis > wrote: > >>> > >>> One

Re: [Puppet Users] Re: hiera default values for a variable

2012-12-05 Thread Chad Huneycutt
On Wed, Dec 5, 2012 at 9:29 PM, Peter Brown wrote: > On 5 December 2012 21:10, Vaidas Jablonskis wrote: >> On Wednesday, 5 December 2012 02:10:00 UTC, Pete wrote: >>> On 4 December 2012 21:17, Vaidas Jablonskis wrote: >>> >>> One last question. >>> I use a node level variable to specify the loca

Re: [Puppet Users] Re: hiera default values for a variable

2012-12-05 Thread Peter Brown
On 5 December 2012 21:10, Vaidas Jablonskis wrote: > > > On Wednesday, 5 December 2012 02:10:00 UTC, Pete wrote: > >> On 4 December 2012 21:17, Vaidas Jablonskis wrote: >> >>> Yes, it is that simple. >> >> >> I gave it a go just after I sent my email and it works like a charm. >> >> >> The other

Re: [Puppet Users] Re: hiera default values for a variable

2012-12-05 Thread Vaidas Jablonskis
On Wednesday, 5 December 2012 02:10:00 UTC, Pete wrote: > > On 4 December 2012 21:17, Vaidas Jablonskis > > wrote: > >> Yes, it is that simple. > > > I gave it a go just after I sent my email and it works like a charm. > > > The other way of doing (some people prefer this way actually) is to put

Re: [Puppet Users] Re: hiera default values for a variable

2012-12-04 Thread Peter Brown
On 4 December 2012 21:17, Vaidas Jablonskis wrote: > Yes, it is that simple. I gave it a go just after I sent my email and it works like a charm. The other way of doing (some people prefer this way actually) is to put > your variables inside the actual class (not as parameters of the class),

Re: [Puppet Users] Re: hiera default values for a variable

2012-12-04 Thread Vaidas Jablonskis
Yes, it is that simple. The other way of doing (some people prefer this way actually) is to put your variables inside the actual class (not as parameters of the class), for example: class foo { $my_parameter = hiera('foo::my_parameter', 'default_value') $another_parameter = hiera('foo

Re: [Puppet Users] Re: hiera default values for a variable

2012-12-03 Thread Peter Brown
On 3 December 2012 22:38, Vaidas Jablonskis wrote: > Hi Pete, > > It depends on what version of puppet you use. If you use 3.x, then it has > hiera built-in. So it's very simple to write classes which are compatible > with v2.7 or v3.x versions. > I am testing on 3. I normally write something l

[Puppet Users] Re: hiera default values for a variable

2012-12-03 Thread llowder
On Sunday, December 2, 2012 9:42:08 PM UTC-6, Pete wrote: > > Hi everyone, > > I currently have a giant file with default variables I use in a lot of my > modules and I override those at the node level if I need to. > I thought I would give porting that data into a hiera setup. > > I worked out

[Puppet Users] Re: hiera default values for a variable

2012-12-03 Thread Vaidas Jablonskis
Hi Pete, It depends on what version of puppet you use. If you use 3.x, then it has hiera built-in. So it's very simple to write classes which are compatible with v2.7 or v3.x versions. I normally write something like this: class foo( $parameter = undef, ) {...} What that means is that puppe