Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Need puppet module for condition copy
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 27 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Munna S  
View profile  
 More options Mar 30 2012, 1:51 pm
From: Munna S <19.mu...@gmail.com>
Date: Fri, 30 Mar 2012 12:51:51 -0500
Local: Fri, Mar 30 2012 1:51 pm
Subject: Need puppet module for condition copy

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 the server then copy file1
if /opt/path3 found on the server then copy file1

if none of the above path found then dont copy file1

Thanks,
Jeeva


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 1 2012, 11:37 pm
From: Munna S <19.mu...@gmail.com>
Date: Sun, 1 Apr 2012 22:37:50 -0500
Local: Sun, Apr 1 2012 11:37 pm
Subject: Re: Need puppet module for condition copy

Team,

Any help

Thanks,
Jeeva


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary Larizza  
View profile  
 More options Apr 1 2012, 11:41 pm
From: Gary Larizza <g...@puppetlabs.com>
Date: Sun, 1 Apr 2012 20:41:13 -0700
Local: Sun, Apr 1 2012 11:41 pm
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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 } } ).

Does that make sense?

--

Gary Larizza
Professional Services Engineer
Puppet Labs


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 1 2012, 11:48 pm
From: Munna S <19.mu...@gmail.com>
Date: Sun, 1 Apr 2012 22:48:25 -0500
Local: Sun, Apr 1 2012 11:48 pm
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gary Larizza  
View profile  
 More options Apr 2 2012, 12:05 am
From: Gary Larizza <g...@puppetlabs.com>
Date: Sun, 1 Apr 2012 21:05:26 -0700
Local: Mon, Apr 2 2012 12:05 am
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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

    if $path_to_x == 'true' {
      # Do something here
    } else {
      # Do something else here
    }

Do this for every custom fact (corresponding to the paths you want to
check) in your manifest, or combine them into one giant if statement like:

    if ($path_to_x == 'true') or ($path_to_y == 'true') {
      # Do something
    }

Does this make sense?

--

Gary Larizza
Professional Services Engineer
Puppet Labs


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 2 2012, 12:08 am
From: Munna S <19.mu...@gmail.com>
Date: Sun, 1 Apr 2012 23:08:07 -0500
Local: Mon, Apr 2 2012 12:08 am
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

Thank you so much Gary. I will try this

Thanks,
Jeeva


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 12 2012, 10:18 am
From: Munna S <19.mu...@gmail.com>
Date: Thu, 12 Apr 2012 09:18:16 -0500
Local: Thurs, Apr 12 2012 10:18 am
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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",
                source =>
"puppet://$puppetserver/modules/module_name/opt/xyz/file.txt",
                     }
                }

}

But  i dont see files are getting pushed


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Gallew  
View profile  
 More options Apr 12 2012, 10:24 am
From: Brian Gallew <g...@gallew.org>
Date: Thu, 12 Apr 2012 07:24:20 -0700
Local: Thurs, Apr 12 2012 10:24 am
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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"
    command => "rsync -a /var/staging/file.txt /opt/path2";
  "conditional copy to path3":
    onlyif => "test -d /opt/path3"
    command => "rsync -a /var/staging/file.txt /opt/path3";

}

