Re: [Puppet Users] Re: [SOLVED] Re: Error 400 on SERVER: no 'environments' in {:root_environment=#Puppet::Node::Environment:0x7f784c700668 @name=:*root*, @manifest=/usr/share/puppet/rack/puppetma

2014-05-30 Thread Adrián López Tejedor
Thanks!

Google is not smart enough to find that ticket with the pattern no 
'environments' in {:root_environment=#Puppet::Node::Environment :/


El jueves, 29 de mayo de 2014 17:50:51 UTC+2, Josh Cooper escribió:




 On Thu, May 29, 2014 at 6:08 AM, Adrián López Tejedor adri...@gmail.com 
 javascript: wrote:

 Downgrade to 3.5.1 since last message and running without problems.

 El jueves, 29 de mayo de 2014 14:22:51 UTC+2, Adrián López Tejedor 
 escribió:

 I am having the same problem but I only have uppet-server-3.6.1, without 
 passenger, dashboard, etc.
 It works correctly for 10' more or less, then start to give errors like:

 May 29 14:15:21 HOSTNAME puppet-master[30831]: no 'environments' in 
 {:root_environment=#Puppet::Node::Environment:0x7f654f667018 
 @config_version=nil, @manifest=/etc/puppet, @name=:*root*, 
 @modulepath=[], @watching=true, :current_environment=#
 Puppet::Node::Environment:0x7f654f667018 @config_version=nil, 
 @manifest=/etc/puppet, @name=:*root*, @modulepath=[], @watching=true} 
 at top of [[0, nil, nil]]


 This is https://jira.puppetlabs.com/browse/PUP-2659 which only affects 
 webrick masters when handling concurrent requests. This will be fixed in an 
 upcoming 3.6.2 release.
  


 El viernes, 9 de mayo de 2014 11:27:43 UTC+2, Luca Mazzaferro escribió:

 Hi again,
 problem solved.
 I re-installed also the puppet-dashboard following official information 
 here:

 http://docs.puppetlabs.com/dashboard/manual/1.2/
 bootstrapping.html#installing-from-git

 There is an error on the provided *dashboard-vhost.conf*:
 there variable 

 *RailsAutoDetect*

 is not supported since passenger 4.0.0 

 http://www.modrails.com/documentation/Users%20guide%20Apache.html#_
 railsautodetect_rackautodetect_and_wsgiautodetect

 I used instead 
 PassengerEnabled On

 Cheers and good luck.

 Luca

 Il giorno venerdì 9 maggio 2014 09:51:10 UTC+2, Luca Mazzaferro ha 
 scritto:


 Hi,
 thank you for this suggestion.
 Probably you are right, indeed; the problem should be there.
 Actually the Puppet-Passenger system is working again what I did on my 
 SL6 is:

 Update the rack and passenger from the version passenger-4.0.41 
 to passenger-4.0.42
 gem install rack passenger
 run again the passenger module installation command for apache2.
 passenger-install-apache2-module
  
 These two actions didn't solve the situation but when I copied again 
 the config.ru 

 cp /usr/share/puppet/ext/rack/config.ru /usr/share/puppet/rack/
 puppetmasterd/

 it starts to work again.

 What I guess is this: the Dashboard installation in some way rewrote 
 the config.ru and create the problem.
 I will try to install it again making a bkp copy of config.ru before.

 Is it possible? Anyone experienced something like this?
 I'll keep you updated.
 Cheers.


 Il giorno giovedì 8 maggio 2014 20:45:21 UTC+2, twm...@gmail.com ha 
 scritto:

 Check your config.ru and make sure it is correct and in the right 
 location. I had an old one from Foreman there and that was breaking the 
 system apparently. 

  -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to puppet-users...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/f69e4766-9344-4f79-ad64-619962da8092%40googlegroups.com
  
 https://groups.google.com/d/msgid/puppet-users/f69e4766-9344-4f79-ad64-619962da8092%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.




 -- 
 Josh Cooper
 Developer, Puppet Labs

 *Join us at PuppetConf 2014 http://www.puppetconf.com/, September 
 22-24 in San Francisco*
 *Register by May 30th to take advantage of the Early Adopter discount 
 http://links.puppetlabs.com/puppetconf-early-adopter **—**save $349!*
  

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/25db8d13-0be6-4b01-83b0-06de10b6c782%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: starting hiera + ntp module

2014-05-30 Thread Felix Frank
On 05/26/2014 10:03 PM, Matthew Herzog wrote:
 Boos to puppetlabs.

Disclaimer: I've no affiliation with Puppet Labs.

This rubs me wrong regardless.

Please note that the documentation *is* also open source, and you are
more than welcome to improve it as you see fit. Barring your ability to
contribute directly, you can still help by raising issues as bug report
tickets (as John has advised in this very thread).

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5388431B.80403%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet agent unable to pull files with puppetmaster setup in httpd with passenger

2014-05-30 Thread Brian Wilkins
I have my puppetmaster setup with httpd and mod_passenger. My agents can 
successfully pull manifests, but they are unable to pull files. As far as I 
can tell, I do not have any rewrite rules setup in my puppetmaster.conf 
(see below). In my httpd access log, I see that the agent tries to request 
the following:

GET /production/file_content/modules/company/logstash/banner? HTTP/1.1 404 
69 - -

But that fails with Could not find file_content 
modules/company/logstash/banner

What should be different in my puppetmaster.conf? This is from the 
puppetlabs documentation also:

# RHEL/CentOS:
# And the passenger performance tuning settings:
PassengerHighPerformance On
PassengerUseGlobalQueue On
# Set this to about 1.5 times the number of CPU cores in your master:
PassengerMaxPoolSize 6
# Recycle master processes after they service 1000 requests
PassengerMaxRequests 1000
# Stop processes if they sit idle for 10 minutes
PassengerPoolIdleTime 600
PassengerTempDir /var/run/passenger

Listen 8140
VirtualHost *:8140
SSLEngine On

# Only allow high security cryptography. Alter if needed for 
compatibility.
SSLProtocol All -SSLv2
SSLCipherSuite  HIGH:!ADH:RC4+RSA:-MEDIUM:-LOW:-EXP
SSLCertificateFile  /var/lib/puppet/ssl/certs/puppetmasterhost.pem
SSLCertificateKeyFile   
/var/lib/puppet/ssl/private_keys/puppetmasterhost.pem
SSLCertificateChainFile /var/lib/puppet/ssl/ca/ca_crt.pem
SSLCACertificateFile/var/lib/puppet/ssl/ca/ca_crt.pem
SSLCARevocationFile /var/lib/puppet/ssl/ca/ca_crl.pem
SSLVerifyClient optional
SSLVerifyDepth  1
SSLOptions  +StdEnvVars +ExportCertData

# These request headers are used to pass the client certificate
# authentication information on to the puppet master process
RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e
RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e
RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e

RackAutoDetect On
DocumentRoot /usr/share/puppet/rack/puppetmasterd/public/
Directory /usr/share/puppet/rack/puppetmasterd/
Options None
AllowOverride None
Order Allow,Deny
Allow from All
/Directory
/VirtualHost

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a41e1d79-c17d-4f60-8725-9ba8ae9c0409%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] params.pp/inheritance/defaults/hiera/hiera functions?

2014-05-30 Thread Brian Mathis
It sounds like you need to read through these:
http://garylarizza.com/blog/2014/02/17/puppet-workflow-part-1/
http://garylarizza.com/blog/2014/02/17/puppet-workflow-part-2/

I don't see why you'd want to remove parameters from classes.  They are
pretty critical to having a flexible infrastructure.

Some of the smaller points in those posts which I think are important (in
addition to the general pattern):
- Don't use default values in hiera.  If you don't supply (or typo) a
variable name, then the puppet run should fail.
- Don't use automatic hiera lookups.  This removes the magic and makes it
more clear to everyone that the data is coming from hiera.

For your config data showing up in other modules, I think you probably want
role or profile modules, and pass in the data as a parameter.  Your
roles/profiles should have all the custom stuff in it, not the component
modules.

Also make liberal use of the validate_* functions from stdlib to further
check your parameters have been supplied correctly.

Don't set default values to anything that is inappropriate.  If you don't
want a default for your SuperDaemon config and it needs to be explicitly
configured, then you want it to fail if no parameter is given.


❧ Brian Mathis
@orev


On Thu, May 29, 2014 at 1:58 PM, Christopher Wood 
christopher_w...@pobox.com wrote:

 (I'm not sure how to phrase my question precisely, so this may not all be
 totally clear.)

 Has anybody else successfully moved away from using params.pp and default
 values, and if so, what did you do and how did it go? If not, what made you
 go back?

 The only answer I can come up with is to stop using class parameters,
 change to hiera functions, and put all my data defaults in common.yaml.

 The background:

 I've had a couple of odd (lab) situations where much troubleshooting was
 occasioned by how I misspelled a key name in hiera and thus configuration
 data was pulled from a default value (either params.pp or the parameter
 default value). If there was no default value I would simply have gotten an
 error about the lookup failure and fixed that quickly.

 In a related matter, sometimes I need a piece of configuration data from
 one module to appear in another module. Faked-up example, my SuperDaemon
 configuration data has to be used by monit to supervise all the worker
 daemons and by logrotate to rotate their individual log files. Some things
 are data bindings, some are hiera()/hiera_array()/hiera_hash() on a case by
 case basis, and it's messy.

 In another related matter, explaining the combination of puppet
 inheritance from params.pp, default values, hiera, and hiera functions
 makes people's eyes glaze over. It would be easier to point people at hiera
 and say source of data, learn these three functions.

 Things are mostly fine, I may just be wanting to tweak things, but it
 strikes me there's a way to do all this with much less effort.

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/20140529175818.GA4308%40iniquitous.heresiarch.ca
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CALKwpEw0SPUjxYv1v2HAruacEP1XKUyvUn3dnhaE1No65ix9mQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Debugging execution error with vcsrepo

2014-05-30 Thread Bas van Meurs
I've just encountered and fixed the exact same error message.

The repo (and the .git directory in it) contained files not owned by the 
user specfied in the vcsrepo command. Ensure the ownership of the directory 
before vcsrepo-ing it:

  file { /home/myuser/myrepo:
ensure  = directory,
recurse = true,
owner = 'myrepo',
mode = 0774,
  }

  vcsrepo { /home/myuser/myrepo:
require  = [Class[sshd], File['/home/myuser/myrepo']],
ensure   = present,
provider = git,
source   = 'g...@git.myhostname.com:repos/myrepo.git',
revision = 'master',
user = 'myuser'
  }


Op maandag 23 december 2013 21:12:40 UTC+1 schreef Patrick Gibson:

 If I manually clone the repo, I get a similarly puzzling error:

 Error: /Stage[main]/myuser/Vcsrepo[/home/myuser/myrepo]: Could not 
 evaluate: Execution of '/usr/bin/su myuser -c /usr/local/bin/git config 
 remote.origin.url' returned 127: -su: /usr/local/bin/git config 
 remote.origin.url: No such file or directory



 On Saturday, 21 December 2013 18:33:45 UTC-8, Patrick Gibson wrote:

 I'm using the vcsrepo module to clone a git repo as a particular user, 
 and I'm getting a puzzling error:

 Debug: Executing '/usr/bin/su myuser -c /usr/local/bin/git clone 
 g...@git.myhostname.com:repos/myrepo.git /home/myuser/myrepo'
 Error: Execution of '/usr/bin/su myuser -c /usr/local/bin/git clone 
 g...@git.myhostname.com:repos/myrepo.git /home/myuser/myrepo' returned 127: 
 su: /usr/local/bin/git clone g...@git.myhostname.com:repos/myrepo.git 
 /home/myuser/myrepo: No such file or directory

 When I copy and paste the exact command and run it, it works fine. I 
 can't figure out what would be complaining about No such file or 
 directory. Every executable and path mentioned in the command exists. 

 My relevant classes look like this:

 class sshd {
   file { /etc/ssh/sshd_config:
 source = puppet:///modules/sshd/sshd_config,
 notify = Service[sshd]
   }

   file { /etc/ssh/ssh_config:
 source = puppet:///modules/sshd/ssh_config,
 notify = Service[sshd]
   }

   service { sshd:
 ensure = running,
   }
 }

 class myuser {
   file { /home/myuser/.ssh:
 ensure = directory,
 mode   = 0700,
 owner  = myuser,
 group  = myuser,
   }

   file { /home/myuser/.ssh/known_hosts:
 source = puppet:///modules/myuser/.ssh/known_hosts,
 owner  = myuser,
 group  = myuser,
   }

   file { /home/myuser/.ssh/id_rsa:
 source = puppet:///modules/myuser/.ssh/id_rsa,
 mode   = 0600,
 owner  = myuser,
 group  = myuser,
   }

   vcsrepo { /home/myuser/myrepo:
 require  = Class[sshd],
 ensure   = present,
 provider = git,
 source   = 'g...@git.myhostname.com:repos/myrepo.git',
 revision = 'master',
 user = 'myuser'
   }
 }

 Any pointers?



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d84f8bdb-587e-45f0-9647-648243c0d70e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Error 400 on SERVER : could not find class xxx for yyy on node yyy

2014-05-30 Thread Christian Charpentier
Hi,
I'm statrting using puppet with role/profile pattern and i'm facing a 
problem.
I use puppet 3.4.3 with a master running on red hat 2.6 and a client on a 
local VM centOS 6.5.
When i try to test my code with the command above i got an error : Error 
400 on SERVER could not find class vstar::apache for puppetclient on node 
puppet client.

puppet agent --server=d0puppet.victor-buck.com --debug --verbose --noop 
--test 


Here is my puppet code :

# /etc/puppet/manifests/site.pp
import classes/*
 
case $operatingsystem {
'Solaris':  { include role::solaris }
'RedHat', 'CentOS': { include role::redhat  }
/^(Debian|Ubuntu)$/:{ include role::debian  }
default:{ include role::generic }
}

case $hostname {
/^puppetclient/:   { include vstar::roles::www }
}

#/etc/puppet/modules/vstar/manifests/roles/www.pp
class vstar::roles::www { 
  include vstar::profiles::webserver
  include vstar::profiles::mailserver
}

#/etc/puppet/modules/vstar/manifests/profiles/webserver.pp
class vstar::profiles::webserver { 
  include vstar::apache
  include common::postfix
}

#/etc/puppet/modules/vstar/manifests/apache/manifests/init.pp
class vstar::apache { 
  include apache::install, apache::service
}

I can't figure out the issue here. Any idea on the solution to fix this?
Any comment or idea is welcome.

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/75a4d45f-9259-40c9-887e-c717b0d67c94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Error 400 on SERVER : could not find class xxx for yyy on node yyy

2014-05-30 Thread José Luis Ledesma
Class vstar::apache  should be in

/etc/puppet/modules/vstar/manifests/apache.pp

To allow autoloader find it.

Regards,
El 30/05/2014 15:48, Christian Charpentier char...@gmail.com escribió:

 Hi,
 I'm statrting using puppet with role/profile pattern and i'm facing a
 problem.
 I use puppet 3.4.3 with a master running on red hat 2.6 and a client on a
 local VM centOS 6.5.
 When i try to test my code with the command above i got an error : Error
 400 on SERVER could not find class vstar::apache for puppetclient on node
 puppet client.

 puppet agent --server=d0puppet.victor-buck.com --debug --verbose --noop
 --test


 Here is my puppet code :

 # /etc/puppet/manifests/site.pp
 import classes/*

 case $operatingsystem {
 'Solaris':  { include role::solaris }
 'RedHat', 'CentOS': { include role::redhat  }
 /^(Debian|Ubuntu)$/:{ include role::debian  }
 default:{ include role::generic }
 }

 case $hostname {
 /^puppetclient/:   { include vstar::roles::www }
 }

 #/etc/puppet/modules/vstar/manifests/roles/www.pp
 class vstar::roles::www {
   include vstar::profiles::webserver
   include vstar::profiles::mailserver
 }

 #/etc/puppet/modules/vstar/manifests/profiles/webserver.pp
 class vstar::profiles::webserver {
   include vstar::apache
   include common::postfix
 }

 #/etc/puppet/modules/vstar/manifests/apache/manifests/init.pp
 class vstar::apache {
   include apache::install, apache::service
 }

 I can't figure out the issue here. Any idea on the solution to fix this?
 Any comment or idea is welcome.

 Thanks.

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/75a4d45f-9259-40c9-887e-c717b0d67c94%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/75a4d45f-9259-40c9-887e-c717b0d67c94%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAF_B3df0dxCoBCPSKtXcy3u4ss9g6fWocgqjEAm2X5Zb9%2BR9XQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] puppetdb '[replace catalog]' postgresql errors with index 'catalog_resources_pkey'

2014-05-30 Thread Mathew Crane
I am moving our environment from puppet 2.7.1 with puppet dashboard to 
puppet 3.5.1 with puppetdb 2.0. During testing on a separate host with the 
identical setup as our puppet CA, everything seems to be functioning 
properly: puppet agents are able to be added on the master and receive 
everything they should, and I'm able to query the pgsl db and API and view 
information and facts. However, I've noticed two concerning things in the 
logs below. 

I am by no means a pgsl expert, and after enabling debug logging I'm unable 
to tell why it's firing these alerts.  Do I need to tune the db somehow, or 
is there something off in my configs? 

1.) After inserting node information into catalog_resources, an error 
occurs in /var/log/puppetdb/puppetdb.log:

2014-05-30 08:20:15,328 ERROR [c.p.p.command] [...] [replace catalog] 
Retrying after attempt 6, due to: org.postgresql.util.PSQLException: ERROR: 
index row size 4296 exceeds maximum 2712 for index catalog_resources_pkey
  Hint: Values larger than 1/3 of a buffer page cannot be indexed.
Consider a function index of an MD5 hash of the value, or use full text 
indexing.

2.) Additionally, I am seeing a lot of deprecation warnings in 
/var/log/puppetdb/puppetdb.log, like below. I would think that puppet 3.5.1 
with puppetdb 2.0 wouldn't fire these? Are they safe to ignore?

'2014-05-30 08:39:36,021 WARN  [c.p.p.command] command 'replace catalog' 
version 3 is deprecated, use the latest version'

Here is my config on the test CA:
/etc/puppet/puppet.conf:
[main]
logdir = /var/log/puppet
rundir = /var/run/puppet
ssldir = $vardir/ssl

[agent]
server = puppetca.fqdn
environment = live
classfile = $vardir/classes.txt
localconfig = $vardir/localconfig
pluginsync = true


[master]
environment = live
certname = puppetca.fqdn
dns_alt_names = puppetca
ca_name = 'TEST CA'
storeconfigs = true
storeconfigs_backend = puppetdb
reports = store,puppetdb
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
pluginsync=true


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/78db99c9-74a9-46f8-ad91-a251d5922f08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetdb '[replace catalog]' postgresql errors with index 'catalog_resources_pkey'

2014-05-30 Thread Ken Barber
 I am moving our environment from puppet 2.7.1 with puppet dashboard to
 puppet 3.5.1 with puppetdb 2.0. During testing on a separate host with the
 identical setup as our puppet CA, everything seems to be functioning
 properly: puppet agents are able to be added on the master and receive
 everything they should, and I'm able to query the pgsl db and API and view
 information and facts. However, I've noticed two concerning things in the
 logs below.

 I am by no means a pgsl expert, and after enabling debug logging I'm unable
 to tell why it's firing these alerts.  Do I need to tune the db somehow, or
 is there something off in my configs?

 1.) After inserting node information into catalog_resources, an error occurs
 in /var/log/puppetdb/puppetdb.log:

 2014-05-30 08:20:15,328 ERROR [c.p.p.command] [...] [replace catalog]
 Retrying after attempt 6, due to: org.postgresql.util.PSQLException: ERROR:
 index row size 4296 exceeds maximum 2712 for index catalog_resources_pkey
   Hint: Values larger than 1/3 of a buffer page cannot be indexed.
 Consider a function index of an MD5 hash of the value, or use full text
 indexing.

Now this is a new one for me ... the catalog_resources_pkey is
actually a combination of, the catalog_id (bigint), the type and title
(both text fields).

Sounds like either the type or title has exceeded the index maximum
size, which is very uncommon but I can see how this might happen.

It would be very hard to create a large resource type, but not
impossible. Whats more likely is that the title of one of your
resources is excessively large. This is possible most likely with an
exec {} or something similar that uses a very large command as the
title of the exec, instead of putting it in the command parameter like
so: 
http://docs.puppetlabs.com/references/latest/type.html#exec-attribute-command.
Either that, or something very similar.

Without seeing your catalog however I can only guess. However you
might be able to track this down yourself. If you go onto the node
that is seemingly throwing the error, you can analyze the catalog file
and track down any elongated titles or types that might be triggering
this. Here is an example of how I would go about it:
https://gist.github.com/kbarber/b60798cc0ba4f262ae1e. To get a
compiled catalog you may need to temporarily disable puppetdb for this
to be created, either way - if you can get a hold of the catalog I
think we can find our answers.

BTW this might be considered a bug, and might call for better
normalisation in our schema to avoid this. Having said that, a type
and title combination this excessive is very abnormal, so it might be
something we want to stop from happening in Puppet anyway :-). So
weither this is a bug for puppet or puppetdb we'll have to determine.

 2.) Additionally, I am seeing a lot of deprecation warnings in
 /var/log/puppetdb/puppetdb.log, like below. I would think that puppet 3.5.1
 with puppetdb 2.0 wouldn't fire these? Are they safe to ignore?

 '2014-05-30 08:39:36,021 WARN  [c.p.p.command] command 'replace catalog'
 version 3 is deprecated, use the latest version'

This looks like you haven't upgraded puppetdb-terminus to the latest
version (2.0.0) on your puppet master. We've bumped the command
version to 4 now, this looks like its just the old code. Also people
often forget to restart the Apache process when upgrading the terminus
code, don't forget to do that.

ken.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAE4bNTnEC%2BZ3zXVxPAjTL313tDqJmE%2BiiBK01edxyT-GMSB5ig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet update to 3.6.1 causes Error 400 on SERVER: no 'environments' in ...

2014-05-30 Thread joe
How did you not define any environments. I've removed the 
/etc/puppet/environments folder and have no envs. set anywhere else. Still 
happens with WebRick.

On Tuesday, May 27, 2014 1:31:34 PM UTC-2:30, Atom Powers wrote:

 I struggled with this for a while on Friday.
 The error doesn't occur until a few minutes after WebBrick is started.
 I found that if I don't define an environment for the host then the error 
 doesn't occur.
 I wasn't able to get it working with an environment, even with directory 
 environments setup correctly.


 On Tue, May 27, 2014 at 6:23 AM, Anton Lindstrom an...@alley.se 
 javascript: wrote:

 There's a ticket open for that issue at 
 https://tickets.puppetlabs.com/browse/PUP-2659

 // Anton


 On Mon, May 26, 2014 at 7:21 PM, j...@rocketcitystudios.com 
 javascript: wrote:

 After upgrading to Puppet 3.6.1 I get this error:

 Warning: Error 400 on SERVER: no 'environments' in 
 {:root_environment=#Puppet::Node::Environment:0x7f7453299a90 
 @config_version=nil, @manifest=/, @modulepath=[], @watching=true, 
 @name=:*root*, 
 :current_environment=#Puppet::Node::Environment:0x7f7453299a90 
 @config_version=nil, @manifest=/, @modulepath=[], @watching=true, 
 @name=:*root*} at top of [[0, nil, nil]]

 Any ideas?

 -- 
 You received this message because you are subscribed to the Google 
 Groups Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to puppet-users...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/da9dc89b-0f5c-4807-b113-32d0bbd233fd%40googlegroups.com
  
 https://groups.google.com/d/msgid/puppet-users/da9dc89b-0f5c-4807-b113-32d0bbd233fd%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  -- 
 You received this message because you are subscribed to the Google Groups 
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to puppet-users...@googlegroups.com javascript:.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/puppet-users/CAG_x02Y8B4kDhTsRqyaEMGa2U76ZzJ7MpMKqOVi2%3DTmeEOneig%40mail.gmail.com
  
 https://groups.google.com/d/msgid/puppet-users/CAG_x02Y8B4kDhTsRqyaEMGa2U76ZzJ7MpMKqOVi2%3DTmeEOneig%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.




 -- 
 Perfection is just a word I use occasionally with mustard.
 --Atom Powers-- 


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/789a00eb-5df9-4bd7-9f68-74f714a7b0b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet update to 3.6.1 causes Error 400 on SERVER: no 'environments' in ...

2014-05-30 Thread Atom Powers
Don't define an environment in your config file, master or client, and
don't define an environment through your ENC or as a fact. (I think that is
all the ways.)
On May 30, 2014 11:06 AM, j...@rocketcitystudios.com wrote:

 How did you not define any environments. I've removed the
 /etc/puppet/environments folder and have no envs. set anywhere else. Still
 happens with WebRick.

 On Tuesday, May 27, 2014 1:31:34 PM UTC-2:30, Atom Powers wrote:

 I struggled with this for a while on Friday.
 The error doesn't occur until a few minutes after WebBrick is started.
 I found that if I don't define an environment for the host then the error
 doesn't occur.
 I wasn't able to get it working with an environment, even with directory
 environments setup correctly.


 On Tue, May 27, 2014 at 6:23 AM, Anton Lindstrom an...@alley.se wrote:

 There's a ticket open for that issue at https://tickets.puppetlabs.
 com/browse/PUP-2659

 // Anton


 On Mon, May 26, 2014 at 7:21 PM, j...@rocketcitystudios.com wrote:

 After upgrading to Puppet 3.6.1 I get this error:

 Warning: Error 400 on SERVER: no 'environments' in
 {:root_environment=#Puppet::Node::Environment:0x7f7453299a90
 @config_version=nil, @manifest=/, @modulepath=[], @watching=true,
 @name=:*root*, 
 :current_environment=#Puppet::Node::Environment:0x7f7453299a90
 @config_version=nil, @manifest=/, @modulepath=[], @watching=true,
 @name=:*root*} at top of [[0, nil, nil]]

 Any ideas?

 --
 You received this message because you are subscribed to the Google
 Groups Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to puppet-users...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/puppet-users/da9dc89b-0f5c-4807-b113-32d0bbd233fd%
 40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/da9dc89b-0f5c-4807-b113-32d0bbd233fd%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google
 Groups Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to puppet-users...@googlegroups.com.
 To view this discussion on the web visit https://groups.google.com/d/
 msgid/puppet-users/CAG_x02Y8B4kDhTsRqyaEMGa2U76ZzJ7Mp
 MKqOVi2%3DTmeEOneig%40mail.gmail.com
 https://groups.google.com/d/msgid/puppet-users/CAG_x02Y8B4kDhTsRqyaEMGa2U76ZzJ7MpMKqOVi2%3DTmeEOneig%40mail.gmail.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.




 --
 Perfection is just a word I use occasionally with mustard.
 --Atom Powers--

  --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/789a00eb-5df9-4bd7-9f68-74f714a7b0b9%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/789a00eb-5df9-4bd7-9f68-74f714a7b0b9%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAF-H%3DO%3DRVZgUwm%2BLG2U1dOvZMwzsBfF4nkrg%3DB4w9QbWPaK1uw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] File Recurse Error?

2014-05-30 Thread Mark McFate
I've introduced the following code into one of my working manifests, and am 
now returning an error that I don't understand at all.  I've searched the 
web for a similar instance of this error but found none that seem relevant. 
 

The code is...

  ## Roll in the entire theme folder.
  file { ${drupal_path}/sites/default/themes/DG :
source  = puppet://modules/digital-grinnell/DG,
recurse = true,
recurselimit = 3,
require = File[ ${drupal_path}/sites/default/themes ],
  }


The error returned is:  Failed to generate additional resources using 
'eval_generate': getaddrinfo: Name or service not known.

The source resource (a directory) does exist and if I bring it into the 
server via FTP it behaves as expected; however, I can't get Puppet (using 
this with Vagrant) to populate the server directory for me.

I'm going to try bringing in one or two of the individual files to see if 
that works or not, but there are dozens of files involved so I can't 
possibly rely on that approach going forward.  

Thanks in advance for any assist.

-Mark

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/716d2fa3-4dee-42fd-a49b-0b4c9471582e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] File Recurse Error?

2014-05-30 Thread Felix Frank
Hi,

On 05/30/2014 06:16 PM, Mark McFate wrote:
 The error returned is:  Failed to generate additional resources using
 'eval_generate': getaddrinfo: Name or service not known.

you're in luck - 'modules' does not resolve to an actual machine's
address in your environment.

You lack one / in your URL - it's puppet:/// rather than puppet://.

HTH,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5388AF63.50508%40alumni.tu-berlin.de.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] how to fork a Windows exe

2014-05-30 Thread Bill N
Hi,

Just wrote my first puppet module for Windows  provisioning. All is working 
well except I am having a problem running a windows exe file in that Puppet 
appears to wait for the exe to complete. At least this is the case when I 
run Puppet agent --test from the Windows Server command line.

What I want to do here is install a set of files for a Riemann monitoring 
client on several Windows Server 2008 R1 VMs. These files include an exe, 
which I want to start and run in perpetuity. I don't want Puppet to wait 
for this process to complete. It appears I could run the exe in a separate 
shell using cmd.exe, but when I try that on the command line I do not see 
the named process running in the Resource Monitor. I only see cmd.exe 
running. This is not very informative.

My question is, what is the best way to run this executable via Puppet? 
Should I convert the exe to a Windows service, install that and run it as a 
service? Should I use shell cmd and live with the unhelpful Resource 
Monitor listing? Or should I use Power Shell to fork the process like I 
would in linux?

Any help would be most appreciated.  

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/07c840a9-4c52-4b99-b24c-ffc10c1f19a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: starting hiera + ntp module

2014-05-30 Thread Spencer Krum
I actually already made this change and pushed it. Nick merged it
yesterday.
On May 30, 2014 1:37 AM, Felix Frank felix.fr...@alumni.tu-berlin.de
wrote:

 On 05/26/2014 10:03 PM, Matthew Herzog wrote:
  Boos to puppetlabs.

 Disclaimer: I've no affiliation with Puppet Labs.

 This rubs me wrong regardless.

 Please note that the documentation *is* also open source, and you are
 more than welcome to improve it as you see fit. Barring your ability to
 contribute directly, you can still help by raising issues as bug report
 tickets (as John has advised in this very thread).

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/5388431B.80403%40alumni.tu-berlin.de
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CADt6FWP0d7QaUeEJfDLZZT4VuStMVdDa%3Db0vDS-JROF7W6%3DY8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] File Recurse Error?

2014-05-30 Thread Mark McFate
Thank you Felix!  You saved the day.  As usual, I did a cut/paste to build 
this portion of my manifest.  I have no idea how that / got removed, and 
since this was my first use of recurse I just assumed I was doing it wrong.

Thanks again.  Take care.

-Mark

On Friday, May 30, 2014 11:18:54 AM UTC-5, Felix.Frank wrote:

 Hi, 

 On 05/30/2014 06:16 PM, Mark McFate wrote: 
  The error returned is:  Failed to generate additional resources using 
  'eval_generate': getaddrinfo: Name or service not known. 

 you're in luck - 'modules' does not resolve to an actual machine's 
 address in your environment. 

 You lack one / in your URL - it's puppet:/// rather than puppet://. 

 HTH, 
 Felix 


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5c5a4349-5bfa-43e2-b177-8720f96c60e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Re: Custom Fact Help? Works in ruby, but not facter...

2014-05-30 Thread smalderma
John,
  Thanks for the assist.  I guess I was working from a less than stellar 
example.

On Thursday, May 29, 2014 9:53:14 AM UTC-4, jcbollinger wrote:



 On Wednesday, May 28, 2014 9:16:47 AM UTC-5, smalderma wrote:

 Hi,

 I'm working on custom fact that uses Facter::Util::Resolution.exec to run 
 a command that returns output I want to parse with regex.  If I write up a 
 ruby shell script like:

 #!/usr/bin/ruby

 out = `command`
 out = out.gsub!(/regex/, \\1\\3)
 puts #{out}

 The desired output comes to the screen, every time, and on every system I 
 run it.

 If I modify the script to be a fact like so:

 # custom fact
 require 'facter'
 Facter.add(:newfact) do
   out = Facter::Util::Resolution.exec(command)
   out = out.gsub!(/regex/, \\1\\3)
   secode { out }
 end

 A puppet run actually prints the full output of the command twice after 
 syncing the fact.  Running facter -p newfact does the same.  On top, the 
 printed output is the raw output not the regex filtered.

 What am I doing wrong here?



 For one thing, you are performing your fact evaluation outside the setcode 
 {} block.  The part in the block passed to Facter.add() but outside setcode 
 {} runs when the fact is added to Facter, but the part inside the setcode 
 {} block is run when the fact is evaluated.  I speculate that you are 
 getting output both times.  

 There are very few statements that should ever appear in that middle 
 area.  The one that comes first to mind is 'confine', and others would be 
 similar Facter-specific things.

 Your fact should look more like this:

 require 'facter'
 Facter.add(:newfact) do
   setcode {
 out = Facter::Util::Resolution.exec('command')

 # F::U::R::exec() may return nil
 out or out.gsub(/regex/, \\1\\3)
   }
 end


 Note that whatever value is returned by the setcode {} block is taken as 
 the value of the fact.  There is no particular advantage to assigning it to 
 a variable first, though it is harmless to do so.


 John



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8e04eee8-ff63-47ca-9221-e225dd6ec5f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] is there any way the audit the contents of a file using puppet

2014-05-30 Thread Supriya Uppalapati
Hi,
 
Is there any way to audit the contents of a file using no-op mode in puppet.
 
Help me
 

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e621eea4-4fac-4e35-8866-5af76290c3d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] puppetdb '[replace catalog]' postgresql errors with index 'catalog_resources_pkey'

2014-05-30 Thread Mathew Crane
 

 It would be very hard to create a large resource type, but not 
 impossible. Whats more likely is that the title of one of your 
 resources is excessively large. This is possible most likely with an 
 exec {} or something similar that uses a very large command as the 
 title of the exec, instead of putting it in the command parameter like 
 so: 
 http://docs.puppetlabs.com/references/latest/type.html#exec-attribute-command.
  

 Either that, or something very similar. 


Thank you for the quick, thorough, and incredibly helpful reply. You 
pointed me in the right direction. Turns out we had an older module that 
was doing just what you suspected.  There were two titles of over 370 
characters apiece.  Here is the original 
module: 
https://github.com/puppet-modules/puppet-common/blob/master/manifests/defines/line.pp

Command used to troubleshoot:
cat /var/lib/puppet/client_data/catalog/puppetca.fqdn.json | python 
-mjson.tool | grep title

I resolved this issue by changing all execs to named execs, differentiated 
by the '${file}' variable passed into the script to avoid duplicate 
declarations. For example, exec { name: d_line_ensure_present_${file}: 
command = ... } 

Checking the logs, I no longer see the errors. 

BTW this might be considered a bug, and might call for better 
 normalisation in our schema to avoid this. Having said that, a type 
 and title combination this excessive is very abnormal, so it might be 
 something we want to stop from happening in Puppet anyway :-). So 
 weither this is a bug for puppet or puppetdb we'll have to determine. 


Let me know if you need any more information from my end on this.
 

 This looks like you haven't upgraded puppetdb-terminus to the latest 
 version (2.0.0) on your puppet master. We've bumped the command 
 version to 4 now, this looks like its just the old code. Also people 
 often forget to restart the Apache process when upgrading the terminus 
 code, don't forget to do that. 


puppetdb-terminus was updated along with puppetdb, but httpd had not been 
restarted.  

Thanks again, Ken!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/712433e1-f047-4367-a8da-80aa22d1752d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] how to set loglevel= debug in puppet

2014-05-30 Thread Supriya Uppalapati
Hi,
 
How to set loglevel=debug in puppet to get detailed information of what 
commands puppet is executing when it runs puppet agent.
 
In cd /etc/puppetlabs/mcollective/server.cfg file I edited loglevel=debug. 
But aftersome time it is changing to loglevel=info
 
How do I set loglevel=debug in puppet?
 
Let me know

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d97d0df8-874e-47f0-9db3-66eb805119e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] how to fork a Windows exe

2014-05-30 Thread Brian Mathis
AFAIK, Windows does not have a true fork capability.  Here are some ideas
that might help:

- Use srvany (or something else) to define a custom service.  It sounds
like this is probably what you really should be doing anyway.  Puppet is
not meant to control programs over a long term (i.e. services), it's meant
to setup other things that control them.  The Windows service framework is
meant to do that.

- Create a schedule task to run your command

- Use the start command to start the process.


❧ Brian Mathis
@orev


On Fri, May 30, 2014 at 12:11 PM, Bill N bluevox@gmail.com wrote:

 Hi,

 Just wrote my first puppet module for Windows  provisioning. All is
 working well except I am having a problem running a windows exe file in
 that Puppet appears to wait for the exe to complete. At least this is the
 case when I run Puppet agent --test from the Windows Server command line.

 What I want to do here is install a set of files for a Riemann monitoring
 client on several Windows Server 2008 R1 VMs. These files include an exe,
 which I want to start and run in perpetuity. I don't want Puppet to wait
 for this process to complete. It appears I could run the exe in a separate
 shell using cmd.exe, but when I try that on the command line I do not see
 the named process running in the Resource Monitor. I only see cmd.exe
 running. This is not very informative.

 My question is, what is the best way to run this executable via Puppet?
 Should I convert the exe to a Windows service, install that and run it as a
 service? Should I use shell cmd and live with the unhelpful Resource
 Monitor listing? Or should I use Power Shell to fork the process like I
 would in linux?

 Any help would be most appreciated.

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/07c840a9-4c52-4b99-b24c-ffc10c1f19a9%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/07c840a9-4c52-4b99-b24c-ffc10c1f19a9%40googlegroups.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CALKwpEwEOoTvVcPRypNSHF%3DZGkw6o6SwtRe_Eafz0uJ6Pzk7ug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] params.pp/inheritance/defaults/hiera/hiera functions?

2014-05-30 Thread Christopher Wood
On Thu, May 29, 2014 at 02:26:21PM -0400, Brian Mathis wrote:

It sounds like you need to read through these:
    [1]http://garylarizza.com/blog/2014/02/17/puppet-workflow-part-1/
    [2]http://garylarizza.com/blog/2014/02/17/puppet-workflow-part-2/

I've read those and recommended them, but I think there would be a scale 
problem if I took the advice literally. Quoth Ramin K. earlier,  I think there 
is a distinction between small systems and large ones which affect both our 
point of views.

https://groups.google.com/forum/#!msg/puppet-users/Lr6GrZziP6A/FpFqNbP9JeYJ

I'm not going for a large site, but still:

$ egrep -r '^(class|define)' modules | wc -l
709
$ egrep -r '^  \$' modules | wc -l
2094
$ egrep -r '^[a-z]' hieradata | wc -l
1690

If I put all the lookups used for one middling technology-specific wrapper 
(class) into that class I would start at tens of lookups in that class with 
some used in several places. That verges on difficult to understand, at least 
for me.

I'm also pondering the techniques used to figure out what information is used 
where. If hiera*() lookups are everywhere I can grep for the key name and find 
the classes using that key. If they're used in one place then I have to go 
hunting through the various class parameters and variable assignments. Still 
undecided.

Otherwise to the puppet workflow posts, misc points:

-params.pp, inheritance:

I disagree for the reason, stated differently below, that mixing data sources 
and lookup methods makes troubleshooting harder than it has to be.

-hiera lookups in components, visibility:

This is where I ponder whether I shouldn't just put all the variable data in 
hiera anyway, rather than struggle with where any data piece came from.

-compatibility

This sadly isn't a concern, for various corporate reasons likely none of the 
puppet stuff here is seeing the light of day.

-profiles are technology specific

I'd add the caveat that said technology also includes the various cron jobs, 
milters, modules, ancillary daemons, ACLs, monitors, and other shims that a 
mature system is encrusted with. Probably why I'm having trouble with magnitude.

I don't see why you'd want to remove parameters from classes.  They are
pretty critical to having a flexible infrastructure.

I think I'd phrase it better if I said that I don't necessarily need data 
bindings to have classes function in a parameterized fashion. But like the blog 
post, I will be happy to see the back of all my class parameters.

Some of the smaller points in those posts which I think are important (in
addition to the general pattern):
- Don't use default values in hiera.  If you don't supply (or typo) a
variable name, then the puppet run should fail.

There's a point, and per my grep I have two default values in use in manifests. 
I'll move those to hiera, since we have some legitimate cases for an empty 
default.

- Don't use automatic hiera lookups.  This removes the magic and makes it
more clear to everyone that the data is coming from hiera.

For your config data showing up in other modules, I think you probably
want role or profile modules, and pass in the data as a parameter.  Your
roles/profiles should have all the custom stuff in it, not the component
modules.

Also make liberal use of the validate_* functions from stdlib to further
check your parameters have been supplied correctly.

I hadn't thought of that! This will be a useful Friday activity in the dev repo.

Don't set default values to anything that is inappropriate.  If you don't
want a default for your SuperDaemon config and it needs to be explicitly
configured, then you want it to fail if no parameter is given.
❧ Brian Mathis
@orev
 
On Thu, May 29, 2014 at 1:58 PM, Christopher Wood
[3]christopher_w...@pobox.com wrote:
 
  (I'm not sure how to phrase my question precisely, so this may not all
  be totally clear.)
 
  Has anybody else successfully moved away from using params.pp and
  default values, and if so, what did you do and how did it go? If not,
  what made you go back?
 
  The only answer I can come up with is to stop using class parameters,
  change to hiera functions, and put all my data defaults in common.yaml.
 
  The background:
 
  I've had a couple of odd (lab) situations where much troubleshooting was
  occasioned by how I misspelled a key name in hiera and thus
  configuration data was pulled from a default value (either params.pp or
  the parameter default value). If there was no default value I would
  simply have gotten an error about the lookup failure and fixed that
  quickly.
 
  In a related matter, sometimes I need a piece of configuration data from
  one module to appear in another module. Faked-up example, my SuperDaemon
  configuration data has to be used by monit to supervise all the worker
  daemons and by 

Re: [Puppet Users] params.pp/inheritance/defaults/hiera/hiera functions?

2014-05-30 Thread Ramin K

On 5/29/2014 10:58 AM, Christopher Wood wrote:

(I'm not sure how to phrase my question precisely, so this may not
all be totally clear.)

Has anybody else successfully moved away from using params.pp and
default values, and if so, what did you do and how did it go? If not,
what made you go back?

The only answer I can come up with is to stop using class parameters,
change to hiera functions, and put all my data defaults in
common.yaml.

The background:

I've had a couple of odd (lab) situations where much troubleshooting
was occasioned by how I misspelled a key name in hiera and thus
configuration data was pulled from a default value (either params.pp
or the parameter default value). If there was no default value I
would simply have gotten an error about the lookup failure and fixed
that quickly.

In a related matter, sometimes I need a piece of configuration data
from one module to appear in another module. Faked-up example, my
SuperDaemon configuration data has to be used by monit to supervise
all the worker daemons and by logrotate to rotate their individual
log files. Some things are data bindings, some are
hiera()/hiera_array()/hiera_hash() on a case by case basis, and it's
messy.

In another related matter, explaining the combination of puppet
inheritance from params.pp, default values, hiera, and hiera
functions makes people's eyes glaze over. It would be easier to point
people at hiera and say source of data, learn these three
functions.

Things are mostly fine, I may just be wanting to tweak things, but it
strikes me there's a way to do all this with much less effort.



I'm curious about this as well. This was my pre parametrized classes 
attempt to make it more understandable. I *think* this was a slight 
improvement, but I'm not convinced that it adds much beyond pointing a 
user where to look for the data.


class redis::params {
  $packagename = $::osfamily ? {
/(?i:debian)/ = 'redis-server',
/(?i:redhat)/ = 'redis',
  }
}

class redis::data {
  $version = hiera('redis::version','present')
}

class redis::install {
  package { $redis::params::packagename:
ensure = $redis::data::version;
  }
}

	I haven't switched over to parametrized classes mostly because the 
above already works, the limited Hiera lookup available to data 
bindings, and the great description you provided of the where is this 
data coming from problem.


	My current thinking is somewhat similar to yours. It might make sense 
to pull in RI's module data patch and use explicit Hiera calls 
everywhere. Data is always provided via Hiera, just from two locations. 
The downsides are that PL is likely going to go a different direction 
and it's a fair amount of code to change.
	However moving the cognitive overhead to the writing of code instead of 
the operating of it may be worth it till a better solution presents itself.


Ramin

--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/5388C38F.9010604%40badapple.net.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Re: Puppet 3.6.0... and scaling?

2014-05-30 Thread Konrad Scherer

On 05/27/2014 05:39 PM, Andy Parker wrote:

On Tuesday, May 27, 2014 5:53:29 AM UTC-7, Konrad Scherer wrote:

On 14-05-22 03:21 PM, Daniele Sluijters wrote:
  The environment caching is already there, use the environment_timeout
  setting. Mine is set to unlimited and I reload at deploy time by
  touching tmp/restart.txt. This so far seems to work really well.

Thanks for the suggestion. I have also been dealing with high CPU load
on my puppet masters since 3.5.0. Triggering the puppet master restart
makes a lot of sense. I am using a git post commit hook to reload the
puppet configs on my three puppet masters and I have added the code to
restart the puppet rack app after changes have been detected. I will
report back once I have had some time to analyze the results.

By puppet configs do you mean the puppet manifest files? Under rack the puppet
master doesn't watch nor reload the puppet.conf file.


That wasn't clear, sorry. I mean puppet manifest *.pp files, not the conf files.



This seems like a major change from previous puppet versions. I have
been using Puppet since 2.6 and any changes to puppet configs on the
master were always picked up immediately. Is this because the puppet
master was not doing any caching or is the puppet master watching the
puppet configs for changes? Has this behavior now changed? Will changes
to puppet manifests on the master only be detected after the
environment_timeout has expired?


The caching behavior for directory environments is a bit different from the
previous system. I've been working on a blog post about this, but haven't
finished it yet :(

First off, what is being cached? When we talk about caching environments we are
talking (mostly) about caching the parsed and validated form of the manifest
files. This saves the cost of disk access (stat to find files, reads to list
directory contents, reads to fetch manifest file contents) as well as a certain
amount of CPU use (lexing, parsing, building an AST, validating the AST). This
is what has been part of the cache for quite a while now.

What has changed is the cache eviction mechanism that is used. The directory
environments employ a different eviction and caching system that the legacy
environments. The legacy environments had singleton instances that the master
would never get rid of to track each individual environment. The environments
have references to the AST objects as well as to WatchedFile objects, which are
used to track changes to the mtime of the manifest files. The WatchedFile
instances would stat the file that they are supposed to watch, but limit the
stat calls to happen no more often than the filetimeout setting specified.
Before Puppet 3.4 (? 3.5? I lose track of what version had what change) the
WatchedFile instances would get interrogated throughout the compilation process.
In fact, every time it asked if one file had changed it ended up asking if *any*
files had changed. There were a lot of side effects of that, but I won't derail
the conversation to go in to that. In 3.4 (or was it 3.5) the legacy environment
system was changed to only check if files had changed at the beginning of a
compile. This, however, meant that it would still in the worst case issue a stat
call for every manifest file, in the best case (depending on your viewpoint)
issue no stat calls because the filetimeout had not expired, or it would be some
in-between number of stats. The in-between number of stats is possible because
each WatchedFile instance had its own timer for the filetimeout and so they can
drift apart over time, which allowed it to detect changes to some files but not
others.

For the directory environments we chose a different system for managing the
caches. The watch word here was KISS. Under the new system there isn't any file
watching involved (right now, that is. There is a PR open to introduce a
'manual' environment_timeout system), instead once an environment has loaded a
file it simply holds onto the result. All of the caching now comes down to
holding onto just the environment instance. Cache eviction is just about when
puppet should throw away that environment instance and re-create it. There are a
few options here:

   * environment_timeout = 0 : Good to use in an development setup where you are
editing manifest and running an agent to see what happens. Nothing will be
cached and so the full lex, parse, validate overhead is incurred on every agent
catalog request.
   * environment_timeout = some number : If you have spikey agent requests.
For instance, if you don't run agents continually and instead only trigger them
as needed with mco. In that case you know that from the first agent checking in
to the last agent checking in it is 20 minutes and you do this kind of on demand
deploy once a day, then just set the timeout to 30m (20 minutes + some extra
time to deal with variance). This way the cache will last through the whole 

Re: [Puppet Users] what is actually undefined method 'include?' for nil:NilClass on node error?

2014-05-30 Thread Sans
Hi Henrik,

I don't really use WEBrick but apache/passenger for the normal operation. I 
think WEBrick is used to run puppet master in background in debug mode.  Is 
there a way to use apache/passenger for that?
Anyway, I'm running puppet v2.7.3 and getting the same error for one of 
those nodes even using passenger. 

-San



On Friday, May 30, 2014 3:10:28 AM UTC+1, Henrik Lindberg wrote:

 Is this using version 3.6.x of Puppet? We are currently working on 
 webrick issues for 3.6 that are caused by concurrency problems. 
 (I noticed in the trace that you are using webrick). 

 Note that Webrick is really just suitable for light out of the box, 
 simple development test work and is not recommended for production. 

 If you switch to using passenger, do you get the same error? 

 - henrik 




-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/216861c1-5372-4fd7-909b-d93c1af81488%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Puppet 3.4.3 - Ruby in ERB

2014-05-30 Thread Eugene Brodsky
Hi all,
this used to work in Puppet 2.7, but doesn't in 3.4.3:

% case @environment
when production
foo
else
bar
end -%


this continues to work:

%= @environment % (prints the $environment var as expected).

It almost looks like Ruby isn't getting evaluated at all. Even a simple % 
puts hello % returns a blank line...

Any ideas?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/80d955b9-539d-43ac-96a8-5ece70d58d28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 3.4.3 - Ruby in ERB

2014-05-30 Thread Christopher Wood
Templates are evaluated on the puppetmaster, so % puts hello % happens 
entirely on the puppetmaster and substitutes no text.

Any reason why the first one doesn't use (%=)? I wouldn't expect it to work as 
you have it. This tag will execute the code it contains, but will not be 
replaced by a value.

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

I've heard of some other rules being tightened in the move to puppet 3, maybe 
this is one of them.

On Fri, May 30, 2014 at 12:39:09PM -0700, Eugene Brodsky wrote:
Hi all,
this used to work in Puppet 2.7, but doesn't in 3.4.3:
% case @environment
when production
        foo
else
        bar
end -%
this continues to work:
%= @environment % (prints the $environment var as expected).
It almost looks like Ruby isn't getting evaluated at all. Even a simple %
puts hello % returns a blank line...
Any ideas?
Thanks!
 
--
You received this message because you are subscribed to the Google Groups
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [1]puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit

 [2]https://groups.google.com/d/msgid/puppet-users/80d955b9-539d-43ac-96a8-5ece70d58d28%40googlegroups.com.
For more options, visit [3]https://groups.google.com/d/optout.
 
 References
 
Visible links
1. mailto:puppet-users+unsubscr...@googlegroups.com
2. 
 https://groups.google.com/d/msgid/puppet-users/80d955b9-539d-43ac-96a8-5ece70d58d28%40googlegroups.com?utm_medium=emailutm_source=footer
3. https://groups.google.com/d/optout

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20140530202017.GA13849%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 3.4.3 - Ruby in ERB

2014-05-30 Thread Eugene Brodsky
I should clarify: this is supposed to actually set a value to another 
variable that's used elsewhere in the template, e.g.:

% case @environment
when production
bucket = foo.path
else
bucket = bar.path
end -%

rewrite ^/images$ http://s3.amazonaws.com/%= @bucket %;

etc.
 
This is very simple Ruby code which I would expect to just execute, and it 
did work this way in 2.7, but if something did change from 2.7 to 3.x in 
how Ruby within ERB templates is being handled, I can't find any reference 
to it...   

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/d13e9bb9-f63a-4d4f-98e6-efb170e90516%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Puppet 3.4.3 - Ruby in ERB

2014-05-30 Thread Mike Delaney
bucket and @bucket are two different variables.

The main change in ERB templates between 2.7 and 3.x was deprecating the
use of non-class variables to pass information from the calling scope into
the template. Perhaps you got a little over-zealous prepending '@' to
variable names while fixing deprecation warnings?


On Fri, May 30, 2014 at 2:48 PM, Eugene Brodsky eug...@teehanlax.com
wrote:

 I should clarify: this is supposed to actually set a value to another
 variable that's used elsewhere in the template, e.g.:

 % case @environment
 when production
 bucket = foo.path
 else
 bucket = bar.path
 end -%

 rewrite ^/images$ http://s3.amazonaws.com/%= @bucket %;

 etc.

 This is very simple Ruby code which I would expect to just execute, and it
 did work this way in 2.7, but if something did change from 2.7 to 3.x in
 how Ruby within ERB templates is being handled, I can't find any reference
 to it...

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to puppet-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/puppet-users/d13e9bb9-f63a-4d4f-98e6-efb170e90516%40googlegroups.com
 https://groups.google.com/d/msgid/puppet-users/d13e9bb9-f63a-4d4f-98e6-efb170e90516%40googlegroups.com?utm_medium=emailutm_source=footer
 .

 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAELFvU%3DQb7vHZZ2NAsoXqjhcPYxeidnXpTOdtwH_grpMhS-Aeg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what is actually undefined method 'include?' for nil:NilClass on node error?

2014-05-30 Thread Henrik Lindberg

On 2014-30-05 20:54, Sans wrote:

Hi Henrik,

I don't really use WEBrick but apache/passenger for the normal
operation. I think WEBrick is used to run puppet master in background in
debug mode.  Is there a way to use apache/passenger for that?
Anyway, I'm running puppet v2.7.3 and getting the same error for one of
those nodes even using passenger.



Ok, then webrick is not the cause of your problem.

Run with --trace set to get a ruby stack trace. That will help to find
what is causing the problem.

- henrik











--
You received this message because you are subscribed to the Google Groups Puppet 
Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/lmavq4%24qkc%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what is actually undefined method 'include?' for nil:NilClass on node error?

2014-05-30 Thread Sans


On Friday, May 30, 2014 11:13:51 PM UTC+1, Henrik Lindberg wrote:


 Ok, then webrick is not the cause of your problem. 

 Run with --trace set to get a ruby stack trace. That will help to find 
 what is causing the problem. 

 - henrik 


Yes, that was the output from --trace and that's why I where I'm a bit 
stuck as it's not saying that much.

-San

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ed3d8bc3-629e-42b1-9138-e7ea6b6fd5f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] what is actually undefined method 'include?' for nil:NilClass on node error?

2014-05-30 Thread Ellison Marks
It's weird, but it looks like the hostname isn't being defined, or isn't 
being sent properly. See

info: Expiring the node cache of

With just a blank afterwards. Does running facter on the affected node show 
anything unusual?



On Friday, May 30, 2014 3:18:58 PM UTC-7, Sans wrote:



 On Friday, May 30, 2014 11:13:51 PM UTC+1, Henrik Lindberg wrote:


 Ok, then webrick is not the cause of your problem. 

 Run with --trace set to get a ruby stack trace. That will help to find 
 what is causing the problem. 

 - henrik 


 Yes, that was the output from --trace and that's why I where I'm a bit 
 stuck as it's not saying that much.

 -San


-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a95808c8-e9e5-4018-be67-74abb79759f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.