Re: [Puppet Users] Weird passenger problem

2011-09-02 Thread Marek Dohojda
Actually I just copied the apache from one to another (they are same version 
anyway); so it has to be identical.

From: Scott Smith 
Sent: Thursday, September 01, 2011 6:55 PM
To: puppet-users@googlegroups.com 
Subject: Re: [Puppet Users] Weird passenger problem

md5sum your apache configs and compare, then diff if necessary


On Thu, Sep 1, 2011 at 5:06 PM, Marek Dohojda chro...@gmail.com wrote:

  I have multiple server (rhel5.3) running puppet server.   2 of these servers 
are also running passenger.  However on the third server I am running into a 
weird problem: 
Could not retrieve catalog from remote server: No format match the given 
format name or mime-type (text/html


  The puppetmaster itself is working fine, this problem only happens with 
passenger. Apache version is 2.2.3 and passenger 2.2.11.


  Anybody has any idea where I should start looking?


  Thanks!!
  -- 
  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 
mailto:puppet-users%2bunsubscr...@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.

-- 
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] Weird passenger problem

2011-09-02 Thread Denmat
Check the ownership of the config.ru. Can't remember if it has to be puppet or 
apache, but the puppet docs should tell you.

Cheers
Den

On 02/09/2011, at 17:04, Marek Dohojda chro...@gmail.com wrote:

 Actually I just copied the apache from one to another (they are same version 
 anyway); so it has to be identical.
  
 From: Scott Smith
 Sent: Thursday, September 01, 2011 6:55 PM
 To: puppet-users@googlegroups.com
 Subject: Re: [Puppet Users] Weird passenger problem
  
 md5sum your apache configs and compare, then diff if necessary
 
 On Thu, Sep 1, 2011 at 5:06 PM, Marek Dohojda chro...@gmail.com wrote:
 I have multiple server (rhel5.3) running puppet server.   2 of these servers 
 are also running passenger.  However on the third server I am running into a 
 weird problem:
   Could not retrieve 
   catalog from remote server: No format match the given format name or 
 mime-type 
   (text/html
 
 The puppetmaster itself is 
   working fine, this problem only happens with passenger. Apache version is 
   2.2.3 and passenger 2.2.11.
 
 Anybody has any idea where I 
   should start looking?
 
 Thanks!!
 -- 
 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 
 mailto:puppet-users%2bunsubscr...@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.
 -- 
 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] Managing dynamic instances with puppet

2011-09-02 Thread Ohad Levy
On 2011 9 1 18:44, Galed Friedmann galed.friedm...@onavo.com wrote:

 Hello,
 My organization is currently running a complete production environment on
Amazon EC2, and I'm now trying to implement some automations and scaling
with puppet.
 I have several instances which I want them to be almost automatic, meaning
that whenever is needed more instances will come up, and when they're not
needed they will be stopped. This should eventually be automatically is
possible, I don't want to know or care if they came up or down, and
especially do not want to configure anything manually when that happens.

 I currently have a nice puppet configuration, when a node comes up it
get's it's entire configuration from puppet, and exports several of it's
resources to remote nodes (such as nagios, and also some other instances'
/etc/hosts file using the Host resource).

 This is working fairly well, what I'm still not sure how to perform is
node deletion.
 I want to achieve a way that when a node goes down, it's exported
resources will also disappear from the remote instances (meaning nagios will
stop monitoring that host and it's Host resource will be deleted from the
remote server).

 The only way I find this possible is by running some cron on the master
server that purges the exported resources DB every once in a while and using
the purge function on the clients to remove resources that are not longer
managed. While this sounds reasonable it scares me a bit because of several
issues:
 - The master will need to purge the DB around the same time the nodes