For neatness' sake, you could turn that into a define{}


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 12 2012, 10:53 am
From: Munna S <19.mu...@gmail.com>
Date: Thu, 12 Apr 2012 09:53:15 -0500
Local: Thurs, Apr 12 2012 10:53 am
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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 /etc/puppet/manifests/nodes/jeeva_base.pp:2 on
node vm-jeeva2.aircell.prod
Apr 12 14:49:51 pil-vm-pup-01 puppet-master[14586]:
(//vm-jeeva2.aircell.prod/Puppet) Using cached catalog
Apr 12 14:49:51 pil-vm-pup-01 puppet-master[14586]:
(//vm-jeeva2.aircell.prod/Puppet) Could not retrieve catalog; skipping run
my init.pp file

class dev_jboss_jeeva {
exec {
        onlyif => "test -d /opt/xyz"
file { "/opt/xyz/file.txt":
owner => "jboss",
group => "jboss",
source => "puppet://$puppetserver/modules/module_name/opt/xyz/file.txt",

}
}
}

Thanks,
Jeeva


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sans  
View profile  
 More options Apr 12 2012, 10:57 am
From: Sans <r.santanu....@gmail.com>
Date: Thu, 12 Apr 2012 07:57:09 -0700 (PDT)
Local: Thurs, Apr 12 2012 10:57 am
Subject: Re: Need puppet module for condition copy
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 {

    define opt_dir($file, $path) {

        exec { "copy_${dir}":
            path    => [ '/bin', '/usr/bin' ],
            command => "rsync -a /var/staging/${file} /opt/${path}",
            onlyif  => "test -d /opt/${path}",
        }

}

-------------------------------------------------------

and, then in the init.pp:

# /etc/puppet/modules/<ur_module>/manifests/init.pp
---------------------------------------------------
class file_copy {

    include ur_module::staging

    ur_module::staging::opt_dir {

        'path_1':
        file => 'file.txt',
        path => 'path1';

        'path_2':
        file => 'another_file.txt',
        path => 'path2';

        .....
        ... keep carrying on ...
    }

}

---------------------------------------------------

That should do that job. Cheers!!

On Apr 12, 3:24 pm, Brian Gallew <g...@gallew.org> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Gallew  
View profile  
 More options Apr 12 2012, 11:04 am
From: Brian Gallew <g...@gallew.org>
Date: Thu, 12 Apr 2012 08:04:40 -0700
Local: Thurs, Apr 12 2012 11:04 am
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

You can't put a file{} resource inside an exec{} resource.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sans  
View profile  
 More options Apr 12 2012, 11:10 am
From: Sans <r.santanu....@gmail.com>
Date: Thu, 12 Apr 2012 08:10:15 -0700 (PDT)
Local: Thurs, Apr 12 2012 11:10 am
Subject: Re: Need puppet module for condition copy
You mean, doing this:

        define opt_dir($fl_name, $path) {

instead of this?

        define opt_dir($file, $path) {

On Apr 12, 4:04 pm, Brian Gallew <g...@gallew.org> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 12 2012, 11:17 am
From: Munna S <19.mu...@gmail.com>
Date: Thu, 12 Apr 2012 10:17:09 -0500
Local: Thurs, Apr 12 2012 11:17 am
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sans  
View profile  
 More options Apr 12 2012, 12:20 pm
From: Sans <r.santanu....@gmail.com>
Date: Thu, 12 Apr 2012 09:20:56 -0700 (PDT)
Local: Thurs, Apr 12 2012 12:20 pm
Subject: Re: Need puppet module for condition copy
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 12 2012, 1:26 pm
From: Munna S <19.mu...@gmail.com>
Date: Thu, 12 Apr 2012 12:26:46 -0500
Local: Thurs, Apr 12 2012 1:26 pm
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

source file path it will take from my puppet master server right ?

-Jeeva


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 12 2012, 1:40 pm
From: Munna S <19.mu...@gmail.com>
Date: Thu, 12 Apr 2012 12:40:57 -0500
Local: Thurs, Apr 12 2012 1:40 pm
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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 must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sans  
View profile  
 More options Apr 12 2012, 3:47 pm
From: Sans <r.santanu....@gmail.com>
Date: Thu, 12 Apr 2012 12:47:12 -0700 (PDT)
Local: Thurs, Apr 12 2012 3:47 pm
Subject: Re: Need puppet module for condition copy
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 <19.mu...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 13 2012, 1:49 pm
From: Munna S <19.mu...@gmail.com>
Date: Fri, 13 Apr 2012 12:49:47 -0500
Local: Fri, Apr 13 2012 1:49 pm
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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]: 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]:
(//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 /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]:
(//vm-jeeva2.aircell.prod/Puppet) Using cached catalog
Apr 13 17:42:44 pil-vm-pup-01 puppet-master[7899]:
(//vm-jeeva2.aircell.prod/Puppet) Could not retrieve catalog; skipping run
Apr 13 17:43: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

i have jeeva_base.pp file under /etc/puppet/manifests/nodes and below is
its content
--------------------------------
node jeeva_base {
        include dev_jboss_jeeva

}

--------------------------------------

also i have a another .pp file by name vm-jeeva2 under
/etc/puppet/manifests/nodes and below is its content. we have seperate .pp
file for each server name. one server is vm-jeeva2.
------------------
node vm-jeeva2 inherits jeeva_base {

}

--------------------

what could be the problem ?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sans  
View profile  
 More options Apr 14 2012, 6:42 am
From: Sans <r.santanu....@gmail.com>
Date: Sat, 14 Apr 2012 03:42:25 -0700 (PDT)
Local: Sat, Apr 14 2012 6:42 am
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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 /etc/puppet/modules/jb_test/{manifests,files}*
   - #* echo "import 'jb_test'" >> /etc/puppet/manifests/modules.pp*
   - Add: *import 'modules'* to */etc/puppet/manifests/site.pp*
   - #* cp /etc/group /etc/puppet/modules/jb_test/files/group_test*
   - Create *jb_config.pp:**/etc/puppet/modules/jb_test/manifests/jb_config.pp
   *

# /etc/puppet/modules/jb_test/manifests/jb_config.pp

*
*

   - Create* init.pp:* */etc/puppet/modules/jb_test/manifests/init.pp*

# /etc/puppet/modules/jb_test/manifests/init.pp

   - Modify *nodes.pp: **/etc/puppet/manifests/nodes.pp**
   *

node 'vm-jeeva2' inherits jeeva_base {

>     include cp_jboss_conf
> }

*On the puppet-agent:
*

   - # *mkdir -p /opt/jboss_{1,3}*
   - # *puppetd --test**
   *

If every thing goes right (and I didn't miss anything down the line), you
see these things on the agent(s):

   1. */opt/j_config* is created (if already not there)
   2. The file:* group_test* is copied in the */opt/j_config*
   3. A symbolic-link: *group_test -> /opt/j_config/group_test* is created
   in each */opt/jboss_{1,3}*

*
*I think, that's what you basically asked for. The only difference is the
symbolic-link (as opposed to the "copy") in this setup. In stead of the
sysm-link, you can first copy the file to the */root* (or somewhere secure,
if */tmp* is a security issue for the configuration file) and then copy the
file from */root* to */opt/jboss_{1,2,3}*, whichever is available.
Does it work for you? cheers!!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wil Cooley  
View profile  
 More options Apr 15 2012, 8:34 pm
From: Wil Cooley <wilcoo...@gmail.com>
Date: Sun, 15 Apr 2012 17:34:31 -0700 (PDT)
Local: Sun, Apr 15 2012 8:34 pm
Subject: Re: Need puppet module for condition copy
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

...

Where is the class dev_jboss_jeeva defined? You mentioned above an
'init.pp', which would be usual if you were using modules, but it does
not seem like you are using modules.

It sounds like the problem you are having is wholly outside of the
complicated machinations of what you're trying to do. It looks more
like you have a much simpler class-loading problem.

Here are a few things to try:
  * Comment out all of the stuff from dev_jboss_jeeva and replace it
with a "warning" function call, to log that everything is working
right:
  class dev_jboss_jeeva {
    warning("dev_jboss_jeeva has successfully loaded")
  }
  * Copy your class dev_jboss_jeeva { ... } right before the "node
jeeva_base" and see if you see your warning message (I suggest warning
instead of info because info sometimes requires using --verbose on the
command line; warning will always show):
  class dev_jboss_jeeva {
    warning("dev_jboss_jeeva was here")
  }
  node jeeva_base {
    include dev_jboss_jeeva
  }

If you see the message with the class defined right before the node,
but not wherever else you have it, then you know the problem is that
it is unable to actually find the class and you should give specifics
about that instead.

Wil


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sans  
View profile  
 More options Apr 16 2012, 6:36 am
From: Sans <r.santanu....@gmail.com>
Date: Mon, 16 Apr 2012 03:36:54 -0700 (PDT)
Local: Mon, Apr 16 2012 6:36 am
Subject: Re: Need puppet module for condition copy

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!!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 16 2012, 6:54 am
From: Munna S <19.mu...@gmail.com>
Date: Mon, 16 Apr 2012 05:54:00 -0500
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 16 2012, 8:06 am
From: Munna S <19.mu...@gmail.com>
Date: Mon, 16 Apr 2012 07:06:59 -0500
Local: Mon, Apr 16 2012 8:06 am
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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 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 pil-vm-pup-01 puppet-master[8092]:
(//vm-jeeva2.aircell.prod/Puppet) Could not retrieve catalog from remote
server: Error 400 on SERVER: 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 pil-vm-pup-01 puppet-master[8092]:
(//vm-jeeva2.aircell.prod/Puppet) Using cached catalog
Apr 16 11:29:39 pil-vm-pup-01 puppet-master[8092]:
(//vm-jeeva2.aircell.prod/Puppet) Could not retrieve catalog; skipping run

@All, Just not to confuse anyone, currently my puppet server is working as
expected. i have lot of modules created and it works. This is how my
configuration is

1 ) my site.pp file is under /etc/puppet/manifest/site.pp and below is my
content
import 'nodes/*'
$puppetserver = 'puppet-server.domain.com'

2) All my modules is under below path

/etc/puppet/modules/

3) under below path i have all my .pp files . eg

/etc/puppet/manifests/nodes/server1.pp
/etc/puppet/manifests/nodes/server2.pp
/etc/puppet/manifests/nodes/server3.pp
/etc/puppet/manifests/nodes/server4.pp

 addition to this i have a jeeva_base.pp file where i include all my
modules. below is the portion of its content
-----------------------------------
node jeeva_base {
         include all_scripts
        include dev_jboss_jeeva
        }
---------------------------------------
below is the content of my server1.pp file . i have created individual .pp
file for each server which inherits jeeva_base node.
------------------------------------------
node server1 inherits jeeva_base {

}

-------------------------------------------

As i said above, this is my requirement.

we have 3 version of jboss running in our environment in different servers.
eg. jboss4 in server1, jboss5 in server2 , jboss6 in server3 , and no jboss
in server 4 , etc

on each server, jboss config file sits under different path.
eg: in server 1 it sits under /opt/jboss4/
      in server 2 it sits under /opt/jboss5/
      in server 3 it sits under /opt/jboss6/
      in server 4 no jboss is running

now i have 3 different configuration file for each version of jboss which i
need to replace. eg.
 file1,  i need to replace it to jboss4
file2 , i need to replace it to jboss5
file3 , i need to replace it to jboss6
also we need to keep in mind that it should not create a files/folder on
server4 which doesnt have jboss.

Now i need a module which checks the jboss path on each server and should
replace the sepcific file if it finds the specific path. eg

if it finds /opt/jboss4, then it should replace file1, if it finds
/opt/jboss5, then replace file2 and so on. But if no jboss path is found
then dont perform any thing on that server.

As suggested by Gary ( initial conversation) , gary helped me to create the
custom facts. but it didnt work. Not sure what went wrong.
in general, my requirement is very simple. just do a check on each server
for specific path. if found, then copy/replace respective file , if not
found then dont perform any action on that server.
I hope i didnt confuse anyone.

Thanks,
Jeeva


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sans  
View profile  
 More options Apr 16 2012, 8:38 am
From: Sans <r.santanu....@gmail.com>
Date: Mon, 16 Apr 2012 05:38:03 -0700 (PDT)
Local: Mon, Apr 16 2012 8:38 am
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

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:* /etc/puppet/modules/jb_test/manifests/jb_config.pp*
   4. The file:* /etc/puppet/modules/jb_test/manifests/init_config.pp*
   5. The file:* /etc/puppet/modules/jb_test/files/group_test*
   6. and finally, in the */etc/puppet/manifests/nodes.pp*

node 'vm-jeeva2' {

>     include cp_jboss_conf
> }

(don't add inherits jeeva_base for the time being)

Cheers!!

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Munna S  
View profile  
 More options Apr 16 2012, 8:59 am
From: Munna S <19.mu...@gmail.com>
Date: Mon, 16 Apr 2012 07:59:25 -0500
Local: Mon, Apr 16 2012 8:59 am
Subject: Re: [Puppet Users] Re: Need puppet module for condition copy

   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 dont have modules.pp file. But as i said in my previous email, i
   have customised servername.pp siles
   *
   3. The file:* /etc/puppet/modules/jb_test/manifests/jb_config.pp
   - i created this file
   *
   4. The file:* /etc/puppet/modules/jb_test/manifests/init_config.pp
   - i created this file
   *
   5. The file:* /etc/puppet/modules/jb_test/files/group_test
   - i have this file*
   6. and finally, in the */etc/puppet/manifests/nodes.pp
   - I dont have this file in my configuration*

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 27   Newer >
« Back to Discussions « Newer topic     Older topic »