Pass args as array to definition, Template...

33 views
Skip to first unread message

Douglas Garstang

unread,
Nov 6, 2009, 5:24:54 PM11/6/09
to Puppet Users
Can I do this in puppet? I think the example is pretty self explanatory.

jboss::create_inst {
tfel0:
version => $jboss_version,
naming_port => "1099",
db_info => [ db_name => "foo1", db_port => "1111" ];
....
}

define jboss::create_inst($version, $naming_port, $db_info = [] ) {
....
file {
"/opt/jboss/jboss-$version/server/$name/deploy/mysql-ds.xml":
content => template("jboss/jboss_home/deploy/mysql-ds.xml.erb");
}
....
}

and in the template, put...

<jndi-name><%= db_info["db_name"] %></jndi-name>

You get the idea...

Doug.

Douglas Garstang

unread,
Nov 6, 2009, 6:10:34 PM11/6/09
to Puppet Users

Peter Meier

unread,
Nov 7, 2009, 5:44:29 AM11/7/09
to puppet...@googlegroups.com
> Can I do this in puppet? I think the example is pretty self explanatory.

no. Puppet currently doesn't support complexer data structures like hashes.

cheers pete

jcbollinger

unread,
Nov 19, 2012, 9:54:49 AM11/19/12
to puppet...@googlegroups.com


On Sunday, November 18, 2012 11:58:35 PM UTC-6, mickael avedissian wrote:
Is this possible now? 


Puppet has had support for hashes since version 2.6.0, which is pretty old now.  If that doesn't answer your question then you'll have to be more specific about what you mean by "this".

Also, you should strongly consider starting a new topic instead of resurrecting a three-year-old one.


John

Reply all
Reply to author
Forward
0 new messages