Re: [Puppet Users] create_resources

2021-02-07 Thread Martin Alfke
Hi, there are some minor not-best-practices in your code: 1. create_resource I prefer using lambda over create_resources as these allows explizit resource declaration which are then bound to the class. This gives you explizit ordering, which you must add if using create_resource. 2. explizit lo

[Puppet Users] create_resources

2021-02-06 Thread Nerbolff
hello there, I would like to clean up my puppet recipes. My init.pp. I have ~three_hundred entries as '*new resources*'(see below). here is how is setup today. I am wondering if we could do better. I am working with puppet v5. ideas or suggestions? thank you very much. *mymodule/manifests/i

[Puppet Users] create_resources not working in 4.x?

2015-11-12 Thread Jakov Sosic
Hi guys, I'm having difficulties with create_resources in latest 4.x master/agent combo... This is the example create_resources call: $logstash_configs = hiera_hash('logstash::configfiles', {}) create_resources('::logstash::configfile', $logstash_configs) This was working ok in version

[Puppet Users] create_resources for /etc/yum.repos.d/ and getting along with purge

2015-04-16 Thread Christopher Hyatt
Repositories defined in yaml, yum module below. Understand some of my floundering is still in this module so things like ensure => "present" are not intended to be taken literally What this really does is wipe out the entire /etc/yum.repos.d/ directory then recreates the repos from yaml, not id

[Puppet Users] create_resources with default parameters on top of yaml for onetime usage

2014-09-01 Thread yamakasi . 014
Hi guys, I'm looking for a solution to svn checkout a branch and directly config the branch modules using create_resources. My yaml would look like this I think for a one time checkout, which will grab all the modules and configure them one by one: svnsource: repourl: branch: copydir:

Re: [Puppet Users] create_resources with hiera

2014-06-19 Thread Christopher Wood
The "template('tomcat/context.xml.erb')" is taken as a literal string when read from hiera. In this case you might wrap the file in a define to use the puppet template() function: define mymodule::hieratesting ( $content ) { file { $name: content => template($content), } } create_resour

[Puppet Users] create_resources with hiera

2014-06-19 Thread Darren Claughton
Hi, I am trying to use create_resources with hiera. My hiera testing.yaml (snippet) looks like this tomcat::confs: "%{hiera('webapps_dir')}/tomcat/conf/context.xml": content: template('tomcat/context.xml.erb') tomcat::default_confs: ensure: present owner: "%{hiera('tomcat::user')}"

Re: [Puppet Users] create_resources and file

