[Puppet Users] Re: Need puppet module for condition copy

2012-04-16 Thread Sans
It's definitely a class loading problem and I don't think Jeeva is using modules at all. Jeeva: Could you pls try the things I said in my previous post and see if that works? Cheers!! On Monday, April 16, 2012 1:34:31 AM UTC+1, Wil Cooley wrote: On Apr 13, 10:49 am, Munna S

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-16 Thread Munna S
Hi Sans i am trying it now. will let you know the output soon. Also in my site.pp i have the below content import 'nodes/*' $puppetserver = 'puppet-server.domain.com' I do have many modules , which works as expected. Thanks, Jeeva cat /etc/puppet/manifests/site.pp On Mon, Apr 16, 2012 at

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-16 Thread Munna S
Hi Sans, I followed your steps, but i am getting the same error again Apr 16 11:29:39 pil-vm-pup-01 puppet-master[8092]: Could not find class cp_jboss_conf for vm-jeeva2.aircell.prod at /etc/puppet/manifests/nodes/vm-jeeva2.aircell.prod.pp:2 on node vm-jeeva2.aircell.prod Apr 16 11:29:39

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-16 Thread Sans
humm.. not sure but looks like couple of steps from my previous post are missing. Can you pls confirm that you have all of these: 1. The line: *import 'modules'* in */etc/puppet/manifests/site.pp* 2. The line: *import 'jb_test'* in* /etc/puppet/manifests/modules.pp* 3. The file:*

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-16 Thread Munna S
1. The line: *import 'modules'* in */etc/puppet/manifests/site.pp - i do have site.pp file but dont have the entry for modules. i added the entry but later i saw lot of errors related to modules in log * 2. The line: *import 'jb_test'* in* /etc/puppet/manifests/modules.pp - i

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-16 Thread Sans
According to your configuration, I don't think my code will work at all. Your setup is quite different then mine and I've no other suggestions for you at the moment. Hopefully, someone else will pick it up from here. Cheers!! On Monday, April 16, 2012 1:59:25 PM UTC+1, Jeeva wrote: 1.

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-16 Thread Munna S
Thank you so much San for your time and help. Can anyone help me with this -Jeeva On Mon, Apr 16, 2012 at 9:54 AM, Sans r.santanu@gmail.com wrote: According to your configuration, I don't think my code will work at all. Your setup is quite different then mine and I've no other

[Puppet Users] Re: Need puppet module for condition copy

2012-04-15 Thread Wil Cooley
On Apr 13, 10:49 am, Munna S 19.mu...@gmail.com wrote: I followed your steps. now i am getting below error Apr 13 17:42:44 pil-vm-pup-01 puppet-master[7899]: Could not find class dev_jboss_jeeva for vm-jeeva2.aircell.prod at ... i have jeeva_base.pp file under /etc/puppet/manifests/nodes

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-14 Thread Sans
I don't have *node-based* setup; all my configuration is *module-based*, so cannot comment on that but I assume it should have worked in the same way. To make it plain and simple, could you please follow the steps below and see if it works? *On the puppet master: * - #* mkdir -p

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-14 Thread Sans
(I don't have *node-based* setup (all my configuration is module-based) so can't comment on that but I assume it should have worked that same way. To make it plain a and simple, could you follow the steps below and see if it works? *On the puppet-master:* - # *mkdir -p

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-14 Thread Sans
I don't have *node-based* setup (all my configuration is module-based) so can't comment on that but I assume it should have worked that same way. To make it plain a and simple, could you follow the steps below and see if it works? *On the puppet-master:* - # *mkdir -p

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-13 Thread Munna S
I followed your steps. now i am getting below error Apr 13 17:42:44 pil-vm-pup-01 puppet-master[7899]: Could not find class dev_jboss_jeeva for vm-jeeva2.aircell.prod at /etc/puppet/manifests/nodes/jeeva_base.pp:2 on node vm-jeeva2.aircell.prod Apr 13 17:42:44 pil-vm-pup-01 puppet-master[7899]:

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-12 Thread Munna S
Hi Gary, I created a custom fact path_to_check.rb and placed it under .../module_name/lib/facter below is my init.pp file class class_name if $path_to_check == present{ file { /opt/xyz/file.txt: owner = jboss, group = jboss,

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-12 Thread Brian Gallew
Another alternative is to unconditionally copy the file to a staging director (e.g. /var/staging) and then have exec { conditional copy to path1: onlyif = test -d /opt/path1 command = rsync -a /var/staging/file.txt /opt/path1; conditional copy to path2: onlyif = test -d /opt/path2

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-12 Thread Munna S
Hi Brian, below is my updated init.pp file. but i am getting the error as Apr 12 14:49:51 pil-vm-pup-01 puppet-master[14586]: (//vm-jeeva2.aircell.prod/Puppet) Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class dev_jboss_jeeva for vm-jeeva2.aircell.prod at

[Puppet Users] Re: Need puppet module for condition copy

2012-04-12 Thread Sans
As Brian suggested, using define{} is the better way of doing it; you can even copy different files to different directories, if required. Something like this: # /etc/puppet/modules/ur_module/manifests/staging.pp -- class ur_module::staging {

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-12 Thread Brian Gallew
You can't put a file{} resource inside an exec{} resource. On Thu, Apr 12, 2012 at 7:53 AM, Munna S 19.mu...@gmail.com wrote: Hi Brian, below is my updated init.pp file. but i am getting the error as Apr 12 14:49:51 pil-vm-pup-01 puppet-master[14586]: (//vm-jeeva2.aircell.prod/Puppet)

[Puppet Users] Re: Need puppet module for condition copy

2012-04-12 Thread Sans
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

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-12 Thread Munna S
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/

[Puppet Users] Re: Need puppet module for condition copy

2012-04-12 Thread Sans
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

[Puppet Users] Re: Need puppet module for condition copy

2012-04-01 Thread Munna S
Team, Any help Thanks, Jeeva On Fri, Mar 30, 2012 at 12:51 PM, Munna S 19.mu...@gmail.com wrote: Team, I need a puppet module to copy a file to different location based on condition check . Below is my requirement if /opt/path1 found on the server then copy file1 if /opt/path2 found on

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-01 Thread Gary Larizza
Jeeva, I would make a custom fact ( http://docs.puppetlabs.com/guides/custom_facts.html) that checks for the presence of these files. Your Puppet manifest would check the condition of this fact to ensure the file absent or present (i.e. if $custom_fact { file { '/path/to/file': ensure = file }

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-01 Thread Munna S
Hi Gary, How i can put this in my init.pp file. Actually i am checking for the path. if path found then copy the file else dont create any file/folder. So here i need to check for 3 different path on each server. if any of the below path exist then copy the file. Thanks, Jeeva On Sun, Apr 1,

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-01 Thread Gary Larizza
Jeeva, Your custom fact would do something like: File.directory?('/path/to/check') that returns true or false depending on whether the directory existed. Your fact would return a true or false value (so if the custom fact were named 'path_to_x' you would do something like this in your init.pp

Re: [Puppet Users] Re: Need puppet module for condition copy

2012-04-01 Thread Munna S
Thank you so much Gary. I will try this Thanks, Jeeva On Sun, Apr 1, 2012 at 11:05 PM, Gary Larizza g...@puppetlabs.com wrote: Jeeva, Your custom fact would do something like: File.directory?('/path/to/check') that returns true or false depending on whether the directory existed. Your