You probably getting: "file not found" or something like that? It's
because you are trying to copy a file from one machine (i.e. puppet
server) to another machine, your puppet agent, using "cp" command.
Puppet has file{} resource and "source" parameter for that. Other than
that, if not typo, I don't see any gap between the source_path and the
dest_path in your "cp" command.
Also, I think "class d_services::jboss" is wrong in your case. You
don't have any "d_services" module, I suppose. Try this: If "jmx-
console-users.properties" is the file that your are trying to copy,
then create a directory on your Puppet-master at "etc/puppet/modules/
dev_jboss_jeeva/files" and put the configuration file(s) in there
first. Then, use this:
# /etc/puppet/modules/dev_jboss_jeeva/manifests/jboss.pp
--------------------------------------------------------
class dev_jboss_jeeva::jboss {
define opt_dir($path) {
$j_conf = 'jmx-console-users.properties'
exec { "chk_${path}":
path => [ '/bin', '/usr/bin' ],
command => "test -d /opt/${path}",
}
file { "${path}_${j_conf}":
name => "/opt/${path}/${j_conf}",
mode => '0644', owner => 'root', group => 'root',
source => "puppet:///modules/dev_jboss_jeeva/${j_conf}",
require => Exec[ "chk_${path}" ];
}
}
}
Now, suppose you are copying the file: jmx-console-users.properties to
"/opt/jboss_1", "/opt/jboss_2" and "/opt/jboss_3" on the agent (if
available), change the init.pp like this:
# /etc/puppet/modules/dev_jboss_jeeva/manifests/init.pp
--------------------------------------------------------
class copy_jboss_conf {
include dev_jboss_jeeva::jboss
dev_jboss_jeeva::jboss::opt_dir {
'copy_to_1st':
path => 'jboss_1';
'copy_to_2nd':
path => 'jboss_2';
'copy_to_3rd':
path => 'jboss_3';
}
}
******************************************************
Not tested, but should work. At least it's working for me in similar
fashion. Cheers!!
On Apr 12, 6:40 pm, Munna S <[email protected]> wrote:
> 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
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.