[Puppet Users] catalog run time? what about facter run time?

2011-07-07 Thread vagn scott


The catalog run time that is reported: does that include the facter run 
time?

If not, how should I get that?  What kind of performance statistics does
puppet/facter keep, if any, and how do I access them?  Is there a FM I 
should R?


--
Thanks,
vagn

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



Re: [Puppet Users] Dynamic including in templates

2011-07-07 Thread Jonathan Gazeley

Hi James,

Thanks very much - this worked. As a side effect, I learned a little 
about how ruby works, too. I'd just like to add that the puppet-users 
list is one of the more friendly and helpful lists I subscribe to :)


Cheers,
Jonathan


On 07/06/2011 04:47 PM, James Fryman wrote:

Hi Jonathan.

You should be able to use a similar syntax as illustrated below. For instance…

% if scope.lookupvar('dhcp::includernw') == 1 %  include 
/etc/dhcp/dhcpd.rnw;% end %

% is a marker for ruby code, whereas%= is actually a ruby expression that 
outputs the result of a value or expression.

Hope that helps!

-James



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



[Puppet Users] Problems with the use of custom types

2011-07-07 Thread JohnW
I am trying to make use of a custom type mentioned in the wiki page
http://projects.puppetlabs.com/projects/1/wiki/Sysctl_Patterns

I created the module sysctl, inserted the custom type in there and
created a simple manifest to make use of the introduced type.

I add the module to a client and start a puppetrun there.
I see the custom type being synced, but after that I get the error,
that the used type is unknown:

puppetd -t
info: Retrieving plugin
notice: /File[/var/lib/puppet/lib/puppet]/ensure: created
notice: /File[/var/lib/puppet/lib/puppet/provider]/ensure: created
notice: /File[/var/lib/puppet/lib/puppet/provider/sysctl]/ensure:
created
notice: /File[/var/lib/puppet/lib/puppet/provider/sysctl/parsed.rb]/
ensure: defined content as '{md5}f1ad6c1cd610b6fe33fcd245759c09d1'
notice: /File[/var/lib/puppet/lib/puppet/type]/ensure: created
notice: /File[/var/lib/puppet/lib/puppet/type/sysctl.rb]/ensure:
defined content as '{md5}65fe3deaf4e245b7a5f031dac3d73f4d'
info: Loading downloaded plugin /var/lib/puppet/lib/puppet/provider/
sysctl/parsed.rb
info: Loading downloaded plugin /var/lib/puppet/lib/puppet/type/
sysctl.rb
info: Redefining sysctl in Puppet::Type
info: Loading facts in proxyinfo
info: Loading facts in sapcheck
info: Loading facts in servicepack
info: Loading facts in proxyinfo
info: Loading facts in sapcheck
info: Loading facts in servicepack
err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
Invalid resource type sysctl at /etc/puppet/development/modules/sysctl/
manifests/init.pp:4 on node myhost
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run


My manifest is this:cat manifests/init.pp
class sysctl {
sysctl {
kernel.shmni: val   = 4096;
}
}

I am using puppet version 2.6.7 on master and client

It seems to me, that the path where de custom type has been placed
isn't checked, then again, the used type might just not work on my
version of puppet.
I checked the docs on custom types and plugins in modules , but
i'm a bit at a loss right now.

can someone point me in the right direction?

thx

John

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



Re: [Puppet Users] Problems with the use of custom types

2011-07-07 Thread Ken Barber
If its a pure ruby provider, try running something like 'puppet agent
-t --pluginsync' on the server first, so it gets synced there. Then
try your client again.

The problem is your server isn't scanning your modulepath for types
... its expecting types to be in its own libdir first. Hence why an
pluginsync is needed ...

ken.

On Thu, Jul 7, 2011 at 12:18 PM, JohnW boerma@gmail.com wrote:
 I am trying to make use of a custom type mentioned in the wiki page
 http://projects.puppetlabs.com/projects/1/wiki/Sysctl_Patterns

 I created the module sysctl, inserted the custom type in there and
 created a simple manifest to make use of the introduced type.

 I add the module to a client and start a puppetrun there.
 I see the custom type being synced, but after that I get the error,
 that the used type is unknown:

 puppetd -t
 info: Retrieving plugin
 notice: /File[/var/lib/puppet/lib/puppet]/ensure: created
 notice: /File[/var/lib/puppet/lib/puppet/provider]/ensure: created
 notice: /File[/var/lib/puppet/lib/puppet/provider/sysctl]/ensure:
 created
 notice: /File[/var/lib/puppet/lib/puppet/provider/sysctl/parsed.rb]/
 ensure: defined content as '{md5}f1ad6c1cd610b6fe33fcd245759c09d1'
 notice: /File[/var/lib/puppet/lib/puppet/type]/ensure: created
 notice: /File[/var/lib/puppet/lib/puppet/type/sysctl.rb]/ensure:
 defined content as '{md5}65fe3deaf4e245b7a5f031dac3d73f4d'
 info: Loading downloaded plugin /var/lib/puppet/lib/puppet/provider/
 sysctl/parsed.rb
 info: Loading downloaded plugin /var/lib/puppet/lib/puppet/type/
 sysctl.rb
 info: Redefining sysctl in Puppet::Type
 info: Loading facts in proxyinfo
 info: Loading facts in sapcheck
 info: Loading facts in servicepack
 info: Loading facts in proxyinfo
 info: Loading facts in sapcheck
 info: Loading facts in servicepack
 err: Could not retrieve catalog from remote server: Error 400 on
 SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
 Invalid resource type sysctl at /etc/puppet/development/modules/sysctl/
 manifests/init.pp:4 on node myhost
 warning: Not using cache on failed catalog
 err: Could not retrieve catalog; skipping run


 My manifest is this:cat manifests/init.pp
 class sysctl {
        sysctl {
                kernel.shmni: val   = 4096;
        }
 }

 I am using puppet version 2.6.7 on master and client

 It seems to me, that the path where de custom type has been placed
 isn't checked, then again, the used type might just not work on my
 version of puppet.
 I checked the docs on custom types and plugins in modules , but
 i'm a bit at a loss right now.

 can someone point me in the right direction?

 thx

 John

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



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



[Puppet Users] Re: Problems with the use of custom types

2011-07-07 Thread JohnW
Thanks Ken

That did the trick.

I was afraid I had to reinvent a wheel here, as I was a bit on a
deadline

John


