[Puppet Users] Re: Variable interpolation in class parameters

2011-11-08 Thread Al @ Lab42


On Friday, September 30, 2011 4:50:33 PM UTC+1, jcbollinger wrote:

 I do think there's a bug, but I'm not confident it's the one you think 
 it is.  I find no documentation of any difference in variable 
 interpolation in class parameter defaults than in any other context, 
 so I expect the interpolation to be performed according to the same 
 rules as elsewhere.  Specifically, I expect interpolation to draw on 
 only variables available in the scope in which the host string 
 appears.  A class's parameters cannot be in scope in that class's own 
 parameter list definition, because their values are not known at that 
 point.  Therefore, you should not be able to interpolate one 
 parameter's actual value into the default value of a another 
 parameter.  That is, NONE of the interpolations in your example should 
 work. 

Hi John,
This thing scaries me a bit.
I'm rewriting my modules in order to merge the usage of a  params.pp  class 
where defaults are set and parametrized classes.
The output is something like :

class openssh (

[...]
  $package = $openssh::params::package, 

  $service   = $openssh::params::service, 
  $service_status= $openssh::params::service_status, 
  $process   = $openssh::params::process,
  $process_args  = $openssh::params::process_args,
  $config_dir= $openssh::params::config_dir,
  $config_file   = $openssh::params::config_file,
  $config_file_mode  = $openssh::params::config_file_mode,
  $config_file_owner = $openssh::params::config_file_owner,
  $config_file_group = $openssh::params::config_file_group,
  $config_file_init  = $openssh::params::config_file_init,
  $pid_file  = $openssh::params::pid_file, 
  $data_dir  = $openssh::params::data_dir, 
  $log_dir   = $openssh::params::log_dir, 
  $log_file  = $openssh::params::log_file 
  ) inherits openssh::params {

There is no particular interpolation on variables, just their value's 
assignment as default.
Is this a supported behaviour that I can trust to be mantained on future 
versions?

Al

-- 
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/-/XriIlABmFyEJ.
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: Weird opsviewmonitored module behavior

2011-11-08 Thread Galed Friedmann
Hi,
Thanks for trying to help.

I agree with that you wrote, the weird thing that I mentioned in my
previous mail was that indeed the 'proxy3' server appears in opsview. Also
to add to this mess there are other proxy servers that use the same
opsviewmonitored manifest that appear in opsview and in puppet resource,
this happens occasionally for some but not all of the servers.

I found out that deleting the servers entirely from opsview and letting
puppet create them again solves this for some time, but after a while it
enters that loop again, sometimes with the same servers and sometimes with
others...

Any ideas?

Thanks again!

On Mon, Nov 7, 2011 at 9:04 PM, devon devon.pet...@gmail.com wrote:

  I'm using Opsviewmonitored module to manage my servers inside opsview, 
 exporting the resource to a central server and making sure all of the 
 available servers are monitored and exist in opsview.
  I have around 30 servers that are being managed by opsview just fine, but
  there is a specific group of servers which keeps disappearing from puppet
  as a managed resource, causing puppet to constantly try to apply the
  resource and reloading my opsview server endlessly.

 This module is pretty basic, and doesn't do any error checking after
 sending the config to Opsview.  If you specify a non-existant
 hostemplate or hostgroup, then the resources will appear to be applied
 by puppet, but they won't actually be written to Opsview.  As a result
 you'll end up seeing the resources get applied on every puppet run.


  # puppet resource opsviewmonitored proxy3
  opsviewmonitored { 'proxy3':
ensure = 'present',
 
  }

 I would expect the output of puppet resource to list the hostgroup,
 ip, and hostemplates parameters for this node if they exist.  In this
 case they're blank, so it's probably not setup properly.

 So, is the 'proxy3' host actually present in Opsview, with the proper
 settings?  I'd double check to make sure that the hosttemplate and
 hostgroup you're specifying are actually setup.


 Btw - you might want to check out a fork of the opsview module, which
 allows you to manage a whole lot more than just nodes (hostgroups,
 servicechecks, contacts, etc):
 http://forge.puppetlabs.com/cparedes/puppet_opsview

 -devon

 --
 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: puppet facter timeout

2011-11-08 Thread madAndroid
We had the same issue ... looks like a newer version has fixed it
though: 1.5.6-2ubuntu2.3


On Nov 8, 6:48 am, raffis raffael.sa...@gmail.com wrote:
 Yep thanks, the ubuntu package 1.5.6-2ubuntu2.2 was the problem. Roll-
 back to 1.5.6-2ubuntu2 solved the facter bug.

 On Nov 8, 2:21 am, Jacob Helwig ja...@puppetlabs.com wrote:







  On 2011-11-07 05:50 , raffis wrote:

   I have a problem with a new Ubuntu server (2.6.32-33-server) and
   facter.

   Facter Version 1.5.6

   root@web002:~# facter
   /usr/lib/ruby/1.8/timeout.rb:60:in `open': execution expired
   (Timeout::Error)
      from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
      from /usr/lib/ruby/1.8/timeout.rb:53:in `timeout'
      from /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
      from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
      from /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
      from /usr/lib/ruby/1.8/net/http.rb:542:in `start'
      from /usr/lib/ruby/1.8/open-uri.rb:242:in `open_http'
      from /usr/lib/ruby/1.8/open-uri.rb:616:in `buffer_open'
      from /usr/lib/ruby/1.8/open-uri.rb:164:in `open_loop'
      from /usr/lib/ruby/1.8/open-uri.rb:162:in `catch'
      from /usr/lib/ruby/1.8/open-uri.rb:162:in `open_loop'
      from /usr/lib/ruby/1.8/open-uri.rb:132:in `open_uri'
      from /usr/lib/ruby/1.8/open-uri.rb:518:in `open'
      from /usr/lib/ruby/1.8/open-uri.rb:30:in `open'
      from /usr/lib/ruby/1.8/facter/ec2.rb:10:in `can_connect?'
      from /usr/lib/ruby/1.8/facter/ec2.rb:10:in `can_connect?'
      from /usr/lib/ruby/1.8/facter/ec2.rb:33
      from /usr/lib/ruby/1.8/facter/util/loader.rb:72:in `load'
      from /usr/lib/ruby/1.8/facter/util/loader.rb:72:in `load_file'
      from /usr/lib/ruby/1.8/facter/util/loader.rb:38:in `load_all'
      from /usr/lib/ruby/1.8/facter/util/loader.rb:33:in `each'
      from /usr/lib/ruby/1.8/facter/util/loader.rb:33:in `load_all'
      from /usr/lib/ruby/1.8/facter/util/loader.rb:30:in `each'
      from /usr/lib/ruby/1.8/facter/util/loader.rb:30:in `load_all'
      from /usr/lib/ruby/1.8/facter/util/collection.rb:94:in `load_all'
      from /usr/lib/ruby/1.8/facter.rb:91:in `to_hash'
      from /usr/bin/facter:138

   facter with strace:
   It stops 1-2s, thats the output of strace.

   socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
   fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
   fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
   connect(3, {sa_family=AF_INET, sin_port=htons(80),
   sin_addr=inet_addr(169.254.169.254)}, 16) = -1 EINPROGRESS
   (Operation now in progress)
   select(5, [], [3], [3], {1, 969055}^C unfinished ...

   Puppet says, there is a problem with local facts, and I'm sure thats
   the facter problem ;)

   And there is no problem with dns, all other servers with the same
   version of facter and puppet have no problems... The only thing I did
   on this server is an upgrade with apt-get, but facter and puppet are
   the same version as they are on the other servers

   Thanks for your help

  You'll want to keep an eye on the Ubuntu bug for this[0].

  [0]https://bugs.launchpad.net/ubuntu/+source/facter/+bug/885998

  --
  Jacob Helwighttp://about.me/jhelwig

   signature.asc
   1KViewDownload

-- 
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: Variable interpolation in class parameters

2011-11-08 Thread jcbollinger


On Nov 8, 4:41 am, Al @ Lab42 lab42...@gmail.com wrote:
 On Friday, September 30, 2011 4:50:33 PM UTC+1, jcbollinger wrote:
  I do think there's a bug, but I'm not confident it's the one you think
  it is.  I find no documentation of any difference in variable
  interpolation in class parameter defaults than in any other context,
  so I expect the interpolation to be performed according to the same
  rules as elsewhere.  Specifically, I expect interpolation to draw on
  only variables available in the scope in which the host string
  appears.  A class's parameters cannot be in scope in that class's own
  parameter list definition, because their values are not known at that
  point.  Therefore, you should not be able to interpolate one
  parameter's actual value into the default value of a another
  parameter.  That is, NONE of the interpolations in your example should
  work.

 Hi John,
 This thing scaries me a bit.
 I'm rewriting my modules in order to merge the usage of a  params.pp  class
 where defaults are set and parametrized classes.
 The output is something like :

 class openssh (

 [...]
   $package = $openssh::params::package,

   $service           = $openssh::params::service,
   $service_status    = $openssh::params::service_status,
   $process           = $openssh::params::process,
   $process_args      = $openssh::params::process_args,
   $config_dir        = $openssh::params::config_dir,
   $config_file       = $openssh::params::config_file,
   $config_file_mode  = $openssh::params::config_file_mode,
   $config_file_owner = $openssh::params::config_file_owner,
   $config_file_group = $openssh::params::config_file_group,
   $config_file_init  = $openssh::params::config_file_init,
   $pid_file          = $openssh::params::pid_file,
   $data_dir          = $openssh::params::data_dir,
   $log_dir           = $openssh::params::log_dir,
   $log_file          = $openssh::params::log_file
   ) inherits openssh::params {

 There is no particular interpolation on variables, just their value's
 assignment as default.
 Is this a supported behaviour that I can trust to be mantained on future
 versions?


I do not work for PuppetLabs nor contribute code to Puppet.  With that
said, however,

1) This precise approach is used in an example on the PuppetLabs
documentation site, and

2) it is not what this thread was previously discussing.