2013-11-25 Thread jcbollinger
On Friday, November 22, 2013 6:50:27 PM UTC-6, erkules wrote: > > Ahoi, > > On Thu, Nov 21, 2013 at 12:01:14PM +0100, Felix Frank wrote: > > Hi, > > > > tough call. You may have to replicate the file type in a defined type > > like so: > > > > define my_file($owner="root",$mode="644",...,$

Re: [Puppet Users] create_resources and file

2013-11-22 Thread erkan yanar
Ahoi, On Thu, Nov 21, 2013 at 12:01:14PM +0100, Felix Frank wrote: > Hi, > > tough call. You may have to replicate the file type in a defined type > like so: > > define my_file($owner="root",$mode="644",...,$template="") { > > if $template { File[$name] { content => template($template) } } >

Re: [Puppet Users] create_resources and file

2013-11-21 Thread Felix Frank
Hi, tough call. You may have to replicate the file type in a defined type like so: define my_file($owner="root",$mode="644",...,$template="") { if $template { File[$name] { content => template($template) } } file { $name: owner => $owner, ... } } Then you can create_resource('my_file',hier

[Puppet Users] create_resources and file

2013-11-18 Thread erkan yanar
Doing create_resources('file',hiera_hash('input')) works great for some hiera like input: /tmp/a.txt: owner: root ensure: file ... Im not able to put any template() stuff in there input: /tmp/a.txt: owner: root ensure: file content: template("create_re/aha.erb") Instead of

Re: [Puppet Users] create_resources function returns error "can't convert Array into Hash"

2012-09-08 Thread JeremyCampbell
On Wednesday, September 5, 2012 5:43:04 PM UTC+2, Dan Bode wrote: > > > > On Wed, Sep 5, 2012 at 8:37 AM, JeremyCampbell > > > wrote: > >> >> >> On Wednesday, September 5, 2012 5:20:49 PM UTC+2, Dan Bode wrote: >> >>> >>> >>> On Wed, Sep 5, 2012 at 8:15 AM, JeremyCampbell wrote: >>> >

Re: [Puppet Users] create_resources function returns error "can't convert Array into Hash"

2012-09-05 Thread Dan Bode
On Wed, Sep 5, 2012 at 8:37 AM, JeremyCampbell wrote: > > > On Wednesday, September 5, 2012 5:20:49 PM UTC+2, Dan Bode wrote: > >> >> >> On Wed, Sep 5, 2012 at 8:15 AM, JeremyCampbell wrote: >> >>> >>> >>> On Wednesday, September 5, 2012 4:15:31 PM UTC+2, Dan Bode wrote: >>> On Wed,

Re: [Puppet Users] create_resources function returns error "can't convert Array into Hash"

2012-09-05 Thread JeremyCampbell
On Wednesday, September 5, 2012 5:20:49 PM UTC+2, Dan Bode wrote: > > > > On Wed, Sep 5, 2012 at 8:15 AM, JeremyCampbell > > > wrote: > >> >> >> On Wednesday, September 5, 2012 4:15:31 PM UTC+2, Dan Bode wrote: >> >>> >>> >>> On Wed, Sep 5, 2012 at 7:05 AM, JeremyCampbell wrote: >>> I have

Re: [Puppet Users] create_resources function returns error "can't convert Array into Hash"

2012-09-05 Thread Dan Bode
On Wed, Sep 5, 2012 at 8:15 AM, JeremyCampbell wrote: > > > On Wednesday, September 5, 2012 4:15:31 PM UTC+2, Dan Bode wrote: > >> >> >> On Wed, Sep 5, 2012 at 7:05 AM, JeremyCampbell wrote: >> >>> I have written a custom function that returns a hash of data to be used >>> by the *create_resources

Re: [Puppet Users] create_resources function returns error "can't convert Array into Hash"

2012-09-05 Thread JeremyCampbell
On Wednesday, September 5, 2012 4:15:31 PM UTC+2, Dan Bode wrote: > > > > On Wed, Sep 5, 2012 at 7:05 AM, JeremyCampbell > > > wrote: > >> I have written a custom function that returns a hash of data to be used >> by the *create_resources* function. >> >> class network::multiroute::mhpeers (

Re: [Puppet Users] create_resources function returns error "can't convert Array into Hash"

2012-09-05 Thread Dan Bode
On Wed, Sep 5, 2012 at 7:05 AM, JeremyCampbell wrote: > I have written a custom function that returns a hash of data to be used by > the *create_resources* function. > > class network::multiroute::mhpeers ( > ) { > $routes = gen_ip_routes("gw.uk") > create_resources(network::multiroute::mhpeer

[Puppet Users] create_resources function returns error "can't convert Array into Hash"

2012-09-05 Thread JeremyCampbell
I have written a custom function that returns a hash of data to be used by the *create_resources* function. class network::multiroute::mhpeers ( ) { $routes = gen_ip_routes("gw.uk") create_resources(network::multiroute::mhpeer, $routes) } However, on the puppet client I get "err: Could not

[Puppet Users] create_resources function and puppet enc

2012-07-18 Thread Arun S A G
Hi, I am trying to create multiple users using puppet. I have created a ENC and trying to use class wrapped defined types with create_resources function. For some reason things are falling apart. I would really appreciate some help on these Here are the details about my classes and configurati

[Puppet Users] create_resources (or variable scoping?) question

2011-09-27 Thread Matthias Pigulla
Hi all, I would like to create a configuration along the lines of complex_user { "joe": uid => 42, sshkeys => { "key1-comment" => { key => "...", ... }, "key2-comment" => { key => "...", ...} } ... } That is, a definition that will