check their manifests again (so I'll have an updated DB all the time)
 - I also have several unmanaged resources (like other nagios checks that
I'm not managing through puppet currently). Will performing a purge on
nagios resources will cause ALL existing checks that are not managed by
puppet to disappear?

 Has anyone ever dealt with this kind of dilema? Are there are any other
best practices to perform this?

 I'd really appreciate the help!


Yes, you can use puppet report status or last compile time.

I currently implemented it via foreman api instead of store configs, but the
principal should be the same.

Ohad
 Thanks,
 Galed.

 --
 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/-/Ap4R3tDnoMgJ.
 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] Modules for Solaris

2011-09-02 Thread Mark
On 21 Jul 2011, at 19:02, John Lyman wrote:

 I would be especially interested if anyone has a good way to manage /
 etc/system.  I am currently using the concat module, but it's not the
 best method.  I know the puppet way would be to use augeas, but I
 haven't had any luck compiling it with sun studio and don't want to go
 the gcc route for various reasons.

Hi John,

Check out the OpenCSW Puppet/Facter/Augeas/ruby-augeas stack.

Older versions are available straight from the opencsw.org main pages,
https://www.opencsw.org/packages/CSWaugeas/ - but I've also built
newer versions, which can be retrieved from the experimental area:

http://buildfarm.opencsw.org/experimental.html#markp

If you want to build your own rather than use the opencsw stack, you
could check out the build source in SVN:

https://gar.svn.sf.net/svnroot/gar/csw/mgar/pkg/augeas/trunk/

Regards,

--Mark

-- 
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] Custom Facts

2011-09-02 Thread Matt Moor

On 2/09/11 3:03 PM, Douglas Garstang wrote:
I really appreciate your reply, but I've inherited a mess that isn't 
easy to fix, and the most appropriate solution for right now isn't 
always the best solution. When the boss says GET IT DONE, you 
don't have time to refactor someone elses mess and do it the right 
way. I try and make my questions as specific as possible so that I can 
get options that are as specific to the problem at hand as possible.


Class is an unbelievably overloaded term, but I'm gathering you mean it 
in the context of identifying a group of machines, and will assume so 
for the purposes of this post. I've hacked around this problem a couple 
of ways in the past:


- Derive the class from the FQDN

Previous organisations have had FQDN structures like 
sitename-app-01.staging.mycompany.net, and I've just written a simple 
fact to extract the class from that; e.g. staging-app. I don't really 
recommend this approach, as it can be brittle, it overloads DNS, and 
it's not very granular. But it worked.


- Use a helper file

If you've got the node classification available on the puppetmaster 
(e.g. node foo { $class=abc }), I've used a template to write a file 
with the class details out somewhere useful like 
/etc/mycompany/machine_class.


This guy seems to have taken this idea and run with it: 
http://nuknad.com/2011/02/11/self-classifying-puppet-nodes/


If I was wanting to do this the right way, I'd be looking at hooking 
mcollective up to an external node classifier in some way - that way 
both Puppet and MCollective are referencing the same source of truth. 
No tips on how to actually to do this - it's just where I'd start looking.


Cheers,

Matt

--
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] Updating /etc/puppet ?

2011-09-02 Thread Christopher Wood
On Thu, Sep 01, 2011 at 09:07:37PM +0200, Reinoud van Leeuwen wrote:
 On Thu, Sep 01, 2011 at 11:58:04AM -0700, Russell Van Tassell wrote:
  I'm currently in the same position, and the solution I've proposed (and am
  currently working on) involves using a central repository (likely git). The
  puppet client (running on the master) simply checks the current master
  branch on the remote repository -- if the revisions are not the same, it
  just pulls a new copy.

In subversion, have a separate working copy on the puppetmaster host. Then
to ensure that you have no local cruft on the puppetmaster your script will:

cd /etc/puppet
svn revert -R .
svn up

Your script can check for any files added/modified and touch site.pp to
ensure that puppetmaster starts serving the changes.
 
 Once your organisation grows you want some release management:
 in GIT:
 - everybody has a local Git
 - all work is done in new branches
 - all finished branches are pushed back to a central GIT
 - the releasemanager mergens everything, and does testing (either by
   looking or running a test suite)
 - after testing has finished a tag is applied
 - the tag is checked out on the puppetmaster(s)
 
 
 -- 
 __
 Nothing is as subjective as reality
 Reinoud van Leeuwenreinou...@n.leeuwen.net
 http://reinoud.van.leeuwen.net kvk 27320762
 __
 
 -- 
 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] Puppet Newbie - Problem with Define

2011-09-02 Thread Mitch Anderson
I'm just starting out with puppet, and I'm trying to get one of the
new environments I'm managing using puppet.  The site is apache/php,
so I've been trying to use one of the prewritten apache modules...
without any luck... so I've ended up taking snippits of a few
different ones... anyway, I'm getting this error:

err: Could not run Puppet configuration client: Parameter require
failed: No title provided and libapache2-mod-php5 is not a valid
resource reference

from a class I'm building to define the site, it looks like this:

# Papercoterie Web Server
class example_www {
include server_default
include apache2
include apache2::ssl

#modules to install
$wantedpackages = [libapache2-mod-php5,]
package { libapache2-mod-php5: ensure = installed }

# enable modules in apache
apache2::module{php5: require = libapache2-mod-php5 }

# setup site in apache
apache2::site { 'example.com':
ensure = 'present',
priority = 10,
modules = $modules,
docroot = /var/www/example.com/current,
}
}

within my module apache2

I have a module.pp file that looks like:
define apache2::module( $ensure = 'present', $require = 'apache2' ) {
case $ensure {
'present' : {
exec { a2enmod $name:
unless = test ! -e /etc/apache2/mods-
enabled/$name.load,
notify = Service[apache2],
require = Package[$require],
}
}
'absent': {
exec { a2dismod $name:
onlyif = test ! =e /etc/apache2/mods-
enabled/$name.load,
notify = Service[apache2],
require = Package[apache2],
}
}
default: { err ( Unknown ensure value: '$ensure' ) }
}
} # end modules

Currently everything validates and runs fine on the clients (puppet
master is ubuntu 11.04 2.6.4)
Clients will all be ubuntu 10.04 but I have a different PPA installed
for puppet and their version is: 2.6.3.

what am I doing wrong?

-- 
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 client dying without errors

2011-09-02 Thread Basil Baby
Few of my puppet clients (puppet 0.24.8,  ruby 1.8.5, facter 1.5.2) are
dying with out any error messages on on syslog.  I cannot see much system
resource usage on these nodes.

What is the best way to troubleshoot the root cause of the problem?

-Basil

-- 
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] Inherited 0.2.5 installation

2011-09-02 Thread genkuro
I inherited a 0.2.5 puppet installation.  I'm totally new to puppet.
No clue.  I have managed clusters with ROCKS before.  The big ideas
translate readily.  So maybe just half a clue.

Out of curiosity, why the big version numbering jump for Puppet?  The
releases go from 0.x straight to 2.x.

Puppet looks great so far.  But documentation is sprawling.  It looks
like 0.2.5 has been abandoned.  Any idea where I can find dedicated
0.2.5 docs?  Preferably online?

I'm guessing the 0.2.5 - 2.x migration must be common.  Can I expect
this to be a slam dunk?

Thanks much!
Brian

-- 
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] Reboot required?

2011-09-02 Thread Christopher Wood
On Fri, Sep 02, 2011 at 03:14:51AM -0700, Ryohei Suzuki wrote:
 Hi
 
 I have one question.
 I changed the manifest of a Puppet.
 Then, if you do not restart the Puppetmasterd, manifest did not run.
 What's the functional movements are correct?

If I recall correctly, you should touch /etc/puppet/manifests/site.pp and the 
puppetmaster will update what it serves to clients.

I am assuming that you have a puppet agent asking for its config from this 
puppetmaster.
 
 -- 
 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] Puppet client dying without errors

2011-09-02 Thread Christopher Wood
On Thu, Sep 01, 2011 at 08:31:55PM -0400, Basil Baby wrote:
Few of my puppet clients (puppet 0.24.8,� ruby 1.8.5, facter 1.5.2) are
dying with out any error messages on on syslog.� I cannot see much system
resource usage on these nodes.
 
What is the best way to troubleshoot the root cause of the problem?

Without having huge scads of puppet knowledge, if they die frequently enough 
perhaps running one of these in the foreground with debug/tee to see if they 
spit out any interesting messages?

See puppet agent -h for your exact command line parameters, but something 
like:

puppet agent --no-daemonize --debug 21 | tee /var/tmp/p1.log

 
-Basil
 
--
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] Inherited 0.2.5 installation

2011-09-02 Thread James Turnbull
genkuro wrote:
 Out of curiosity, why the big version numbering jump for Puppet?  The
 releases go from 0.x straight to 2.x.

The big jump was because our release numbering was wrong - major
feature-heavy releases occurred within minor release numbering.  So when
we had a chance we changed the numbering up to properly reflect
feature/maintenance releases.

 
 Puppet looks great so far.  But documentation is sprawling.  It looks
 like 0.2.5 has been abandoned.  Any idea where I can find dedicated
 0.2.5 docs?  Preferably online?

