Douglas Garstang
2009-Nov-06 22:24 UTC
[Puppet Users] Pass args as array to definition, Template...
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. --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Douglas Garstang
2009-Nov-06 23:10 UTC
[Puppet Users] Pass args as array to definition, Template...
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. --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Peter Meier
2009-Nov-07 10:44 UTC
[Puppet Users] Re: Pass args as array to definition, Template...
> 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 --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
mickael avedissian
2012-Nov-19 05:58 UTC
[Puppet Users] Re: Pass args as array to definition, Template...
On Friday, November 6, 2009 5:24:54 PM UTC-5, Douglas wrote:> > 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. >Is this possible now? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/n6PxuDmxlq4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2012-Nov-19 14:54 UTC
[Puppet Users] Re: Pass args as array to definition, Template...
On Sunday, November 18, 2012 11:58:35 PM UTC-6, mickael avedissian wrote:> > > > On Friday, November 6, 2009 5:24:54 PM UTC-5, Douglas wrote: >> >> 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. >> > > 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 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/b2X4rRMpSBoJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.