On Jul 7, 2:50 pm, Ken Barber k...@puppetlabs.com wrote:
 If its a pure ruby provider, try running something like 'puppet agent
 -t --pluginsync' on the server first, so it gets synced there. Then
 try your client again.

 The problem is your server isn't scanning your modulepath for types
 ... its expecting types to be in its own libdir first. Hence why an
 pluginsync is needed ...

 ken.

 On Thu, Jul 7, 2011 at 12:18 PM, JohnW boerma@gmail.com wrote:
  I am trying to make use of a custom type mentioned in the wiki page
 http://projects.puppetlabs.com/projects/1/wiki/Sysctl_Patterns

  I created the module sysctl, inserted the custom type in there and
  created a simple manifest to make use of the introduced type.

  I add the module to a client and start a puppetrun there.
  I see the custom type being synced, but after that I get the error,
  that the used type is unknown:

  puppetd -t
  info: Retrieving plugin
  notice: /File[/var/lib/puppet/lib/puppet]/ensure: created
  notice: /File[/var/lib/puppet/lib/puppet/provider]/ensure: created
  notice: /File[/var/lib/puppet/lib/puppet/provider/sysctl]/ensure:
  created
  notice: /File[/var/lib/puppet/lib/puppet/provider/sysctl/parsed.rb]/
  ensure: defined content as '{md5}f1ad6c1cd610b6fe33fcd245759c09d1'
  notice: /File[/var/lib/puppet/lib/puppet/type]/ensure: created
  notice: /File[/var/lib/puppet/lib/puppet/type/sysctl.rb]/ensure:
  defined content as '{md5}65fe3deaf4e245b7a5f031dac3d73f4d'
  info: Loading downloaded plugin /var/lib/puppet/lib/puppet/provider/
  sysctl/parsed.rb
  info: Loading downloaded plugin /var/lib/puppet/lib/puppet/type/
  sysctl.rb
  info: Redefining sysctl in Puppet::Type
  info: Loading facts in proxyinfo
  info: Loading facts in sapcheck
  info: Loading facts in servicepack
  info: Loading facts in proxyinfo
  info: Loading facts in sapcheck
  info: Loading facts in servicepack
  err: Could not retrieve catalog from remote server: Error 400 on
  SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
  Invalid resource type sysctl at /etc/puppet/development/modules/sysctl/
  manifests/init.pp:4 on node myhost
  warning: Not using cache on failed catalog
  err: Could not retrieve catalog; skipping run

  My manifest is this:cat manifests/init.pp
  class sysctl {
         sysctl {
                 kernel.shmni: val   = 4096;
         }
  }

  I am using puppet version 2.6.7 on master and client

  It seems to me, that the path where de custom type has been placed
  isn't checked, then again, the used type might just not work on my
  version of puppet.
  I checked the docs on custom types and plugins in modules , but
  i'm a bit at a loss right now.

  can someone point me in the right direction?

  thx

  John

  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/puppet-users?hl=en.

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



Re: [Puppet Users] Re: Problems with the use of custom types

2011-07-07 Thread Ken Barber
The issue I think is here:

http://projects.puppetlabs.com/issues/4409

But this is to do with 2.6+ and environments specifically.

If you're running an older puppet and a single environment, I believe
this issue should been resolved by upgrading to 2.6+ - but I'm not
100% sure, so perhaps someone can correct me on that.

ken.

On Thu, Jul 7, 2011 at 2:31 PM, JohnW boerma@gmail.com wrote:
 Thanks Ken

 That did the trick.

 I was afraid I had to reinvent a wheel here, as I was a bit on a
 deadline

 John


 On Jul 7, 2:50 pm, Ken Barber k...@puppetlabs.com wrote:
 If its a pure ruby provider, try running something like 'puppet agent
 -t --pluginsync' on the server first, so it gets synced there. Then
 try your client again.

 The problem is your server isn't scanning your modulepath for types
 ... its expecting types to be in its own libdir first. Hence why an
 pluginsync is needed ...

 ken.

 On Thu, Jul 7, 2011 at 12:18 PM, JohnW boerma@gmail.com wrote:
  I am trying to make use of a custom type mentioned in the wiki page
 http://projects.puppetlabs.com/projects/1/wiki/Sysctl_Patterns

  I created the module sysctl, inserted the custom type in there and
  created a simple manifest to make use of the introduced type.

  I add the module to a client and start a puppetrun there.
  I see the custom type being synced, but after that I get the error,
  that the used type is unknown:

  puppetd -t
  info: Retrieving plugin
  notice: /File[/var/lib/puppet/lib/puppet]/ensure: created
  notice: /File[/var/lib/puppet/lib/puppet/provider]/ensure: created
  notice: /File[/var/lib/puppet/lib/puppet/provider/sysctl]/ensure:
  created
  notice: /File[/var/lib/puppet/lib/puppet/provider/sysctl/parsed.rb]/
  ensure: defined content as '{md5}f1ad6c1cd610b6fe33fcd245759c09d1'
  notice: /File[/var/lib/puppet/lib/puppet/type]/ensure: created
  notice: /File[/var/lib/puppet/lib/puppet/type/sysctl.rb]/ensure:
  defined content as '{md5}65fe3deaf4e245b7a5f031dac3d73f4d'
  info: Loading downloaded plugin /var/lib/puppet/lib/puppet/provider/
  sysctl/parsed.rb
  info: Loading downloaded plugin /var/lib/puppet/lib/puppet/type/
  sysctl.rb
  info: Redefining sysctl in Puppet::Type
  info: Loading facts in proxyinfo
  info: Loading facts in sapcheck
  info: Loading facts in servicepack
  info: Loading facts in proxyinfo
  info: Loading facts in sapcheck
  info: Loading facts in servicepack
  err: Could not retrieve catalog from remote server: Error 400 on
  SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
  Invalid resource type sysctl at /etc/puppet/development/modules/sysctl/
  manifests/init.pp:4 on node myhost
  warning: Not using cache on failed catalog
  err: Could not retrieve catalog; skipping run

  My manifest is this:cat manifests/init.pp
  class sysctl {
         sysctl {
                 kernel.shmni: val   = 4096;
         }
  }

  I am using puppet version 2.6.7 on master and client

  It seems to me, that the path where de custom type has been placed
  isn't checked, then again, the used type might just not work on my
  version of puppet.
  I checked the docs on custom types and plugins in modules , but
  i'm a bit at a loss right now.

  can someone point me in the right direction?

  thx

  John

  --
  You received this message because you are subscribed to the Google Groups 
  Puppet Users group.
  To post to this group, send email to puppet-users@googlegroups.com.
  To unsubscribe from this group, send email to 
  puppet-users+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/puppet-users?hl=en.

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



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



Re: [Puppet Users] Apache module for RHEL6

2011-07-07 Thread Marc Fournier
Hello,

Excerpts from Vorik's message of Tue Jul 05 10:31:54 +0200 2011:
 
 What is a good module to manage Apache on RHEL6 that is known to work?
 I want to be able to create vhosts, nothing that fancy.
 
 Currently, I'm trying camptocamp-apache. Unfortunately, the readme
 file only states how to do some authentication stuff.

Yes, I agree their README is totally useless... Shame on them ;-)

You'll find more useful documentation running puppetdoc against this
module (or reading the comments in the manifest files).

 Configuration (found at the camptocamp-tomcat plugin)
 ---%---
 class webserver_base {
 
 package { httpd: ensure = installed }
 service { httpd: ensure = running }
 
 apache::vhost {www.dus123camptocamp.nl:
   ensure = present,
 }
 
 }
 ---%---
 
 It fails with this error:
 ---%---
 err: Could not run Puppet configuration client: Could not find
 dependency File[/usr/local/sbin/a2ensite] for Exec[enable vhost
 www.dus123camptocamp.nl] at /etc/puppet/modules/apache/manifests/
 definitions/vhost.pp:251
 ---%---

If you try something like:
---%---

class webserver_base {

include apache

apache::vhost {www.dus123camptocamp.nl:
  ensure = present,
}
}
---%---

... you should have a much more pleasant experience.

If you take a peep into apache/manifests/init.pp you'll see that the
apache class includes other classes based on which distribution you
are running. As we have both RHEL and Debian servers, we have made quite
an effort to make this module abstract away the distribution specific
bits (paths and so). You should be able to use it on RHEL without any
hassle.