We have stopped issuing maintenance for 0.25.5 except for potential
security issues because more recent releases provide better performance
and features.

The reference docs for 0.25.5 are available at:

http://docs.puppetlabs.com/references/0.25.5/

Generally speaking (where possible) the rest of the Docs site calls out
versions of specific features.

 
 I'm guessing the 0.2.5 - 2.x migration must be common.  Can I expect
 this to be a slam dunk?

There are no major issues but testing is obviously recommended.  The
Puppet model is to upgrade the master first and then the clients.  We
guarantee backwards compatibility with older clients talking to newer
masters but not vice versa.

Hope that helps!

James

-- 
James Turnbull
Puppet Labs
1-503-734-8571

Join us for PuppetConf http://www.bit.ly/puppetconfsig, September 22nd
and 23rd in Portland, Oregon, USA.

-- 
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: Composing a text file with Puppet

2011-09-02 Thread M C
Hi,

thank you verymuch for the explanations.
I will first try with a combination of replace = false and custom Line
resource to see if I can easily concat and update my configuration file
content.

Matteo

2011/9/1 jcbollinger john.bollin...@stjude.org



 On Aug 31, 10:52 am, Brian Gallew g...@gallew.org wrote:

  Call me crazy, but isn't this just a matter of adding replace = false
 to the file resource?  If it doesn't exist, Puppet will create it according
 to the manifest.  Once in place, Puppet will leave it alone unless it
 vanishes, at which point it will be re-created.


 Um.  Err.  Coffee.

 I mean, yeah, but where's the fun in that?


 John

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



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



Re: [Puppet Users] Custom Facts

2011-09-02 Thread Aaron Grewell
In case you decide to go with an ENC, here's the one we use.  It takes a
YAML file for each host providing environment, classes, and parameters to be
used.  All node-specific data is kept in the same YAML file and either
provided via the ENC or pulled in via Hiera at the class level.

#-
#!/usr/bin/ruby
# Modified by Aaron Grewell agre...@rei.com
# Originally by Gary Larizza
# http://glarizza.posterous.com

require 'yaml'
require 'puppet'

# Intitialize Variables
environments = [development, testing, qa, production]
prefix = /usr/share/puppet/environments
default = {'classes' = []}
parameters = {}
yaml_output = {}
yamlfile = nil

# Check to see if the Node YAML file exists.
# If it exists, set the classes variable to that fact's value
begin
  environments.each do |environment|
nodefile = #{prefix}/#{environment}/nodes/#{ARGV[0]}.yaml
if File::exists?( nodefile )
  yamlfile = YAML::load_file(nodefile)
end
  end

  if yamlfile.nil?
puts ERROR: Node YAML file was not found!
exit(1)
  end

  environment = yamlfile[environment]
  classes = yamlfile[classes]
  parameters = yamlfile[parameters]
end

# Output our classes and environment values to YAML for Puppet
yaml_output =  {'classes' = classes, 'environment' = environment,
'parameters' = parameters}
print yaml_output.to_yaml
#-

On Thu, Sep 1, 2011 at 10:30 PM, Matt Moor m...@imprecise.org wrote:

 On 2/09/11 3:03 PM, Douglas Garstang wrote:

 I really appreciate your reply, but I've inherited a mess that isn't easy
 to fix, and the most appropriate solution for right now isn't always the
 best solution. When the boss says GET IT DONE, you don't have time to
 refactor someone elses mess and do it the right way. I try and make my
 questions as specific as possible so that I can get options that are as
 specific to the problem at hand as possible.


 Class is an unbelievably overloaded term, but I'm gathering you mean it in
 the context of identifying a group of machines, and will assume so for the
 purposes of this post. I've hacked around this problem a couple of ways in
 the past:

 - Derive the class from the FQDN

 Previous organisations have had FQDN structures like
 sitename-app-01.staging.**mycompany.nethttp://sitename-app-01.staging.mycompany.net,
 and I've just written a simple fact to extract the class from that; e.g.
 staging-app. I don't really recommend this approach, as it can be brittle,
 it overloads DNS, and it's not very granular. But it worked.

 - Use a helper file

 If you've got the node classification available on the puppetmaster (e.g.
 node foo { $class=abc }), I've used a template to write a file with the
 class details out somewhere useful like /etc/mycompany/machine_class.

 This guy seems to have taken this idea and run with it:
 http://nuknad.com/2011/02/11/**self-classifying-puppet-nodes/http://nuknad.com/2011/02/11/self-classifying-puppet-nodes/

 If I was wanting to do this the right way, I'd be looking at hooking
 mcollective up to an external node classifier in some way - that way both
 Puppet and MCollective are referencing the same source of truth. No tips
 on how to actually to do this - it's just where I'd start looking.

 Cheers,

 Matt


 --
 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+unsubscribe@**
 googlegroups.com puppet-users%2bunsubscr...@googlegroups.com.
 For more options, visit this group at http://groups.google.com/**
 group/puppet-users?hl=enhttp://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 unable to find a defined resource.