Specifically, this thread was not about generally using variables as
or in class parameters' default values; instead, it was about using
some of a class's *own* parameters as or in the default values of
others of that class's parameters.  I haven't changed my mind on that
topic.

As to your approach, I think it should work now and in the future, in
the sense that it will reliably set the superclass variables' values
as the default values for the subclass's parameters.  My personal
opinion, however, is that class parameterization is generally a bad
idea, that class inheritance should be used only for overriding
resource properties, and that going against both of those precepts at
the same time is ... something I can't see myself ever doing.


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.



[Puppet Users] Using a defined function in another class?

2011-11-08 Thread Marc Richman
I have a function defined in one class that I would like to use in another 
class, but I can not seem to get it to work, I set up a simple test case and I 
get the following error:
Could not retrieve catalog from remote server: Error 400 on SERVER: 
Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid resource 
type testfn at /etc/puppet/modules/sandbox/one/manifests/init.pp:3 on node 
bos-test01.contentstore.net


/etc/puppet/modules/sandbox/one/manifests/init.pp
class one {
  include two
  testfn { test:}
}

/etc/puppet/modules/sandbox/two/manifests/init.pp
class two {
  define testfn () {
notify {foo: }
  }
}

What am I doing wrong?

Thanks
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] Using a defined function in another class?

