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 <[email protected]> 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 [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.

Reply via email to