2011-09-02 Thread Brad Krane

 Then let's take a step back.  Your class is rather complicated, and
 all the details may be confusing (or even causing) the issue.  For
 example, you may have a nesting problem that is difficult to see in
 all that code.  I suggest putting each 'define' in its own file to
 help make things clearer and more maintainable.  Even before that,
 however, I suggest getting a much simplified stub working, then
 fleshing it out.  So, does this work for you:

 drupal6/manifests/init.pp
 ---
 class drupal6 {
   drupal6::theme_repo { foo: }

 }

 drupal6/manifests/theme_repo.pp
 
 define theme-repo() {

 }

 ?


Ok, I took a big, big step back, broke out all of the drupal6::site,
drupal6::theme-repo and drupal6::module into their own files. I also
reduced the complexity of the module by stubbing out all the
definitions to contain almost nothing. Here is what I have left:

drupal6/manifests/init.pp
-
$d6_confpath = /usr/share/drupal6
$d6_scriptpath = /usr/share/drupal6
$gitdir = /srv/git/drupal-themes

class drupal6 {

}

drupal6/manifests/module.pp
-
define drupal6::module ( $ensure = 'present', $site = 'all') {
notice(module)
}

drupal6/manifests/site.pp
-
define drupal6::site (
$ensure = 'present',
$dbname,
$dbpw,
$dbserver,
$sitefqdn,
$siteAlias = ,
$modules = ,
$nagios_uid,
$nagios_timeout = 5,
$theme = { name = nil, version = nil, upstream =
drupal }
) {
case $ensure {
'present': {

drupal6::module { module:
}

# Site theme
drupal6::theme-repo { $name-$theme['name']:
}

}# 'present'
}  # case $ensure
}

drupal6/manifests/theme-repo.pp
-
define drupal6::theme-repo()
{
notice(theme-repo)
}


And I still get the same error below.

err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError:
Invalid resource type drupal6::theme-repo at srv/puppet/modules/
drupal6/manifests/site.pp:19 on node www-cms-dev.fs.uwaterloo.ca


That is until I removed $theme['name'] from the drupal6::theme-repo's
name! It looks like having set theme['name'] = nil as the default
value and not setting it to a non-nil value caused the error.


-- 
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 unable to find a defined resource.

2011-09-02 Thread Brad Krane
I have spoken too soon about the nil value causing the problem. When I
set the default value from nil to something the error came back. It
seems that just using a hash value in the name to be expanded is what
the real issue is.

-- 
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] Custom Facts