2011-11-08 Thread Christopher Wood
Off the top of my head, untested:

/etc/puppet/modules/sandbox/manifests/one.pp
class sandbox::one {
  include sandbox::two
  testfn { test:}
}

/etc/puppet/modules/sandbox/manifests/two.pp
class sandbox::two {
  define testfn () {
notify {foo: }
  }
}


On Tue, Nov 08, 2011 at 09:31:57AM -0500, Marc Richman wrote:
 I have a function defined in one class that I would like to use in another 
 class, but I can not seem to get it to work, I set up a simple test case and 
 I get the following error:
 Could not retrieve catalog from remote server: Error 400 on SERVER: 
 Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid 
 resource type testfn at /etc/puppet/modules/sandbox/one/manifests/init.pp:3 
 on node bos-test01.contentstore.net
 
 
 /etc/puppet/modules/sandbox/one/manifests/init.pp
 class one {
   include two
   testfn { test:}
 }
 
 /etc/puppet/modules/sandbox/two/manifests/init.pp
 class two {
   define testfn () {
 notify {foo: }
   }
 }
 
 What am I doing wrong?
 
   Thanks
   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.
 
 

-- 
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] Using a defined function in another class?

2011-11-08 Thread Marc Richman
Oops grabbed the path from the puppet output not the directory structure.  

