Hi,

there's a number of problems with your approach. Have you done any
simple deployment tasks using puppet to get you started? I advise to get
very familiar with the basics before trying a more involved management
operation such as newrelic installation.

On 03/04/2013 08:22 AM, guptasachin1112...@gmail.com wrote:
> I had installed puppet master and client on two different machines.
> machine A has puppet master and machine B has client. both are centos6
> 64 bit machines.
> Machine B (client) is successfully connected to master (machine A). My
> aim is to install New Relic agent (server monitorinig tool) on different
> clients. I had installed new relic agent on machine A and trying to
> build a module so that I can deploy new relic agent remotely to my
> clients. right now I have only one client but there can be n number of
> clients.

This is fine so far.

> steps carried out on puppetmaster Machine A
> 
> a) I had created a new module mcollective under /etc/puppet/modules
> directory.

Why is the module called mcollective? Should it not be called newrelic
instead?

>  under manifests, I had created a init.pp with the follwoing contents
> 
> #Module: mcollective
> #
> # Class: mcollective
> # Description:
> # This class does it all.
> #
> # Files:
> # /etc/yum.repos.d/newrelic.repo
> #
> #
> class mcollective {
> $my_repo = 'newrelic_repo'
>  if $my_repo { include "mcollective::${my_repo}" }
> $my_install = 'install'
>  if $my_install { include "mcollective::${my_install}" }
> }

Putting the class names into variables does not strike me as really
benefitting. And it does break the KISS principle.

> class mcollective::newrelic_repo {
> file { '/etc/yum.repos.d/newrelic.repo':
>  owner => "root",
>  group => "root",
>  mode => 644,
>  source => 'puppet:///modules/mcollective/newrelic.repo',
> }
> }

That's all right.

> class mcollective::install {
> exec { 'Installing newrelic-repo':
>  command => 'yum -y install newrelic-repo*',
>  timeout => 600,
>  }
> }

With puppet, you should use exec as little as possible. Instead, try

package { "newrelic-sysmond": ensure => installed }

This won't work until the repo has been created, so tell puppet about
the order:

package { "newrelic-sysmond":
  ensure => installed,
  require => Class["newrelic::repo"],
}

> b)  I had also copied newrelic.repo from /etc/yum.repos.d/newrelic.repo
> to /etc/puppet/modules/manifests

This won't work. If you want to make a file available using file { name:
source => ... }, it needs to be put into an appropriate files tree, such
as /etc/puppet/modules/newrelic/files/...

> c) under files diretcory, I had created sites.pp as

Now this one should be under manifests!

> import 'mcollective'

Importing modules is deprecated. I advise to not even bother with the
import statement.

> node 'basenode' {
> include mcollective
> include mcollective::newrelic_repo
> include mcollective::install
> }

That's fine.

> node 'WA19487ORACLE01' inherits basenode {
> license_key => 'd15ff577e5f27e071fe9b2d6809b9f2950fe87d1',

!!! Please get a new license key. You just shared your key with the
internet. !!!

> }
> d)  here I have called module and passed the license_key for the node.

No. No, you haven't.

For one thing, the above is a syntax error. In a node block, there can
only be resource declarations such as

include newrelic
host { "localhost": ... }
file { "/etc/motd": ... }

etc.

I think what you are thinking of is a construct such as this:

node 'WA19487ORACLE01' inherits basenode {
  class { "newrelic::install":
    license_key => "...";
  }
}

> e) I had restarted my puppetmaster(machine A) and puppet (machine B).
> when I checked /varlog/messages/ of machine A and machine B, new reliec
> agent is not getting deployed on machine B (clinet).

When developing puppet manifest, use these commands on your client node:

puppet agent --test --noop

If the output is satisfactory, follow that up with

puppet agent --test

to make puppet apply the necessary changes.

> f)  my client is not able to retervie the catalog from puppet master. it
> throws following error  when i run puppet agent --test on clinet I am
> getting the result as
> [root@WA19487ORACLE01 ~]# puppet agent --test
> notice: Ignoring --listen on onetime run
> info: Retrieving plugin
> err: /File[/var/lib/puppet/lib]: Failed to generate additional resources
> using 'eval_generate': hostname was not match with the server certificate
> err: /File[/var/lib/puppet/lib]: Could not evaluate: hostname was not
> match with the server certificate Could not retrieve file metadata for
> puppet://WA19487PUPPET01/plugins: hostname was not match with the server
> certificate
> err: Could not retrieve catalog from remote server: hostname was not
> match with the server certificate
> warning: Not using cache on failed catalog
> err: Could not retrieve catalog; skipping run
> Time:
>          Last run: 1362381429
> err: Could not send report: hostname was not match with the server
> certificate
> please post your suggestions to help me out.

What is in your /etc/puppet/puppet.conf on the client node?

What is your master node's FQDN and what is the CN of its certificate?

Regards,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to