2011-09-02 Thread Douglas Garstang
On Thu, Sep 1, 2011 at 10:30 PM, Matt Moor m...@imprecise.org wrote:

 On 2/09/11 3:03 PM, Douglas Garstang wrote:

 I really appreciate your reply, but I've inherited a mess that isn't easy
 to fix, and the most appropriate solution for right now isn't always the
 best solution. When the boss says GET IT DONE, you don't have time to
 refactor someone elses mess and do it the right way. I try and make my
 questions as specific as possible so that I can get options that are as
 specific to the problem at hand as possible.


 Class is an unbelievably overloaded term, but I'm gathering you mean it in
 the context of identifying a group of machines, and will assume so for the
 purposes of this post. I've hacked around this problem a couple of ways in
 the past:

 - Derive the class from the FQDN

 Previous organisations have had FQDN structures like
 sitename-app-01.staging.**mycompany.nethttp://sitename-app-01.staging.mycompany.net,
 and I've just written a simple fact to extract the class from that; e.g.
 staging-app. I don't really recommend this approach, as it can be brittle,
 it overloads DNS, and it's not very granular. But it worked.

 - Use a helper file

 If you've got the node classification available on the puppetmaster (e.g.
 node foo { $class=abc }), I've used a template to write a file with the
 class details out somewhere useful like /etc/mycompany/machine_class.

 This guy seems to have taken this idea and run with it:
 http://nuknad.com/2011/02/11/**self-classifying-puppet-nodes/http://nuknad.com/2011/02/11/self-classifying-puppet-nodes/

 If I was wanting to do this the right way, I'd be looking at hooking
 mcollective up to an external node classifier in some way - that way both
 Puppet and MCollective are referencing the same source of truth. No tips
 on how to actually to do this - it's just where I'd start looking.

 Cheers,


Hi Matt. :)

Unfortunately, using the FQDN to determine the class of server here isn't
feasible. The DNS namespace is pretty flat. As for the helper file option, I
can add a variable to the node definition, which is what I was hoping to do.
I can then template the value, and write it to a file on the target.
However, at this point, using a custom fact to retrieve the value from the
local O/S seems a bit heavy handed. Maybe that's what I'll have to end up
using.

At the end of the day, this all seems to be a limitation with mcollective.
It can only read facts from one source, either facter or a yaml file. I
believe facter is the current source, and people have written scripts that
rely on that. I can write a custom fact, but then the issue becomes that
I don't know if it's possible for a custom fact written in ruby and dropped
into $module/lib/puppet can access variables defined in the node.

Doug.

-- 
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 unable to find a defined resource.

2011-09-02 Thread Brad Krane
Here is a very simple manifest that recreates this error:


class foo {
  define bar ( $val ) {
notice(bar($val))
  }
}

$some_hash = { 'name' = some_name }

foo::bar { $some_hash['name']: }


Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
resource type foo::bar at /tmp/puptest.pp:9 on node www-cms-
dev.fs.uwaterloo.ca


This seems like a bug to me.

-- 
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] Custom Facts

2011-09-02 Thread R.I.Pienaar


- Original Message -
 
 At the end of the day, this all seems to be a limitation with
 mcollective. It can only read facts from one source, either facter
 or a yaml file. I believe facter is the current source, and people
 have written scripts that rely on that. I can write a custom fact,
 but then the issue becomes that I don't know if it's possible
 for a custom fact written in ruby and dropped into
 $module/lib/puppet can access variables defined in the node.
 

using the yaml file built by a template method that was linked to
any variables you set at the node level, top scope or in the class
that creates the yaml file is put in the yaml file.

Therefore you can use these files in mcollective filters, so if you
just set variables in the node to do whatever you want they will show
up in the yaml file and be usable.

As the wiki says:

plus it lets you get any in-scope variables (for example, parameters from your 
external node classifier) available as mcollective filters for free.

http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/FactsFacterYAML

Mcollective thus gets a combination of facts, variables etc all in one
place.  You can even create many yaml files and it will read the lot for
you, one local the node, one by puppet, maybe even with facter -y etc.

and if all this fails, you can trivially write your own fact source that
does whatever you want.

-- 
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] Weird passenger problem

2011-09-02 Thread Marek Dohojda
OK so I solved the problem; apparently the config.ru was corrupt/wrong (not
sure exactly).  The permissions were fine, but apparently the content was
wrong.  I made a copy from a working server and everything started to work
fine.

Thank you Den you pointed me towards the right solution.