The files should be: 
/etc/puppet/modules/sandbox/one/manifests/init.pp
class one {
  include two
  testfn { test:}
}

/etc/puppet/modules/sandbox/two/manifests/init.pp
class two::test {
  testfn {test: }
}


the following class works as it is in the same module as the define:
/etc/puppet/modules/sandbox/two/manifests/test.pp
class two::test {
  testfn {test: }
}


I tried ::one::testfn{test: } that also failed with the error:

Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid tag 
::one::testfn at /etc/puppet/modules/sandbox/one/manifests/init.pp:3 on node 
bos-test01.contentstore.net

-- 
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] nss_ldap breaks puppet

2011-11-08 Thread Craig White

On Nov 7, 2011, at 4:18 PM, Raymond wrote:

 I have installed and configured the puppet client nodes to use LDAP to
 authenicate users.
 LDAP connection is OK and user can be authenicated via LDAP.
 I use nscd and with my ldap config setting specify on /etc/ldap.conf
 
 However, puppet is not happy; and in the /var/log/messages it gives
 tons of
 
 puppet-agent[27499]: nss_ldap: could not search LDAP server
 puppet-agent[27499]: nss_ldap: reconnecting to LDAP server
 
 I guess LDAP server connection is slow or timeout, but could we
 configure puppet client NOT to use LDAP specify on nsswitch.conf
 
 I search previous post; and somebody suggests to fix LDAP locally. I
 think that is the ideal way; but if I don't have control on LDAP. Give
 up Puppet or LDAP?
 
 I think should have way to configure puppet not to use the host
 setting set on nsswitch.conf.
 /etc/sysconfig/puppet  or /etc/puppet/puppet.conf  --- anywhere we
 can tell puppet to use alternative auth way other than the default
 system /etc/nsswitch.conf

first of all, it's just a log entry that isn't necessarily a problem but 
indicates that perhaps some LDAP reconfiguration is probably a good idea.

Doesn't puppet-agent use root? Why is puppet-agent looking to LDAP for root 
user credentials?

You probably should be looking at (or adding) these types of entries in 
/etc/ldap.conf

timelimit 10
bind_timelimit 4
bind_policy soft
nss_initgroups_ignoreusers \
openldap,bind,named,ldap,backup,bin,daemon,games,gnats,\
irc,landscape,libuuid,list,lp,mail,man,news,openldap,proxy,\
root,sshd,sync,sys,syslog,uucp,www-data

though you should check the man pages and test for your optimal settings and 
the nss_initgroups_ignoreusers list I am presenting is sort of a hybrid 
ubuntu/centos list and your list of 'local' (not LDAP) users would likely be 
different.

Also FWIW, I have always found nscd to be a bit painful and perhaps you can get 
better utility from nlscd if it's available for your distribution.

nsswitch.conf is an all or none proposition.

Craig

-- 
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] nagios_service does not replace target file

2011-11-08 Thread Bernd Adamowicz
Hi all,

