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

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

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

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