On Fri, Sep 2, 2011 at 2:28 AM, Denmat tu2bg...@gmail.com wrote:

 Check the ownership of the config.ru. Can't remember if it has to be
 puppet or apache, but the puppet docs should tell you.

 Cheers
 Den


 On 02/09/2011, at 17:04, Marek Dohojda chro...@gmail.com wrote:

  Actually I just copied the apache from one to another (they are same
 version anyway); so it has to be identical.

  *From:* Scott Smith sc...@ohlol.net
 *Sent:* Thursday, September 01, 2011 6:55 PM
 *To:* puppet-users@googlegroups.compuppet-users@googlegroups.com
 *Subject:* Re: [Puppet Users] Weird passenger problem

 md5sum your apache configs and compare, then diff if necessary

 On Thu, Sep 1, 2011 at 5:06 PM, Marek Dohojda  chro...@gmail.com
 chro...@gmail.com wrote:

 I have multiple server (rhel5.3) running puppet server.   2 of these
 servers are also running passenger.  However on the third server I am
 running into a weird problem:
   Could not retrieve catalog from remote server: No format match the given
 format name or mime-type (text/html

 The puppetmaster itself is working fine, this problem only happens with
 passenger. Apache version is 2.2.3 and passenger 2.2.11.

 Anybody has any idea where I should start looking?

 Thanks!!
 --
 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
 puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 mailto:puppet-users%2bunsubscr...@googlegroups.compuppet-users%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en
 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.

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


-- 
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] Custom Facts

2011-09-02 Thread Douglas Garstang
On Fri, Sep 2, 2011 at 11:26 AM, R.I.Pienaar r...@devco.net wrote:



 - Original Message -
 
  At the end of the day, this all seems to be a limitation with
  mcollective. It can only read facts from one source, either facter
  or a yaml file. I believe facter is the current source, and people
  have written scripts that rely on that. I can write a custom fact,
  but then the issue becomes that I don't know if it's possible
  for a custom fact written in ruby and dropped into
  $module/lib/puppet can access variables defined in the node.
 

 using the yaml file built by a template method that was linked to
 any variables you set at the node level, top scope or in the class
 that creates the yaml file is put in the yaml file.

 Therefore you can use these files in mcollective filters, so if you
 just set variables in the node to do whatever you want they will show
 up in the yaml file and be usable.

 As the wiki says:

 plus it lets you get any in-scope variables (for example, parameters from
 your external node classifier) available as mcollective filters for free.


 http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/FactsFacterYAML

 Mcollective thus gets a combination of facts, variables etc all in one
 place.  You can even create many yaml files and it will read the lot for
 you, one local the node, one by puppet, maybe even with facter -y etc.

 and if all this fails, you can trivially write your own fact source that
 does whatever you want.

 --


So, I think I had used this approach once before. But, now after
implementing that, yes, facts.yaml seems to have all the facter variables as
well as variables defined in the node, which is generally what I want.

However, running mc-inventory shows no facts, and doing something like this:

mc-service puppet status -F hosttype=proxy

where hosttype=proxy does appear in the yaml file, returns no data. I have
set the factsource to yaml in mcollective's server.cfg and restarted it.

Douglas.

-- 
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] Sourcing node variables

2011-09-02 Thread Douglas Garstang
So... a general question.

When sourcing node variables, what is the better approach...

a) In each module included by the node, use something like extlookup to get
the variables you need, as you need them, OR
b) Have your external node script gather and dump _all_ the variables the
the node may need for all functions it may peform.

Option b) seems less preferable to me personally. We have this God awful
perl script right now that templates all of our production values, and
option b) would essentially still involve having a complicated external node
script doing a lot of similar things. The whole point of puppet is to do
away with custom scripts doing application specific things. One advantage of
this approach is that it to see all the variables for a node, simply running
the external node script with the host name will yield all that information
quickly and easily.

Doug.

-- 
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] Custom Facts

2011-09-02 Thread Douglas Garstang
On Fri, Sep 2, 2011 at 12:06 PM, Douglas Garstang
doug.garst...@gmail.comwrote:


 On Fri, Sep 2, 2011 at 11:26 AM, R.I.Pienaar r...@devco.net wrote:



 - Original Message -
 
  At the end of the day, this all seems to be a limitation with
  mcollective. It can only read facts from one source, either facter
  or a yaml file. I believe facter is the current source, and people
  have written scripts that rely on that. I can write a custom fact,
  but then the issue becomes that I don't know if it's possible
  for a custom fact written in ruby and dropped into
  $module/lib/puppet can access variables defined in the node.
 

 using the yaml file built by a template method that was linked to
 any variables you set at the node level, top scope or in the class
 that creates the yaml file is put in the yaml file.

 Therefore you can use these files in mcollective filters, so if you
 just set variables in the node to do whatever you want they will show
 up in the yaml file and be usable.

 As the wiki says:

 plus it lets you get any in-scope variables (for example, parameters from
 your external node classifier) available as mcollective filters for free.


 http://projects.puppetlabs.com/projects/mcollective-plugins/wiki/FactsFacterYAML

 Mcollective thus gets a combination of facts, variables etc all in one
 place.  You can even create many yaml files and it will read the lot for
 you, one local the node, one by puppet, maybe even with facter -y etc.

 and if all this fails, you can trivially write your own fact source that
 does whatever you want.

 --


 So, I think I had used this approach once before. But, now after
 implementing that, yes, facts.yaml seems to have all the facter variables as
 well as variables defined in the node, which is generally what I want.

 However, running mc-inventory shows no facts, and doing something like
 this:

 mc-service puppet status -F hosttype=proxy

 where hosttype=proxy does appear in the yaml file, returns no data. I have
 set the factsource to yaml in mcollective's server.cfg and restarted it.

 Douglas.