I'm using Puppet 2.6.6 on both clients and master along with stored 
configurations. My clients provide Nagios configurations like this example:
  
  @@nagios_service { check_ping_${hostname}:
   check_command = check_ping!100.0,20%!500.0,60%,
   use = generic-service,
   host_name = $fqdn,
   service_description = ${prefix}PING: ${hostname},
  }

They are realized on the master with the Nagios_service:

  Nagios_service || {

target = ${baseconfigdir}/${conf_file_srvs},
require = File[${baseconfigdir}/${conf_file_srvs}],
  }

Since I needed special access rights for the target file (it's rsynced from 
another host), I added an appropriate file resource:

  file { ${baseconfigdir}/${conf_file_srvs}:
ensure = present,
owner = puppet,
group = puppet,
mode = 0644,  
backup = false,
require = File[${baseconfigdir}],
  }

Everything works fine on the first run. But once a client changes its Nagios 
resources, the new configuration will not end up in the target file of 
Nagios_service.

I checked the table 'resources' within the MySQL database after the client 
executes - the changes to the exported resources are definitely done there. 
(E.g.: mysql select title,restype from resources where host_id=6 and 
exported=1;)

I tried to poke around and added 

content =  

to the file resource. Or I removed the 'require' attribute from the 
Nagios_service resource. I also tried to keep the ${baseconfigdir} clean by 
adding this resource:

  
  file {${baseconfigdir}:
ensure = directory,
owner = puppet,
group = puppet,
mode = 0755,
backup = false,
recurse = true,
purge = true,
source = puppet:///modules/icinga/puppet_generated,
  }

Within 'puppet:///modules/icinga/puppet_generated' there's only a README file. 
And I thought with 'recurse' and 'purge' this will clean all other files. But 
obviously not. The only thing that currently helps is manually deleting the 
target files.

There are no errors in the log files, the catalog compiles without errors, I 
couldn't find any related bug entry, so I'm a little bit lost at the moment.

Thanks for any help
Bernd

-- 
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: puppet facter timeout

2011-11-08 Thread Peter Horvath
I had the same issue and the new lucid update of facter solved it.

-- Forwarded message --
From: madAndroid andrewsta...@gmail.com
Date: 8 November 2011 12:43
Subject: [Puppet Users] Re: puppet facter timeout
To: Puppet Users puppet-users@googlegroups.com


We had the same issue ... looks like a newer version has fixed it
though: 1.5.6-2ubuntu2.3


