[Puppet Users] Optional values from Hiera (no default value)

2012-04-26 Thread Lars Francke
Hello Puppet List, I'm writing a module that should take an optional value and I want to get it (amongst other places) from Hiera. $repository = $::java_repository ? { undef = hiera('java_repository') default = $::java_repository, } But this fails because Hiera raises an error if it can't

Re: [Puppet Users] Optional values from Hiera (no default value)

2012-04-26 Thread Lars Francke
Hey Tim, thanks for your answer. hiera() can take a second argument which is the default you want to supply if no data store provides a value.  Before you ask, no, I don't know where that's documented, but we've been using it for a while in our puppet manifests and it has been mentioned on

Re: [Puppet Users] Hiera: Bug with false booleans

2012-03-26 Thread Lars Francke
Thanks Gary, done: http://projects.puppetlabs.com/issues/13408 Cheers, Lars -- 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] Hiera: Bug with false booleans

2012-03-24 Thread Lars Francke
Hi, I've just run into a small glitch with Hiera. I have a YAML file that has a definition like this: puppet_agent_splay: false but the run fails because of err: Could not find data item puppet_agent_splay in any Hiera data file and no default supplied at

Re: [Puppet Users] Re: Hiera Puppet backend - search order question

2012-03-23 Thread Lars Francke
Hi Nan and thanks for your reply, Hiera in Defined Resource Types: It's using the calling class and calling module to calculate the places it looks for its data. For defines though this is not the path where the define itself was defined (e.g. tmp::register) but the name it was given when it

[Puppet Users] Re: Hiera Puppet backend - search order question

2012-03-22 Thread Lars Francke
I ran into the same problem again: define tmp::register { $foo = hiera('foo'} class tmp::bar::foo { tmp::register { 'foo': } } class tmp::data { $foo = 'foo' } All of these files in their proper locations but hiera complains: debug: hiera(): Looking up foo in Puppet backend debug: hiera():

[Puppet Users] Re: Hiera Puppet backend - search order question

2012-03-22 Thread Lars Francke
I've looked at the puppet_backend.rb now and that explains the behavior I'm seeing (unsurprisingly ;-) ) Hiera in Defined Resource Types: It's using the calling class and calling module to calculate the places it looks for its data. For defines though this is not the path where the define itself

Re: [Puppet Users] Re: Casting Fixnum to String (Hiera/YAML)

2012-03-02 Thread Lars Francke
Hi Krzysztof, I guess the question boils down to: Is there a way to cast from Fixnum to String? Yes, look below :) Excellent! Take a look on this: https://github.com/kwilczynski/puppet-functions/blob/master/lib/puppet/parser/functions/num2str.rb And this:

[Puppet Users] Casting Fixnum to String (Hiera/YAML)

2012-02-26 Thread Lars Francke
Hi, I'm trying to write a SSH module to learn Hiera. The module is including a Firewall config from the Puppetlabs Firewall module. I've made the port configurable using a variable ssh_server_port. $port = hiera('ssh_server_port') firewall { 100 SSHD: proto = 'tcp', action

[Puppet Users] Hiera Puppet backend - search order question

2012-02-25 Thread Lars Francke
Hi! I'm testing Hiera for the first time and so far it is very pleasant. I'm looking very much forward to it being integrated into Puppet. So far I've got one question: I have a class ssh::server::install which is getting a parameter from Hiera. I'm using the yaml and puppet backends. I also

Re: [Puppet Users] Re: Managing a complex directory structure

2010-12-08 Thread Lars Francke
Hello, sorry it took me so long to reply. Thank you for the answer. That has helped me a lot and I think I'm on the correct path now. It is just a lot more verbose than I had hoped :) A custom function that expands the array would be a bit more universal, but you can still do this with puppet

Re: [Puppet Users] Re: Managing a complex directory structure

2010-12-03 Thread Lars Francke
Hi! Again thank you for the detailed answer. One of the things that sometimes gives Puppet newbies trouble is that it employs a declarative model rather than an imperative one.  In other words, it's an expert system, not a scripting language.  The Puppet language is all about describing the

Re: [Puppet Users] Re: Managing a complex directory structure

2010-11-29 Thread Lars Francke
Hello, But none of that is going to solve your particular problem, because even if you instantiate your defines virtually, you still can provide only one set of parameters for each title within the scope of each node.  Basically, this part of your design concept (define bar) does not fit the

Re: [Puppet Users] vim syntax highlight link broken?

2010-11-26 Thread Lars Francke
I've asked Britt to update it the latest version. Thank you! That - of course - is a third option! it'll be mirrored by vim-scripts.org and/or publish it in its own git repository (instead of the ext/vim directory) so it can be used by pathogen + plugin managers like vim-update-bundles[1].

Re: [Puppet Users] Managing a complex directory structure

2010-11-25 Thread Lars Francke
I don't understand how I'd convert the definitions from my original mail into virtual resources. Simplified: $disks = ['/a', '/b'] define foo() { file { ${name}/foo: } } foo { $disks: } define bar($path) { file { ${name}/foo/${path}: require = Foo[$name], } } bar { $disks: path =

Re: [Puppet Users] vim syntax highlight link broken?

2010-11-25 Thread Lars Francke
Awesome! I didn't even know there was an official syntax file. I've been using the one from vim.org from 2007(?). Thanks for maintaining this. https://github.com/puppetlabs/puppet/tree/master/ext/vim/ We should remove the one on puppetlabs.com. It would be really great if you could either add

[Puppet Users] Managing a complex directory structure

2010-11-18 Thread Lars Francke
Hi, I'm trying to manage our Hadoop cluster with Puppet but there are a few challenges. The one I'm facing now is managing the following. I've got an array variable depending on the type of server: $hadoop_disks = ['/mnt/disk1', '/mnt/disk2', ...] Depending on the classes I include for each