Eh. Now it's working. Weird.

-- 
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 Newbie - Problem with Define

2011-09-02 Thread Mitch Anderson
On Sep 2, 10:46 am, Peter Bukowinski pmb...@gmail.com wrote:
 On Friday, September 2, 2011 at 10:46 AM, Mitch Anderson wrote:
  I'm just starting out with puppet, and I'm trying to get one of the
  new environments I'm managing using puppet. The site is apache/php,
  so I've been trying to use one of the prewritten apache modules...
  without any luck... so I've ended up taking snippits of a few
  different ones... anyway, I'm getting this error:

  err: Could not run Puppet configuration client: Parameter require
  failed: No title provided and libapache2-mod-php5 is not a valid
  resource reference

  from a class I'm building to define the site, it looks like this:

  # Papercoterie Web Server
  class example_www {
   include server_default
   include apache2
   include apache2::ssl

   #modules to install
   $wantedpackages = [libapache2-mod-php5,]
   package { libapache2-mod-php5: ensure = installed }

   # enable modules in apache
   apache2::module{php5: require = libapache2-mod-php5 }

 Your require is missing a title, as noted by the error. This line above 
 should read:

  apache2::module{'php5': require = Package['libapache2-mod-php5'] }

Doh!  I knew it was something stupid I was missing... thanks much!
(I did say noob right? )

That fixed it.

-- 
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 unable to find a defined resource.

2011-09-02 Thread Paul Nguyen
I'm also seeing the same problem I believe.

I'm running on the following

puppet 2.7.3
ruby 1.8.5
centos 5

I have a defined resource in the module called accounts

   class accounts::virtual {
 define createsysuser ($val) {
 ...
 }
   }

In another class in the same module, I have the following

  class accounts::appaccts {
include account::virtual

createsysuser { someuser
   val = someuser
}
  }

I get the following error

err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
resource type createsysuser at
/etc/puppet/modules/accounts/manifests/applications.pp:6 on node
foobar.test.com

Is there a fix for this, or am I doing something wrong?

Thanks,
Paul

On Fri, Sep 2, 2011 at 11:21 AM, Brad Krane brad.kr...@gmail.com wrote:

 Here is a very simple manifest that recreates this error:


 class foo {
  define bar ( $val ) {
notice(bar($val))
  }
 }

 $some_hash = { 'name' = some_name }

 foo::bar { $some_hash['name']: }


 Puppet::Parser::AST::Resource failed with error ArgumentError: Invalid
 resource type foo::bar at /tmp/puptest.pp:9 on node www-cms-
 dev.fs.uwaterloo.ca


 This seems like a bug to me.

 --
 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] Inherited 0.2.5 installation

2011-09-02 Thread Edward Savage
On Sat, Sep 3, 2011 at 1:00 AM, genkuro genk...@gmail.com wrote:
 I'm guessing the 0.2.5 - 2.x migration must be common.  Can I expect
 this to be a slam dunk?

We recently did a large (100 nodes) migration from 0.25 to 2.6.  The
biggest issue was ensuring all our modules worked without any
unexpected changes.  Standard testing will pick up anything like this
and we only had a couple of very minor issues.

A good tip if you plan to 'upgrade puppet with puppet' like we did on
a debian platform remember to set 'hasrestart = true' on your puppet
service 'init' provider.  40 nodes had updated themselves before we
realised puppet didn't know how to start itself back up, without that
switch, after being upgraded.  This may apply to other platforms so
test for it.

Regards,

Edward

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