On Nov 8, 6:48 am, raffis raffael.sa...@gmail.com wrote:
 Yep thanks, the ubuntu package 1.5.6-2ubuntu2.2 was the problem. Roll-
 back to 1.5.6-2ubuntu2 solved the facter bug.

 On Nov 8, 2:21 am, Jacob Helwig ja...@puppetlabs.com wrote:







  On 2011-11-07 05:50 , raffis wrote:

   I have a problem with a new Ubuntu server (2.6.32-33-server) and
   facter.

   Facter Version 1.5.6

   root@web002:~# facter
   /usr/lib/ruby/1.8/timeout.rb:60:in `open': execution expired
   (Timeout::Error)
  from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
  from /usr/lib/ruby/1.8/timeout.rb:53:in `timeout'
  from /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
  from /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
  from /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
  from /usr/lib/ruby/1.8/net/http.rb:542:in `start'
  from /usr/lib/ruby/1.8/open-uri.rb:242:in `open_http'
  from /usr/lib/ruby/1.8/open-uri.rb:616:in `buffer_open'
  from /usr/lib/ruby/1.8/open-uri.rb:164:in `open_loop'
  from /usr/lib/ruby/1.8/open-uri.rb:162:in `catch'
  from /usr/lib/ruby/1.8/open-uri.rb:162:in `open_loop'
  from /usr/lib/ruby/1.8/open-uri.rb:132:in `open_uri'
  from /usr/lib/ruby/1.8/open-uri.rb:518:in `open'
  from /usr/lib/ruby/1.8/open-uri.rb:30:in `open'
  from /usr/lib/ruby/1.8/facter/ec2.rb:10:in `can_connect?'
  from /usr/lib/ruby/1.8/facter/ec2.rb:10:in `can_connect?'
  from /usr/lib/ruby/1.8/facter/ec2.rb:33
  from /usr/lib/ruby/1.8/facter/util/loader.rb:72:in `load'
  from /usr/lib/ruby/1.8/facter/util/loader.rb:72:in `load_file'
  from /usr/lib/ruby/1.8/facter/util/loader.rb:38:in `load_all'
  from /usr/lib/ruby/1.8/facter/util/loader.rb:33:in `each'
  from /usr/lib/ruby/1.8/facter/util/loader.rb:33:in `load_all'
  from /usr/lib/ruby/1.8/facter/util/loader.rb:30:in `each'
  from /usr/lib/ruby/1.8/facter/util/loader.rb:30:in `load_all'
  from /usr/lib/ruby/1.8/facter/util/collection.rb:94:in `load_all'
  from /usr/lib/ruby/1.8/facter.rb:91:in `to_hash'
  from /usr/bin/facter:138

   facter with strace:
   It stops 1-2s, thats the output of strace.

   socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
   fcntl(3, F_GETFL)   = 0x2 (flags O_RDWR)
   fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)= 0
   connect(3, {sa_family=AF_INET, sin_port=htons(80),
   sin_addr=inet_addr(169.254.169.254)}, 16) = -1 EINPROGRESS
   (Operation now in progress)
   select(5, [], [3], [3], {1, 969055}^C unfinished ...

   Puppet says, there is a problem with local facts, and I'm sure thats
   the facter problem ;)

   And there is no problem with dns, all other servers with the same
   version of facter and puppet have no problems... The only thing I did
   on this server is an upgrade with apt-get, but facter and puppet are
   the same version as they are on the other servers

   Thanks for your help

  You'll want to keep an eye on the Ubuntu bug for this[0].

  [0]https://bugs.launchpad.net/ubuntu/+source/facter/+bug/885998

  --
  Jacob Helwighttp://about.me/jhelwig

   signature.asc
   1KViewDownload

--
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] Using a defined function in another class?

2011-11-08 Thread Nigel Kersten
On Tue, Nov 8, 2011 at 6:31 AM, Marc Richman 
marc.rich...@livewiremobile.com wrote:

 I have a function defined in one class that I would like to use in another
 class, but I can not seem to get it to work, I set up a simple test case
 and I get the following error:
 Could not retrieve catalog from remote server: Error 400 on SERVER:
 Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
 resource type testfn at /etc/puppet/modules/sandbox/one/manifests/init.pp:3
 on node bos-test01.contentstore.net


 /etc/puppet/modules/sandbox/one/manifests/init.pp
 class one {
  include two
  testfn { test:}
 }

 /etc/puppet/modules/sandbox/two/manifests/init.pp
 class two {
  define testfn () {
notify {foo: }
  }
 }

 What am I doing wrong?


This isn't a function. It's a defined type. Functions are a different thing
in Puppet.

Put the define in a place the autoloader will find it. I'm assuming your
modulepath is /etc/puppet/modules/sandbox ?

/etc/puppet/modules/sandbox/two/manifests/testfn.pp

define two::testfn() { ... }

then you can declare instances of it from anywhere.






Thanks
 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.




-- 
Nigel Kersten
Product Manager, Puppet Labs

-- 
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] ANNOUNCE: Puppet Labs stdlib module version 2.2.0 released

2011-11-08 Thread James Turnbull
We're pleased to announce a new release of the Puppet Labs stdlib
module. This module provides a standard library of resources for
developing Puppet Modules. This modules will include the following
additions to Puppet:

* Default Stages
* Facts
* Functions
* Defined resource types
* Types
* Providers

This module is officially curated and provided by Puppet Labs. The
modules Puppet Labs writes and distributes will make heavy use of this
standard library.

The CHANGELOG since the last release is:

2011-11-08 Puppet Labs supp...@puppetlabs.com - 2.2.0
* #10285 - Refactor json to use pson instead.
* Maint  - Add watchr autotest script
* Maint  - Make rspec tests work with Puppet 2.6.4
* #9859  - Add root_home fact and tests

The module is available via the Puppet Labs Forge at
http://forge.puppetlabs.com/puppetlabs/stdlib.

Regards

James Turnbull

-- 
James Turnbull
Puppet Labs
1-503-734-8571
To schedule a meeting with me: http://tungle.me/jamtur01

-- 
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] Fetching puppet files and templates from Maven

2011-11-08 Thread Justin Lloyd
How would one go about fetching a template from Maven? For example, the
normal way of using a file resource for an application config file might be:

file { /etc/app/app.xml:
mode= 0755,
owner   = appuser,
group   = appuser,
content = template(app/app.xml.erb), # retrieved from
modules/app/templates/app.xml
notify  = Service[app],
require = Package[app];
}

However, what if app.xml.erb is in a separate Maven repository on some
other server? How would you go about retrieving and evaluating the template?

How might you go about this for a normal file, i.e. instead of source =
puppet://... ?

I guess you could use an exec resource for a normal file but probably not
for a template since Puppet needs to evaluate the code in the template file.

Thoughts?

-- 
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] Removing file downloads through redmine for puppet/facter et al

2011-11-08 Thread Michael Stahnke
We used to upload the files from a release into redmine as “files”
attachments. This was at least the third location of the files, and
probably isn’t needed. It hasn’t been updated for Puppet since 2.6.7 ,
and is just stale. This can still be found via google, and creates
confusion. All emails from the last 6-9 months at least, have
references downloads.puppetlabs.com as the correct location for our
content.  We will be removing the files section from our projects on
Redmine for Puppet, Facter, Mcollective, and Dashboard sometime later
today.



Mike Stahnke
Release Manager -- Puppet Labs

-- 
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] Fetching puppet files and templates from Maven

2011-11-08 Thread Nan Liu
On Tue, Nov 8, 2011 at 5:54 PM, Justin Lloyd jstn...@gmail.com wrote:
 How would one go about fetching a template from Maven? For example, the
 normal way of using a file resource for an application config file might be:

 file { /etc/app/app.xml:
     mode    = 0755,
     owner   = appuser,
     group   = appuser,
     content = template(app/app.xml.erb), # retrieved from
 modules/app/templates/app.xml
     notify  = Service[app],
     require = Package[app];
 }

 However, what if app.xml.erb is in a separate Maven repository on some other
 server? How would you go about retrieving and evaluating the template?

 How might you go about this for a normal file, i.e. instead of source =
 puppet://... ?

 I guess you could use an exec resource for a normal file but probably not
 for a template since Puppet needs to evaluate the code in the template file.

 Thoughts?

What you need is a custom function that can retrieve the file and
process it as a template. I would look at the inline_template function
and create something like remote_template where you retrieve the file
from a remote location and process it.

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.



[Puppet Users] yumrepo behavior question

2011-11-08 Thread Neal
Hi All,
I have two yumrepos configured:

class yumrepos {
yumrepo { 'RHEL6.1_Repo':
  baseurl  = 'http://hostname.domain.com/rhel6',
  descr= 'Internal RHEL6.1 Repository',
  enabled  = '1',
  gpgcheck = '0',
}
yumrepo { 'Company_EL6_Repo':
  baseurl  = 'http://hostname.domain.com/repo.el6',
  descr= 'Company EL6 Repository',
  enabled  = '1',
  gpgcheck = '0',
}
}

the job reports as running correctly and I get:

Yumrepo[RHEL6.1_Repo] (/etc/puppetlabs/puppet/modules/yumrepos/
manifests/init.pp:7)
Yumrepo[Company_EL6_Repo] (/etc/puppetlabs/puppet/modules/yumrepos/
manifests/init.pp:13)

in my event log, but the repos are not correctly added to the node.

