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
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
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
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
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
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():
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
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:
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
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
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
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
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
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].
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 =
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
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
17 matches
Mail list logo