Hi Sans, This is my jboss.pp file
class d_services::jboss { define opt_dir($path) { exec { "copy_${path}": path => [ '/bin', '/usr/bin' ], command => "cp /etc/puppet/modules/dev_jboss_jeeva/opt/jboss/ jboss-4.2.3.GA/server/default/conf/props/jmx-console-users.properties/opt/${path}", onlyif => "test -d /opt/${path}", } } } this is my init.pp file class dev_jboss_jeeva { include d_services::jboss d_services::jboss::opt_dir { 'jboss_1': path => '/opt/jboss/jboss-4.2.3.GA/server/default/conf/props/'; } } But i am still getting the error On Thu, Apr 12, 2012 at 12:26 PM, Munna S <19.mu...@gmail.com> wrote: > source file path it will take from my puppet master server right ? > > -Jeeva > > On Thu, Apr 12, 2012 at 11:20 AM, Sans <r.santanu....@gmail.com> wrote: > >> w.r.t ${file}, what I meant is you can make it "super dynamic" with >> filenames, if you had to copy different files, as opposed to "a >> single" file. This is a perfectly working example (change the values/ >> parameter as required): >> >> >> >> # /etc/puppet/modules/<ur_module>/manifests/test.pp >> ------------------------------------------------------ >> class d_services::test { >> >> define opt_dir($path) { >> >> exec { "copy_${path}": >> path => [ '/bin', '/usr/bin' ], >> command => "cp /tmp/yum.conf.security /opt/${path}", >> onlyif => "test -d /opt/${path}", >> } >> } >> } >> >> >> # /etc/puppet/modules/<ur_module>/manifests/init.pp >> --------------------------------------------------- >> class mod_test { >> >> include d_services::test >> d_services::test::opt_dir { >> >> 'test_1': >> path => 'test1'; >> >> 'test_2': >> path => 'test2'; >> >> 'test_3': >> path => 'test3'; >> >> } >> } >> --------------------------------------------------- >> >> >> It will copy "/tmp/yum.conf.security" to "/opt/test{1|2|3}", if >> available. >> Hope this helps. Cheers!! >> >> >> >> >> On Apr 12, 4:17 pm, Munna S <19.mu...@gmail.com> wrote: >> > I am bit confused about /var/staging/${file} . Let me explain again my >> > requirement. >> > >> > we have 3 version of jboss running on multiple servers. >> > >> > I need a puppet module to copy a jboss config file to different location >> > based on path condition check . Below is my requirement >> > >> > if /opt/path1 found on the server then copy file1 or 2 >> > if /opt/path2 found on the server then copy file1 or 2 >> > if /opt/path3 found on the server then copy file1 or 2 >> > >> > if none of the above path found then dont copy any file >> > >> >> -- >> 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+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/puppet-users?hl=en. >> >> > -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.