I have run yum clean all and yum makecache, and also removed the class
from the node and re-added it, and still get the same output.  This is
on PE 1.2 evaluation running on a single RHEL6.1 node (master +
agent).

The only thing I get in the log is Finished catalog run in 0.61
seconds since Puppet doesn't see the repos as changed even though
they are missing.

Do I need to manually create the files underneath /etc/yum.repos.d?
That is fine but I don't see that in the docs.  Can anyone tell what I
am doing wrong?

Thanks in advance,
Neal Brown
Spiceworks Inc.

-- 
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] yumrepo behavior question

2011-11-08 Thread Michael Stahnke
On Tue, Nov 8, 2011 at 4:21 PM, Neal nealbr...@gmail.com wrote:
 Hi All,
 I have two yumrepos configured:

 class yumrepos {
 yumrepo { 'RHEL6.1_Repo':
  baseurl  = 'http://hostname.domain.com/rhel6',
  descr    = 'Internal RHEL6.1 Repository',
  enabled  = '1',
  gpgcheck = '0',
 }
 yumrepo { 'Company_EL6_Repo':
  baseurl  = 'http://hostname.domain.com/repo.el6',
  descr    = 'Company EL6 Repository',
  enabled  = '1',
  gpgcheck = '0',
 }
 }

 the job reports as running correctly and I get:

 Yumrepo[RHEL6.1_Repo] (/etc/puppetlabs/puppet/modules/yumrepos/
 manifests/init.pp:7)
 Yumrepo[Company_EL6_Repo] (/etc/puppetlabs/puppet/modules/yumrepos/
 manifests/init.pp:13)

 in my event log, but the repos are not correctly added to the node.

 I have run yum clean all and yum makecache, and also removed the class
 from the node and re-added it, and still get the same output.  This is
 on PE 1.2 evaluation running on a single RHEL6.1 node (master +
 agent).

 The only thing I get in the log is Finished catalog run in 0.61
 seconds since Puppet doesn't see the repos as changed even though
 they are missing.

 Do I need to manually create the files underneath /etc/yum.repos.d?
 That is fine but I don't see that in the docs.  Can anyone tell what I
 am doing wrong?


I ran your file locally and had it work fine.  The Yumrepo type will
create the files in /etc/yum.repos.d.

Are you positive you are including the class that contains these resources?


I made a file called foo.pp with the manifest you provided. At the
bottom I added the line
   include yumrepos

Then I ran
   puppet apply --verbose foo.pp

After that, I had the files configured the way I would expect.

There are several possibility for what could be problematic, but I'm
sure exactly where to start.  I often blame SELinux and iptables ;)


Could you run in debug or verbose mode?  Are you classifying in the
dashboard only?

-- 
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] Could not render to b64_zlib_yaml after 2.6.12 upgrade

2011-11-08 Thread Corey Osman
Hi,

I just reinstalled puppet to version 2.6.12 to patch the security bug. Now all 
of my RHEL4 clients are getting this error:
Puppet master is running 2.7.6
Clients are running 2.6.12


puppet-agent[11444]: Starting Puppet client version 2.6.12
slcdbnops1 puppet-agent[11444]: Could not run Puppet configuration client: 
Could not render to b64_zlib_yaml: uninitialized constant Base64


Any ideas?  Is this a ruby problem?

Corey Osman
co...@logicminds.biz

Green I.T and Datacenter Automation Specialist



-- 
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] puppet repo layout for common config settings

2011-11-08 Thread S Ahmed
So a module structure looks like:

/puppet/modules/ssh/{files, templates, manifests}
/puppet/modules/ssh/manifests/init.pp

Now the init.pp can get to be a large file, so its common to break things
out like .e.g.

install.pp
config.pp
service.pp

And then the init.pp will look like:

class ssh
  include ssh::install, ssh::config, ssh::service

You can also place parameters in:

/puppet/modules/ssh/manifests/params.pp


Do you create another params type class but something that might act at a
global level?  If so, what kind of things did you end up putting there?

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