We have modified this module to add support for RHEL6 a couple of months
ago. Please be sure to use a recent checkout:
https://github.com/camptocamp/puppet-apache

Cheers,
Marc

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



Re: [Puppet Users] AIX clients

2011-07-07 Thread Rob McBroom
On Jul 6, 2011, at 5:39 PM, Michael Stahnke wrote:

 I had Ruby with SSL working on AIX 5.x and 6.x at my last job. Let me
 see if I can find my notes about building ruby, and maybe I'll be able
 to help out some.

I’d appreciate it. Thanks.

-- 
Rob McBroom
http://www.skurfer.com/


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



[Puppet Users] Checking for free disk space on mountpoint?

2011-07-07 Thread Victor Hooi
Hi,

I'm currently looking at migrating from some home-rolled Python scripts to 
using Puppet =).

One of the things we need to check for is that there is sufficient free disk 
space on a mountpoint (for logging etc.) this is currently quite easy in 
Python using statvfs().

Are there any resources in Puppet that might be able to do this? I checked 
the mount type 
(http://docs.puppetlabs.com/references/stable/type.html#mount), but it 
didn't seem to have anything to do this.

Cheers,
Victor

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/lE1ahe-Z5KoJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] $pdprop doesnt work with folder?

2011-07-07 Thread Sriram Nyshadham
 Hi,

Could someone please confirm if the following works or not?

file {
'/usr/lib64/nagios/plugins/tomcat':
  ensure = directory,
  ignore = '.svn',
  recurse = true,
  recurselimit = 1,
  owner = sega, group = sega, mode = 755,
  source  = [
 'puppet:///modules/nrpe/plugins/tomcat-$pdprop',
 #'puppet:///modules/nrpe/plugins/tomcat'
   ];


When use this code, I am getting the following error on client:

err: //nrpe::tomcat/File[/usr/lib64/nagios/plugins/tomcat]: Failed to
retrieve current state of resource: Could not retrieve information from
source(s) puppet:///modules/nrpe/plugins/tomcat-$pdprop at
/home/snyshadham/puppet/modules/nrpe/manifests/init.pp:154

It works when I use it for a single file.

Any help would be greatly appreciated.


Thanks,
Sri

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



[Puppet Users] Passing variables between stages

2011-07-07 Thread Chip Schweiss
I'm looking for a method to access a variable set in my main state from a
class in my post stage?

Is this possible?  Any know way of passing the information?

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



[Puppet Users] Re: $pdprop doesnt work with folder?

2011-07-07 Thread Luke Bigum
Your variable $pdprop is not being expanded as a variable as you've
got the string enclosed in single quotes ''.

Try:

source  = puppet:///modules/nrpe/plugins/tomcat-$pdprop

-Luke

On Jul 7, 1:51 pm, Sriram Nyshadham nyshadhamsri...@gmail.com wrote:
  Hi,

 Could someone please confirm if the following works or not?

 file {
     '/usr/lib64/nagios/plugins/tomcat':
       ensure = directory,
       ignore = '.svn',
       recurse = true,
       recurselimit = 1,
       owner = sega, group = sega, mode = 755,
       source  = [
          'puppet:///modules/nrpe/plugins/tomcat-$pdprop',
          #'puppet:///modules/nrpe/plugins/tomcat'
            ];

 When use this code, I am getting the following error on client:

 err: //nrpe::tomcat/File[/usr/lib64/nagios/plugins/tomcat]: Failed to
 retrieve current state of resource: Could not retrieve information from
 source(s) puppet:///modules/nrpe/plugins/tomcat-$pdprop at
 /home/snyshadham/puppet/modules/nrpe/manifests/init.pp:154

 It works when I use it for a single file.

 Any help would be greatly appreciated.

 Thanks,
 Sri

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



Re: [Puppet Users] Checking for free disk space on mountpoint?

2011-07-07 Thread Ken Barber
Let me understand this correctly - you want to use the Puppet RAL
layer to interrogate data such as free space on a mount?

At the moment you can't use RAL data elsewhere in Puppet content ...
but you can use the RAL layer in your own code and in things like
MCollective using the ralsh plugin ...

Perhaps you're after facts?

http://docs.puppetlabs.com/guides/custom_facts.html

Excuse me if my understanding of your needs is completely out of whack
:-). Maybe you want to describe what you want to do with this data
once you have gathered it.

ken.

On Thu, Jul 7, 2011 at 4:34 AM, Victor Hooi victorh...@gmail.com wrote:
 Hi,
 I'm currently looking at migrating from some home-rolled Python scripts to
 using Puppet =).
 One of the things we need to check for is that there is sufficient free disk
 space on a mountpoint (for logging etc.) this is currently quite easy in
 Python using statvfs().
 Are there any resources in Puppet that might be able to do this? I checked
 the mount type
 (http://docs.puppetlabs.com/references/stable/type.html#mount), but it
 didn't seem to have anything to do this.
 Cheers,
 Victor

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/puppet-users/-/lE1ahe-Z5KoJ.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.


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



Re: [Puppet Users] catalog run time? what about facter run time?

2011-07-07 Thread James Turnbull

vagn scott wrote:


The catalog run time that is reported: does that include the facter run
time?
If not, how should I get that? What kind of performance statistics does
puppet/facter keep, if any, and how do I access them? Is there a FM I
should R?




It doesn't include the Facter runtime  but you can output performance 
data from Facter by running it with the --timing switch on the command line.


As to other statistics - there are a number in reports that you can 
access.  See 
http://projects.puppetlabs.com/projects/puppet/wiki/Report_Format_2.


Regards

James Turnbull

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



[Puppet Users] Testing if a puppet class is going to be installed

2011-07-07 Thread Keith Minkler
In a bunch of my templates and manifests, I need to have logic which
depends on whether or not a particular (other) puppet class is going
to be installed on the machine.

For example, for setting up the proper nagios monitors, you'd want to
say something like if this machine has the apache class, then
configure apache monitoring  It's not feasible I think to put this
logic in the apache class, since you'd have to have a way to build
up the nagios config file from parts contained in many classes which
sometimes are installed together.

Is there a function I can call, or could you provide some advice on
how to approach writing such a function, which will tell me that the
machine the catalog is being compiled for also has a particular class
as part of the catalog?

Currently, I'm stuck writing templates and manifests which have a lot
of if the hostname matches this regex, or if the fqdn matches this
regex...  since classes are applied by fqdn ultimately, however, this
is growing unmanageable as we're moving to a more dynamic system of
creating machines and assigning more arbitrary names to machines using
an external nodes store...

Without this feature, we're still stuck in many cases having to commit
changes to the puppet repository when we make machines and can't make
the jump to being fully automated machine creation with arbitrary host
names.  Additionally, IMO, it makes it very difficult to understand
many manifests and templates with all the special casing for machine
names, instead of asking about installed classes.

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



Re: [Puppet Users] Testing if a puppet class is going to be installed

2011-07-07 Thread Ken Barber
'defined' might be what you are after ... something like:

class foo {
}

class { foo:
}

if defined(Class[foo]) {
  notice(foo is defined)
} else {
  notice(foo is not defined)
}

When you comment out the class { foo: } then the expression results
in a negative.

ken.

On Thu, Jul 7, 2011 at 5:26 PM, Keith Minkler kmink...@gmail.com wrote:
 In a bunch of my templates and manifests, I need to have logic which
 depends on whether or not a particular (other) puppet class is going
 to be installed on the machine.

 For example, for setting up the proper nagios monitors, you'd want to
 say something like if this machine has the apache class, then
 configure apache monitoring  It's not feasible I think to put this
 logic in the apache class, since you'd have to have a way to build
 up the nagios config file from parts contained in many classes which
 sometimes are installed together.

 Is there a function I can call, or could you provide some advice on
 how to approach writing such a function, which will tell me that the
 machine the catalog is being compiled for also has a particular class
 as part of the catalog?

 Currently, I'm stuck writing templates and manifests which have a lot
 of if the hostname matches this regex, or if the fqdn matches this
 regex...  since classes are applied by fqdn ultimately, however, this
 is growing unmanageable as we're moving to a more dynamic system of
 creating machines and assigning more arbitrary names to machines using
 an external nodes store...

 Without this feature, we're still stuck in many cases having to commit
 changes to the puppet repository when we make machines and can't make
 the jump to being fully automated machine creation with arbitrary host
 names.  Additionally, IMO, it makes it very difficult to understand
 many manifests and templates with all the special casing for machine
 names, instead of asking about installed classes.

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



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



[Puppet Users] Re: Testing if a puppet class is going to be installed

2011-07-07 Thread Luke Bigum
Hi Keith,

On Jul 7, 5:26 pm, Keith Minkler kmink...@gmail.com wrote:
 In a bunch of my templates and manifests, I need to have logic which
 depends on whether or not a particular (other) puppet class is going
 to be installed on the machine.

This use case comes up a lot. There are some functions but
historically they have not been reliable due to Puppet's random parse
order for resources and classes. Have a look at the tagged() function
- tests if a given tag is set, and the defined() function - tests
whether a resource/class has been defined or not (not the same as
tagged).

With the latest versions of Puppet coming out though I remember
reading that one of the focuses was to make Puppet's parse order
static rather than random, so it makes the use of these functions a
little more friendly. You could always try use run stages too.

 For example, for setting up the proper nagios monitors, you'd want to
 say something like if this machine has the apache class, then
 configure apache monitoring  It's not feasible I think to put this
 logic in the apache class, since you'd have to have a way to build
 up the nagios config file from parts contained in many classes which
 sometimes are installed together.

Example42 put monitoring into their service oriented classes, like
apache::monitor, take a look at how it works there:

https://github.com/example42/puppet-modules/blob/master/apache/manifests/monitor.pp

If all your classes define their own monitoring requirements you can
then use some other module to bring everything together for your
monitoring solution.

Another alternative is to use stored configs and write something to
query the resources on each node and build the monitoring
configuration yourself. The most amount of work but the most flexible.

 Is there a function I can call, or could you provide some advice on
 how to approach writing such a function, which will tell me that the
 machine the catalog is being compiled for also has a particular class
 as part of the catalog?

One dodgy way would be to parse /var/lib/puppet/classes.txt, however
that would only capture classes for the previous run.

Since all classes are known at the time that the catalog begins to
be apply, there might be some snippet of Ruby you could use to query
what classes are set and use that in a module too, but that's one for
the Ruby devs.

 Currently, I'm stuck writing templates and manifests which have a lot
 of if the hostname matches this regex, or if the fqdn matches this
 regex...  since classes are applied by fqdn ultimately, however, this
 is growing unmanageable as we're moving to a more dynamic system of
 creating machines and assigning more arbitrary names to machines using
 an external nodes store...

If you're using an ENC to classify your nodes, don't you then know
what services are on each node there, and so could then get an idea of
what you need to monitor from your ENC and not your Puppet catalogs?

 Without this feature, we're still stuck in many cases having to commit
 changes to the puppet repository when we make machines and can't make
 the jump to being fully automated machine creation with arbitrary host
 names.  Additionally, IMO, it makes it very difficult to understand
 many manifests and templates with all the special casing for machine
 names, instead of asking about installed classes.

Hope that helps a bit,

-Luke

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



[Puppet Users] Open Source Team iteration planning summary 2011-07-06

2011-07-07 Thread Jacob Helwig
Sorry for the long delay in sending these out.  For the last few weeks
we've had an unusually high number of people out due to vacations and
conferences, with the rest helping to meet a project deadline.  Now
that we're back to full strength we're ready to dive back into things.

There's a big shift in what our backlog looks like right now, but this
really boils down to us bumping something to the front of the queue to
take advantage of the skills of our newest team member.  Cameron
Thomas has just joined us as a contractor (we're hoping he'll decide
to join us at the end of the contract), and he brings a wealth of
experience developing for Windows (as well as plenty of experience
with Linux, and mobile development).

The current backlog is Basic Puppet agent support on Windows.
Currently this is a little nebulous, and primarily consists of things
to research.  We're planning on adding things we discover, and more
concrete work we'll be doing as sub-tasks of the meta-ticket we
currently have (#8268).  As always, please don't be shy about watching
 commenting on that ticket (or any of the sub-tickets that end up
being created).

Ready for testing backlog items:

  * #3669 - Support DNS SRV records

I'd like to thank Andrew Forgue for doing a large part of the work
on this feature, and getting the ball rolling to get this into
Puppet.

This is currently only available in a topic branch in my
repository[1], and I would definitely appreciate any and all
testing anyone cares to do with this feature.

This adds two new configuration variables:

  * use_srv_records: Will attempt to lookup SRV records for
 hostname found in srv_record (default: true)

  * srv_domain: The domain that will be queried for SRV records,
(default: $domain)

If use_srv_records is set to true, then Puppet will attempt to
find the list of servers to use from SRV records on the domain
specified via srv_domain.  The CA, report, and file servers can
all be specified via independent SRV records from the SRV records
to use for looking up the catalog server.

The SRV records must be for hosts in the form:

  _x-puppet._tcp.$srv_domain
  _x-puppet-ca._tcp.$srv_domain
  _x-puppet-report._tcp.$srv_domain
  _x-puppet-fileserver._tcp.$srv_domain

If no records are found for the _x-puppet-ca, _x-puppet-report, or
_x-puppet-fileserver services , then the SRV records for the
_x-puppet service.  However, if records exist for any of the more
specific services, Puppet will not attempt to use the _x-puppet
service to find an applicable server.

If Puppet is unable to connect to any of the servers specified in
the SRV records, then it will attempt to connect to the normal
servers settable via puppet.conf.

[1] 
https://github.com/jhelwig/puppet/tree/ticket/master/3669-make-puppet-honor-DNS-SRV-records

-- 
Jacob Helwig


signature.asc
Description: Digital signature


[Puppet Users] Re: Checking for free disk space on mountpoint?

2011-07-07 Thread Kent
HI Victor,

You can write a simple custom Fact (leveraging the Facter library that
Puppet uses) that will run something like 'df' and parse the output.
Your puppet agents will report their disk usage, along with all the
other Facts, every time they make a Puppet run.

-Kent

On Jul 6, 8:34 pm, Victor Hooi victorh...@gmail.com wrote:
 Hi,

 I'm currently looking at migrating from some home-rolled Python scripts to
 using Puppet =).

 One of the things we need to check for is that there is sufficient free disk
 space on a mountpoint (for logging etc.) this is currently quite easy in
 Python using statvfs().

 Are there any resources in Puppet that might be able to do this? I checked
 the mount type
 (http://docs.puppetlabs.com/references/stable/type.html#mount), but it
 didn't seem to have anything to do this.

 Cheers,
 Victor

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



[Puppet Users] New to Puppet and a Query

2011-07-07 Thread Rocky
My Query is -  I have CITRIX API Scripts written in Python language
and i have a Server which provisions OS from the Template of Citrix
when users login and when more number of users login it should
autoprovision a OS from the existing template automatically and for
this i have a device for load balancing called F5 which gives me the
min and max users if the user count reaches max then i shld execute a
script to auto create the OS from template is this possible to do with
puppet is my details

based on the threshold what i set in load balancer i should be able to
auto create OS automatically without user intervention

i have a python script to autoprovision OS
but i wanted to integrate my loadbalancer threshold values and write a
script in puppet

Any help would be highly appreciable

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



Re: [Puppet Users] Re: Testing if a puppet class is going to be installed

2011-07-07 Thread Keith Minkler
Thanks Luke,

 This use case comes up a lot. There are some functions but
 historically they have not been reliable due to Puppet's random parse
 order for resources and classes.

This is the trouble I had with the defined() function, so I had given
up on it, since it was not returning in a reliable way.

 With the latest versions of Puppet coming out though I remember
 reading that one of the focuses was to make Puppet's parse order
 static rather than random, so it makes the use of these functions a
 little more friendly. You could always try use run stages too.

maybe... however this would still sort of have the same troubles as
random, if you need to test against classes which have not been
processed yet, but are still assigned to the node.

 If all your classes define their own monitoring requirements you can
 then use some other module to bring everything together for your
 monitoring solution.

If I'm understanding this correctly, this would involve custom
resource types to pull together the parts of the file, such as one for
parts of the file which all notify a things which compiles them
together.

I used the monitoring example, but there are examples of where a
simple does this server get X class would help to clean things up in
my puppet repo, I'm not sure I want to go the route of making
something like this for each of those instances, and was hoping for a
very generic solution.

 One dodgy way would be to parse /var/lib/puppet/classes.txt, however
 that would only capture classes for the previous run.

I hadn't considered this, it would have to be part of a custom fact
though, since I would need the information on the puppetmaster when
processing the catalog (the template renders also happen server side,
right?)... there is the client_yaml directories on the server though
that could provide this though...

 Since all classes are known at the time that the catalog begins to
 be apply, there might be some snippet of Ruby you could use to query
 what classes are set and use that in a module too, but that's one for
 the Ruby devs.

I'd like to explore this solution a bit more.  I've already added some
custom parser functions and custom facts, so I'm not too worried about
the ruby involved if someone could point me into a better direction
than trying to grep through the puppet code for the right hooks ;)

 If you're using an ENC to classify your nodes, don't you then know
 what services are on each node there, and so could then get an idea of
 what you need to monitor from your ENC and not your Puppet catalogs?

Yes and no... generally what's stored in the external nodes are more
high-level classes which include a bunch of other classes.  The rules
are usually against the bunch of other classes.  I may be able to
use this as a starting point though if I could generate a hierarchy of
includes (although some classes are also conditionally included).

 Hope that helps a bit,

Thanks for the response, seems like my current best option to
investigate is to see if I can use some of the internal puppet classes
to get details about the entire catalog.

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



Re: [Puppet Users] Recursive directory management

2011-07-07 Thread Nan Liu
On Thu, Jul 7, 2011 at 9:43 AM, romuald FREBAULT kurgan...@gmail.com wrote:
 Hi,

 We decide to manage all our specific crons for applications with puppet.
 As all people who creates crons does'nt have to cope with puppet syntax, the
 easier way to do that seemed to be giving them a place on the puppetmaster
 where placing their crons, and deploying those crons in /etc/cron.d on
 nodes.
 That works fine, but i can't get a cron being removed on the node when
 removed on the puppetmaster.

 I can't use purge (it would be too easy ;-) because some package install
 crons in /etc/crons.d and we don't want to remove these crons, and we don't
 want to get them handle by puppet due to errors risk in case of
 update/upgrade

 has anyone an idea of how i could have managed files removed on destnation
 when removed from source without using the entierely purge function?


Well just an idea and it's a bit hideous because I'm abusing resource
behaviors, and please give it more testing and feedback. So the
process:

deploy cron jobs with .puppet extension
touch any crontab files with puppet extentions (unless mask the Exec
so it doesn't show up in logs).
use tidy to clean up old *.puppet files.

define cronfile ($content) {
  file { /etc/cron.d/${name}.puppet:
owner   = root,
group   = root,
mode= 0400,
content = $content,
  }
  exec { update_${name}_timestamp:
command = '/bin/false',
unless  = /bin/touch /etc/cron.d/${name}.puppet,
require = File[/etc/cron.d/${name}.puppet],
before  = Tidy['/etc/cron.d'],
  }
}

tidy { /etc/cron.d:
  age = 30m,
  recurse = 1,
  matches = [*.puppet],
}

cronfile { demo:
  content = * * * * * * /bin/true,
}

Set the tidy age to something sane so it doesn't remove files you just
deployed (basically anything longer than a single puppet run), and
this won't remove any files that doesn't have *.puppet extension.
About the only thing to add is maybe ensure ntp timesync before you
start touching any files. If you use cronfile custom resource it will
deploy the cronjob in the right directory with appropriate extensions.

Thanks,

Nan

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



Re: [Puppet Users] Re: Checking for free disk space on mountpoint?

2011-07-07 Thread Doug Warner
Here's my hack-y fact that adds facts for mounted partitions on linux w/ disk
used, available, and total as well as a fact for all available mounts.

-Doug

--- begin ---
mounts = []
mntpoints=`mount -t ext2,ext3,ext4,reiserfs,xfs`
mntpoints.split(/\n/).each do |m|
mount = m.split(/ /)[2]
mounts  mount
end

Facter.add(mounts) do
confine :kernel = :linux

setcode do
mounts.join(',')
end
end

mounts.each do |mount|
output = %x{df #{mount}}
output.each do |str|
dsk_size = nil
dsk_used = nil
dsk_avail = nil
if str =~ /^\S+\s+([0-9]+)\s+([0-9]+)\s+([0-9]+)\s+/
dsk_size = $1
dsk_used = $2
dsk_avail = $3
Facter.add(mount_#{mount}_size) do
setcode do
dsk_size
end
end
Facter.add(mount_#{mount}_used) do
setcode do
dsk_used
end
end
Facter.add(mount_#{mount}_avail) do
setcode do
dsk_avail
end
end
end
end
end
--- end ---

On 07/07/2011 01:53 PM, Kent wrote:
 HI Victor,
 
 You can write a simple custom Fact (leveraging the Facter library that
 Puppet uses) that will run something like 'df' and parse the output.
 Your puppet agents will report their disk usage, along with all the
 other Facts, every time they make a Puppet run.
 
 -Kent
 
 On Jul 6, 8:34 pm, Victor Hooi victorh...@gmail.com wrote:
 Hi,

 I'm currently looking at migrating from some home-rolled Python scripts to
 using Puppet =).

 One of the things we need to check for is that there is sufficient free disk
 space on a mountpoint (for logging etc.) this is currently quite easy in
 Python using statvfs().

 Are there any resources in Puppet that might be able to do this? I checked
 the mount type
 (http://docs.puppetlabs.com/references/stable/type.html#mount), but it
 didn't seem to have anything to do this.

 Cheers,
 Victor
 




signature.asc
Description: OpenPGP digital signature


[Puppet Users] A Question about mixing Puppet with other things

2011-07-07 Thread Dan White
In Pro Linux System Administration Mr. Turnbull discusses Cobbler and Puppet 
In Pro Puppet he discusses Foreman and Puppet.

Would anyone out there be willing and able to talk about the differences 
between Cobbler and Foreman as they relate to Puppet and what factors I should 
consider in choosing one of them ?

I want to use Puppet with Something-Else to manage a group of servers and 
desktops and other machines in a centralized, automated, configurable and 
repeatable fashion.  I want to be able to do operating system installations, 
patches and/or updates, and maintenance activity.

Thanks.

“Sometimes I think the surest sign that intelligent life exists elsewhere in 
the universe is that none of it has tried to contact us.”
Bill Waterson (Calvin  Hobbes)

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



Re: [Puppet Users] Re: Testing if a puppet class is going to be installed

2011-07-07 Thread Disconnect
On Thu, Jul 7, 2011 at 2:10 PM, Keith Minkler kmink...@gmail.com wrote:

 Thanks Luke,

  This use case comes up a lot. There are some functions but
  historically they have not been reliable due to Puppet's random parse
  order for resources and classes.

 This is the trouble I had with the defined() function, so I had given
 up on it, since it was not returning in a reliable way.



Tagged() tends to be more reliable but less complete. (And I think it
requires an external node classifier..?)

If the machine has 'webserver' in the yaml from the ENC, and webserver
includes apache, then in theory defined will be true for both apache and
webserver. Tagged will only be true for webserver, but thats often enough
(at least in our setup, although it is still something I am trying to get
rid of..) And it should be true every time, regardless of parsing order.

Also, you can include classes/tags in the yaml that don't exist without
causing any issues. (For example, we use a 'nomonitor' class to bypass all
the icinga modules cleanly..)

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



Re: [Puppet Users] Re: $pdprop doesnt work with folder?

2011-07-07 Thread Sriram Nyshadham
Thanks Luke. I fixed it.

On Thu, Jul 7, 2011 at 8:55 PM, Luke Bigum luke.bi...@lmax.com wrote:

 Your variable $pdprop is not being expanded as a variable as you've
 got the string enclosed in single quotes ''.

 Try:

 source  = puppet:///modules/nrpe/plugins/tomcat-$pdprop

 -Luke

 On Jul 7, 1:51 pm, Sriram Nyshadham nyshadhamsri...@gmail.com wrote:
   Hi,
 
  Could someone please confirm if the following works or not?
 
  file {
  '/usr/lib64/nagios/plugins/tomcat':
ensure = directory,
ignore = '.svn',
recurse = true,
recurselimit = 1,
owner = sega, group = sega, mode = 755,
source  = [
   'puppet:///modules/nrpe/plugins/tomcat-$pdprop',
   #'puppet:///modules/nrpe/plugins/tomcat'
 ];
 
  When use this code, I am getting the following error on client:
 
  err: //nrpe::tomcat/File[/usr/lib64/nagios/plugins/tomcat]: Failed to
  retrieve current state of resource: Could not retrieve information from
  source(s) puppet:///modules/nrpe/plugins/tomcat-$pdprop at
  /home/snyshadham/puppet/modules/nrpe/manifests/init.pp:154
 
  It works when I use it for a single file.
 
  Any help would be greatly appreciated.
 
  Thanks,
  Sri

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



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



[Puppet Users] Custom fact does not show up in puppet run

2011-07-07 Thread filsdepatrick
I am trying to make my first custom fact work following (I think) the
instructions given on puppetlabs.com and in 'Pro Puppet'.

Although I can evaluate my fact using facter from the cli, it doesn't
expand the fact from the variable name in my manifest.

The os, puppet version and facter version are the same on both my
client and the server:

[root@vm-ops001-1 facter]# facter -v
1.5.9

[root@vm-ops001-1 facter]# puppet --version
2.6.4

The factpath is default on both client and server, and pluginsync is
set to true in the [main] section of puppet.conf on both client and
server.

[root@vm-ops001-1 facter]# puppet --genconfig | grep -E 'factpath|
pluginsync'
factpath = /var/lib/puppet/lib/facter:/var/lib/puppet/facts
pluginsync = true


my fact is defined on the server in /etc/puppet/modules/spacewalk/lib/
facter/activationKey.rb:

[root@puppet ~]# cat /etc/puppet/modules/spacewalk/lib/facter/
activationKey.rb
# activationKey.rb

Facter.add(:activationKey) do
   setcode do
  1-rhel5-x86_64
   end
end

I trivialized it to test if I could eliminate the error (before it was
using some core facts to derive activationKey), but the error is
identical with the trivial fact.

Here is how I attempt to reference my custom fact:

[root@puppet ~]# cat /etc/puppet/modules/spacewalk/manifests/
register.pp

class spacewalk::register {



   exec { 'register-with-spacewalk':
 command = rhnreg_ks --profilename=$hostname --activationkey=
$activationKey --serverUrl=http://spacewalk/XMLRPC;,
 unless = test -e /etc/sysconfig/rhn/systemid,
 path = [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
 require = Class['spacewalk::install'],
   }

}

running the client with debug shows the exec command failing with an
exit code of 255 which is consistent with the nul parameter for the --
activationkey option to rhnreg_ks.  I've tried it multiple times in a
row from the node with the identical result:

[root@vm-ops001-1 ~]#   puppetd -t --debug

...
debug: Finishing transaction 23810158615960
debug: Storing state
debug: Stored state in 0.01 seconds
info: Loading facts in activationKey
info: Loading facts in activationKey
...

debug: Executing 'test -e /etc/sysconfig/rhn/systemid'
debug: /Stage[main]/Spacewalk::Register/Exec[register-with-spacewalk]:
Executing 'rhnreg_ks --profilename=vm-ops001-1 --activationkey= --
serverUrl=http://spacewalk/XMLRPC'
debug: Executing 'rhnreg_ks --profilename=vm-ops001-1 --activationkey=
--serverUrl=http://spacewalk/XMLRPC'
err: /Stage[main]/Spacewalk::Register/Exec[register-with-spacewalk]/
returns: change from notrun to 0 failed: rhnreg_ks --profilename=vm-
ops001-1 --activationkey= --serverUrl=http://spacewalk/XMLRPC returned
255 instead of one of [0] at /etc/puppet/modules/spacewalk/manifests/
register.pp:11
debug: Finishing transaction 23810158492340
debug: Storing state
debug: Stored state in 0.01 seconds
notice: Finished catalog run in 0.84 seconds

The debug shows nothing expanded for the value of $activationKey from
the register.pp manifest,  running from cli works however with
$FACTERLIB set:


[root@vm-ops001-1 ~]# echo $FACTERLIB
/var/lib/puppet/lib
[root@vm-ops001-1 ~]# facter activationKey
1-rhel5-x86_64

Other things I've tried:

restarting the master (server and agent) after each modification.

putting activationKey.rb in /usr/lib/ruby/site-ruby/1.8/facter  with
the core facts (still same error).

upgrading from facter 1.5.8 to facter 1.5.9

installing rubygems and deps which were not installed before.

I'm really banging my head against the wall with this one, and I'm
wondering if it's something really obvious and stupid that I've
overlooked.   Any help would be greatly appreciated.

thanks,

Paul

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



Re: [Puppet Users] Re: Testing if a puppet class is going to be installed

2011-07-07 Thread Darren Chamberlain
Did I miss the part where it was determined that having one class
require the other one(s) didn't work?

* Disconnect dc.disconnect at gmail.com [2011/07/07 14:57]:
 On Thu, Jul 7, 2011 at 2:10 PM, Keith Minkler kmink...@gmail.com wrote:
   This use case comes up a lot. There are some functions but
   historically they have not been reliable due to Puppet's
   random parse order for resources and classes.
 
  This is the trouble I had with the defined() function, so I had
  given up on it, since it was not returning in a reliable way.
 
 Tagged() tends to be more reliable but less complete. (And I think
 it requires an external node classifier..?)

-- 
Half of the harm that is done in this world is due to people who want
to feel important. They don't mean to do harm but the harm does not
interest them.
-- T.S. Eliot

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



[Puppet Users] Re: Custom fact does not show up in puppet run

2011-07-07 Thread Paul Fitzpatrick
I discovered by running facter without args on my client, that the fact
shows up as 'activationkey' (all lower case), even though I define it as
'activationKey' in my .rb file.  If I reference it as $activationkey in my
manifest, it works as desired.   It must be something about the way that
facter parses the fact names, or a ruby constraint on variable names,
although I couldn't find it in the documentation.

Anyway, it's working now and I hope this helps someone else with the same
issue.

Paul

On Thu, Jul 7, 2011 at 1:00 PM, filsdepatrick filsdepatr...@gmail.comwrote:

 I am trying to make my first custom fact work following (I think) the
 instructions given on puppetlabs.com and in 'Pro Puppet'.

 Although I can evaluate my fact using facter from the cli, it doesn't
 expand the fact from the variable name in my manifest.

 The os, puppet version and facter version are the same on both my
 client and the server:

 [root@vm-ops001-1 facter]# facter -v
 1.5.9

 [root@vm-ops001-1 facter]# puppet --version
 2.6.4

 The factpath is default on both client and server, and pluginsync is
 set to true in the [main] section of puppet.conf on both client and
 server.

 [root@vm-ops001-1 facter]# puppet --genconfig | grep -E 'factpath|
 pluginsync'
factpath = /var/lib/puppet/lib/facter:/var/lib/puppet/facts
pluginsync = true


 my fact is defined on the server in /etc/puppet/modules/spacewalk/lib/
 facter/activationKey.rb:

 [root@puppet ~]# cat /etc/puppet/modules/spacewalk/lib/facter/
 activationKey.rb
 # activationKey.rb

 Facter.add(:activationKey) do
   setcode do
  1-rhel5-x86_64
   end
 end

 I trivialized it to test if I could eliminate the error (before it was
 using some core facts to derive activationKey), but the error is
 identical with the trivial fact.

 Here is how I attempt to reference my custom fact:

 [root@puppet ~]# cat /etc/puppet/modules/spacewalk/manifests/
 register.pp

 class spacewalk::register {



   exec { 'register-with-spacewalk':
  command = rhnreg_ks --profilename=$hostname --activationkey=
 $activationKey --serverUrl=http://spacewalk/XMLRPC;,
 unless = test -e /etc/sysconfig/rhn/systemid,
 path = [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
 require = Class['spacewalk::install'],
   }

 }

 running the client with debug shows the exec command failing with an
 exit code of 255 which is consistent with the nul parameter for the --
 activationkey option to rhnreg_ks.  I've tried it multiple times in a
 row from the node with the identical result:

 [root@vm-ops001-1 ~]#   puppetd -t --debug

 ...
 debug: Finishing transaction 23810158615960
 debug: Storing state
 debug: Stored state in 0.01 seconds
 info: Loading facts in activationKey
 info: Loading facts in activationKey
 ...

 debug: Executing 'test -e /etc/sysconfig/rhn/systemid'
 debug: /Stage[main]/Spacewalk::Register/Exec[register-with-spacewalk]:
 Executing 'rhnreg_ks --profilename=vm-ops001-1 --activationkey= --
 serverUrl=http://spacewalk/XMLRPC'
 debug: Executing 'rhnreg_ks --profilename=vm-ops001-1 --activationkey=
 --serverUrl=http://spacewalk/XMLRPC'
 err: /Stage[main]/Spacewalk::Register/Exec[register-with-spacewalk]/
 returns: change from notrun to 0 failed: rhnreg_ks --profilename=vm-
 ops001-1 --activationkey= --serverUrl=http://spacewalk/XMLRPC returned
 255 instead of one of [0] at /etc/puppet/modules/spacewalk/manifests/
 register.pp:11
 debug: Finishing transaction 23810158492340
 debug: Storing state
 debug: Stored state in 0.01 seconds
 notice: Finished catalog run in 0.84 seconds

 The debug shows nothing expanded for the value of $activationKey from
 the register.pp manifest,  running from cli works however with
 $FACTERLIB set:


 [root@vm-ops001-1 ~]# echo $FACTERLIB
 /var/lib/puppet/lib
 [root@vm-ops001-1 ~]# facter activationKey
 1-rhel5-x86_64

 Other things I've tried:

 restarting the master (server and agent) after each modification.

 putting activationKey.rb in /usr/lib/ruby/site-ruby/1.8/facter  with
 the core facts (still same error).

 upgrading from facter 1.5.8 to facter 1.5.9

 installing rubygems and deps which were not installed before.

 I'm really banging my head against the wall with this one, and I'm
 wondering if it's something really obvious and stupid that I've
 overlooked.   Any help would be greatly appreciated.

 thanks,

 Paul

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



Re: [Puppet Users] Re: Testing if a puppet class is going to be installed

2011-07-07 Thread Nigel Kersten
This need is why we've modified the default ACL in 2.7.x to allow you to
retrieve your own node definitions easily.

http://groups.google.com/group/puppet-dev/browse_thread/thread/fba16b6f26015daa

If you add a rule like this to puppet 2.7.0rc1 in auth.conf

path ~ ^/node/([^/]+)$
method find
allow $1

then nodes are able to find their own node definitions from the master
like this:

$ puppet node find certname --terminus rest --server servername

This is really useful, as it allows you to do things from the node
like find out what environment/classes/parameters an ENC is going to
define for you. This would allow us to modify the configurer face to
work out what environment you are going to be assigned before you do
any pluginsync.

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



[Puppet Users] Rack issue with puppet-dashboard

2011-07-07 Thread Haitao Jiang
I was following the instructions and was having trouble running

sudo apt-get install puppet-dashboard

I think it tries to start up the dashboard in the end but failed - any
idea how to get it going?

PS: I did try to install rack manually
wget http://rubyforge.org/frs/download.php/71197/rack-1.2.0.tar.gz
tar zxf rack-1.2.0.tar.gz
gem install rack

still the same error

Thanks a lot

Haitao
=error=

Gem::SourceIndex#add_spec called from
/usr/local/lib/site_ruby/1.8/rubygems/source_index.rb:91.
/usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs':
Could not find rack (~ 1.0.1) amongst [facter-1.5.9, facter-1.5.7,
puppet-2.6.8, rack-1.3.0] (Gem::LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:256:in
`to_spec'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:1182:in `gem'
from 
/usr/share/puppet-dashboard/vendor/rails/actionpack/lib/action_controller.rb:34
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in
`gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in
`require'
from 
/usr/share/puppet-dashboard/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in
`require'
from 
/usr/share/puppet-dashboard/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in
`new_constants_in'
from 
/usr/share/puppet-dashboard/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in
`require'
from 
/usr/share/puppet-dashboard/vendor/rails/railties/lib/commands/server.rb:2
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in
`gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in
`require'
from /usr/share/puppet-dashboard/script/server:3
 * Puppet Dashboard is not running
   ...fail!
invoke-rc.d: initscript puppet-dashboard, action start failed.
dpkg: error processing puppet-dashboard (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 puppet-dashboard
E: Sub-process /usr/bin/dpkg returned an error code (1)

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



Re: [Puppet Users] Rack issue with puppet-dashboard

2011-07-07 Thread Jacob Helwig
On Thu, 07 Jul 2011 16:05:03 -0700, Haitao Jiang wrote:
 
 I was following the instructions and was having trouble running
 
 sudo apt-get install puppet-dashboard
 
 I think it tries to start up the dashboard in the end but failed - any
 idea how to get it going?
 
 PS: I did try to install rack manually
 wget http://rubyforge.org/frs/download.php/71197/rack-1.2.0.tar.gz
 tar zxf rack-1.2.0.tar.gz
 gem install rack
 
 still the same error
 
 Thanks a lot
 
 Haitao
 =error=
 
 Gem::SourceIndex#add_spec called from
 /usr/local/lib/site_ruby/1.8/rubygems/source_index.rb:91.
 /usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs':
 Could not find rack (~ 1.0.1) amongst [facter-1.5.9, facter-1.5.7,
 puppet-2.6.8, rack-1.3.0] (Gem::LoadError)
 from /usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:256:in
 `to_spec'
 from /usr/local/lib/site_ruby/1.8/rubygems.rb:1182:in `gem'
 from 
 /usr/share/puppet-dashboard/vendor/rails/actionpack/lib/action_controller.rb:34
 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in
 `gem_original_require'
 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in
 `require'
 from 
 /usr/share/puppet-dashboard/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in
 `require'
 from 
 /usr/share/puppet-dashboard/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in
 `new_constants_in'
 from 
 /usr/share/puppet-dashboard/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in
 `require'
 from 
 /usr/share/puppet-dashboard/vendor/rails/railties/lib/commands/server.rb:2
 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in
 `gem_original_require'
 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in
 `require'
 from /usr/share/puppet-dashboard/script/server:3
  * Puppet Dashboard is not running
...fail!
 invoke-rc.d: initscript puppet-dashboard, action start failed.
 dpkg: error processing puppet-dashboard (--configure):
  subprocess installed post-installation script returned error exit status 1
 Errors were encountered while processing:
  puppet-dashboard
 E: Sub-process /usr/bin/dpkg returned an error code (1)
 

Looks like you've got the wrong version of rack installed.

It's looking for rack (~ 1.0.1), which means it can use anything =
1.0.1 and  1.1.0.

~ is explained in more detail on the Ruby Gems site[1] under
Pessimistic Version Constraint.

[1] http://docs.rubygems.org/read/chapter/16

-- 
Jacob Helwig


signature.asc
Description: Digital signature


[Puppet Users] Re: notify defined in exported resource won't work?

2011-07-07 Thread Joehillen
What version were you running? I think I may have hit a similar issue.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/23JPcoSOHbcJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



[Puppet Users] I have a service that just wont restart.

2011-07-07 Thread Joehillen
For my nagios::nrpe class, I have the following service:

service {nagios-nrpe-server:
ensure = running,
enable = true,
require = Package[nagios-nrpe-server],
hasrestart = true,
restart = /etc/init.d/nagios-nrpe-server restart,
subscribe = File[/etc/nagios/nrpe.d/],
}

In all of the nrpe config file entries, I have:

notify = Service[nagios-nrpe-server]

It even says that it restarted the service:

info: 
/Stage[main]//Node[alpha..net]/Nagios::Nrpe::Check_mem[alpha..net]/Nagios::Nrpe::Check[mem]/File[/etc/nagios/nrpe.d/check_mem.cfg]:
 
Scheduling refresh of Service[nagios-nrpe-server]
notice: /Stage[main]/Nagios::Nrpe/Service[nagios-nrpe-server]/ensure: ensure 
changed 'stopped' to 'running'
notice: /Stage[main]/Nagios::Nrpe/Service[nagios-nrpe-server]: Triggered 
'refresh' from 1 events

However, it wont actually restart the service, and I have to do it manually:

sudo /etc/init.d/nagios-nrpe-server restart

After that, it works perfectly.

I am running Puppet 2.6.2 on Debian Lenny

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/MqrRoS9Uz5cJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] I have a service that just wont restart.

2011-07-07 Thread Ken Barber
 notice: /Stage[main]/Nagios::Nrpe/Service[nagios-nrpe-server]/ensure: ensure
 changed 'stopped' to 'running'

That looks like its trying to start it, not restart it. Do you get
this message each time you do a puppet run (even when nothing has
changed)? If so - you might need a valid 'status' command and use
hasstatus = true. It probably thinks its not started perhaps.

Puppet falls back to looking in the process table when you don't
specify hasstatus = true to determine service status - and it uses
the name of the service (in this case nagios-nrpe-server) to do the
search.

ken.

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



Re: [Puppet Users] I have a service that just wont restart.

2011-07-07 Thread Joehillen
Yes, it says it every time. The actual process is called nrpe, so that 
makes sense that it can't find it. 

Unfortunately, it doesn't have a status command. What should I do instead?

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/3UvUuuLOprIJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] I have a service that just wont restart.

2011-07-07 Thread Ken Barber
Use the pattern attribute, documented here:

http://docs.puppetlabs.com/references/stable/type.html#service

ken.

On Fri, Jul 8, 2011 at 1:18 AM, Joehillen joehil...@gmail.com wrote:
 Yes, it says it every time. The actual process is called nrpe, so that
 makes sense that it can't find it.
 Unfortunately, it doesn't have a status command. What should I do instead?

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/puppet-users/-/3UvUuuLOprIJ.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.




-- 
Join us for PuppetConf, September 22nd and 23rd in Portland, OR:
http://bit.ly/puppetconfsig;

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



Re: [Puppet Users] I have a service that just wont restart.

2011-07-07 Thread Joehillen
Awesome! Adding `pattern = nrpe` solved the issue. 

Thanks for your help.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/hcKGdrX7F4gJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Passing variables between stages

2011-07-07 Thread vagn scott


That sounds suspiciously like procedural thinking about a declarative 
language.


You should understand that in puppet everything is 'set' before anything 
is 'done'.

Stages just help to order the 'get it done' part.

So the answer to your question about a method to access a variable 
is:  just access it!


$foo = $otherclass::baz

--
vagn



On 07/07/2011 09:19 AM, Chip Schweiss wrote:
I'm looking for a method to access a variable set in my main state 
from a class in my post stage?


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