Re: [Puppet Users] scope of default values

2011-05-02 Thread Andreas Kuntzagk

Hi,


Since I also have many nfsmounts and want to make sure that the mountpoint
exist, I'd like to use require. Is there a way I can reference the name of
the mountpoint in the require? Like so.

mount {test2:
   device = server1:/test2,
   require = File[$name]
 }


If you have a file resource dependent on a Mount['test2'], the require
attribute should be in the file resource.


No, it's the other way around. The mount is depending on the existence of the 
mountpoint otherwise the mount command fails. I can write


mount { /test2:
   device = server1:/test2,
   require = File[/test2],
  }

but to make this test default for all nfs mounts I want something like

Mount { ...
   require = File[$mountpoint]
}

where $mountpoint is automatically set to the correct mountpoint of the current 
mount.


regards, Andreas

--
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 bootstrap: via cdist

2011-05-02 Thread Nico -telmich- Schottelius
Good morning puppets,

as stated for reallife, one always meets more than one time,
this is true for puppet and me: Although I'm migrating away from
puppet [0] to cdist [1], a customer requests a new puppet installation.

This brings me again to the question on how to bootstrap a new puppet
infrastructure, which we did with a shell script or a Debian package
and then running puppet against a manifest to bootstrap itself.

The first approach is rather lightweight compared to the packaging
effort and having to run puppet manually anyway.

Next time I'd probably do it differently, in a more automated manner:

As cdist requires only ssh on the target host, I can easily use it
to configure the system completly, including a puppet master. Because
the planned cdist __puppet type can easily be reused and wil probably
go into upstream cdist, I wanted to let you know about this method
to get puppet up and running.

So if you're interested in bootstrapping puppet with cdist,
you should monitor the cdist mailinglist [2], which will have the
announcement of the __puppet type as soon as it's available.

Cheers,

Nico

[0] http://www.nico.schottelius.org/blog/migrating-away-from-puppet-to-cdist/ 
[1] http://www.nico.schottelius.org/software/cdist/ 
[2] http://l.schottelius.org/mailman/listinfo/cdist

-- 
PGP key: 7ED9 F7D3 6B10 81D7 0EC5  5C09 D7DC C8E4 3187 7DF0

-- 
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: Is this a valid statement?

2011-05-02 Thread Felix Frank
On 04/30/2011 01:52 AM, Roberto Bouza wrote:
 Thanks for the help.
 
 I opted to used strings on the variables, which to me is not good!!!
 (not a proper defined language)
 
 I should be able to use the types true, false and should be able to
 check for the nothing/nil/undef variable which I can't and I think is
 bad.

You should raise a bug then.

I concur, the boolean semantics can be less than optimal.

Cheers,
Felix

-- 
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] Adding already defined users to a group when its created

2011-05-02 Thread Felix Frank
On 05/01/2011 01:05 PM, Denmat wrote:
 Hi,
 
 Sorry, just so I'm clear.
 
 You want create a user and a user group, and then add that user to an sshuser 
 group? 
 
 Can you create the user with all those groups by default? I don't see why it 
 has to be so complicated unless you have something really specific you're 
 trying to do.
 
 If you want to make it more complicated I would add something like:
 
 users.pp
 
 if Class[sshclassname] {
   $groups = sshusers
...
  groups = $groups
...
 }
 
 Where you would declare the ssh class  for the node then test for the 
 declaration when you create the user. You can also use a selector if you like.
 
 Not sure if this is best practice though, but easier than custom facts or 
 execs.

Hi,

that would probably be
if defined(Class[...]) { }
though, which is hacky and prone to ordering problems - the group
membership will end up flapping.

What's needed here is class inheritance:

class default_user {
  user { defaultaccount: ... }
}

class default_user::ssh inherits default_user {
  User[defaultaccount] { groups + sshusers }
}

Then the SSH class will include default_user::ssh. Done.

Notice the use of the plusignment syntax in the resource override.

HTH,
Felix

-- 
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] scope of default values

2011-05-02 Thread Felix Frank
On 05/02/2011 09:28 AM, Andreas Kuntzagk wrote:
 Hi,
 
 Since I also have many nfsmounts and want to make sure that the
 mountpoint
 exist, I'd like to use require. Is there a way I can reference the
 name of
 the mountpoint in the require? Like so.

 mount {test2:
device = server1:/test2,
require = File[$name]
  }

 If you have a file resource dependent on a Mount['test2'], the require
 attribute should be in the file resource.
 
 No, it's the other way around. The mount is depending on the existence
 of the mountpoint otherwise the mount command fails. I can write
 
 mount { /test2:
device = server1:/test2,
require = File[/test2],
   }
 
 but to make this test default for all nfs mounts I want something like
 
 Mount { ...
require = File[$mountpoint]
 }
 
 where $mountpoint is automatically set to the correct mountpoint of the
 current mount.

That won't work out of the box, but you can do it in a defined type:

define mount_wrapper($device,...)
  mount { $name:
device = $device,
...,
require = File[$name]
  }
}

That type will probably declare the very file resource as well.

HTH,
Felix

-- 
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] Connection reset by peer

2011-05-02 Thread Dmitry
Thank you!!!

It was a problem with DNS-server.
The second DNS-server, that was in resolv.conf, don't answer for requests.

-- 
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] help with template and has_variable?

2011-05-02 Thread Arnau Bria
Hi all,

I'm getting crazy with this... I have some templates where I use
has_variable? with no problem. But now I have problems in new one.

nods.pp
node 'my_node' {
$CVMFS_mountpoint = /mnt/cvmfs
$CVMFS_file = /etc/auto.cvmfs
[...]
include some_class_that_already_includes_autofs_class
}


[...]
'/etc/auto.master.test':
content = template('computing_autofs/auto.master.erb');
[...]

auto.master.erb
/nfsfile:/etc/auto.home 
-rw,hard,intr,tcp,async,rsize=32768,wsize=32768,timeo=600
% if has_variable?(CVMFS_mountpoint) and has_variable?(CVMFS_file) %
%= CVMFS_mountpoint % %= CVMFS_file %
% end %

This gives :

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed 
to parse template computing_autofs/auto.master.erb: uninitialized constant 
Puppet::Parser::TemplateWrapper::CVMFS_mountpoint at 
/etc/puppet/manifests/services/workernode/modules/computing_autofs/manifests/init.pp:35


If I change :
%= CVMFS_mountpoint % %= CVMFS_file %

for some static text (like KK), the templae works as expected:

# cat /etc/auto.master.test 
#Autofs file
/nfsfile:/etc/auto.home 
-rw,hard,intr,tcp,async,rsize=32768,wsize=32768,timeo=600
KK

and removes KK if I remove some of the above defined vars


So, why is it complaining about the uninitilized constant if it's
defined? and why it complains if the funtions already does something if
the var is not defined?


Anyone could give me a hand on this?


TIA,
Arnau

-- 
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] help with template and has_variable?

2011-05-02 Thread Felix Frank
On 05/02/2011 03:24 PM, Arnau Bria wrote:
snip
 /nfsfile:/etc/auto.home 
 -rw,hard,intr,tcp,async,rsize=32768,wsize=32768,timeo=600
 % if has_variable?(CVMFS_mountpoint) and has_variable?(CVMFS_file) %
 %= CVMFS_mountpoint % %= CVMFS_file %
 % end %
 
 This gives :
 
 err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
 Failed to parse template computing_autofs/auto.master.erb: uninitialized 
 constant Puppet::Parser::TemplateWrapper::CVMFS_mountpoint at 
 /etc/puppet/manifests/services/workernode/modules/computing_autofs/manifests/init.pp:35

Constant?

This is a complete shot in the dark, but have you tried downcasing those
to cvmfs_mountpoint and cvmfs_file?

Looks to me like ruby thinks its dealing with constants, whereas it
should be looking for variables.

HTH,
Felix

-- 
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] exec resource: negate onlyif condition

2011-05-02 Thread Andreas Kuntzagk

Hi,

today I'm stupid. How can I negate the test for execs onlyif?

I want to run the exec onlyif command returns 1.

regards, Andreas

--
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] exec resource: negate onlyif condition

2011-05-02 Thread Felix Frank
On 05/02/2011 03:37 PM, Andreas Kuntzagk wrote:
 Hi,
 
 today I'm stupid. How can I negate the test for execs onlyif?
 
 I want to run the exec onlyif command returns 1.
 
 regards, Andreas

Hi,

use unless instead of onlyif.

Cheers,
Felix

-- 
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] help with template and has_variable?

2011-05-02 Thread Arnau Bria
On Mon, 02 May 2011 15:31:01 +0200
Felix Frank wrote:

[...]
 Constant?
 
 This is a complete shot in the dark, but have you tried downcasing
 those to cvmfs_mountpoint and cvmfs_file?
that worked!

 Looks to me like ruby thinks its dealing with constants, whereas it
 should be looking for variables.

so, any ideawhy is ruby doing it? 
 
 HTH,
 Felix
Thanks a lot Felix,
Cheers,
Arnau

-- 
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] help with template and has_variable?

2011-05-02 Thread Felix Frank
On 05/02/2011 03:41 PM, Arnau Bria wrote:
 On Mon, 02 May 2011 15:31:01 +0200
 Felix Frank wrote:
 
 [...]
 Constant?

 This is a complete shot in the dark, but have you tried downcasing
 those to cvmfs_mountpoint and cvmfs_file?
 that worked!
 
 Looks to me like ruby thinks its dealing with constants, whereas it
 should be looking for variables.
 
 so, any ideawhy is ruby doing it? 

I know next to nothing about Ruby, but apparently the naming conventions
are rather strict in the language ;-)

Glad that fixed it,
Felix

-- 
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] exec resource: negate onlyif condition

2011-05-02 Thread Andreas Kuntzagk

Stupid me!
Did not see this.

Thanks.

Felix Frank wrote:

On 05/02/2011 03:37 PM, Andreas Kuntzagk wrote:

Hi,

today I'm stupid. How can I negate the test for execs onlyif?

I want to run the exec onlyif command returns 1.

regards, Andreas


Hi,

use unless instead of onlyif.

Cheers,
Felix



--
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] help with template and has_variable?

2011-05-02 Thread Christian Kauhaus
Am 02.05.2011 15:41, schrieb Arnau Bria:
 so, any ideawhy is ruby doing it? 

Identifiers beginning with uppercase letters denote constants in Ruby. The
most visible example for this rule are class names. Class names are
constants that point to their respective class objects.

Regards

Christian

-- 
Dipl.-Inf. Christian Kauhaus  · k...@gocept.com · systems administration
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 11 · fax +49 345 1229889 1
Zope and Plone consulting and development

-- 
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: How to check if a package exists

2011-05-02 Thread jcbollinger


On May 1, 2:14 am, Rakhesh Sasidharan pup...@rakhesh.net wrote:
 On Sat, 30 Apr 2011 23:21 -0700, Sans r.santanu@gmail.com wrote:
  On May 1, 4:59 am, Matthew Black mjbl...@gmail.com wrote:
   You can put a requires in the file resource

   require = Package[packagename]

   then it will install the package first then put in the symlink.

  That not what I actually want. I just simply want: if the package
  already installed, create the sym-link otherwise, do nothing. Cheers!!

 In that case my suggestion of yesterday should do the trick -

 Have a Exec resource with a command to link the files above, but which
 runs only if the file does not already exist. Something along the lines
 of the example mentioned here 
 -http://www.puppetcookbook.com/posts/exec-onlyif.html


An Exec can do this job, but the more Puppetly way to do it is to
write a custom fact (it's easy) that informs the Puppetmaster whether
lcgdm-
libs-1.8.0-1sec.sl5 is present.  Wrap the delaration of your File
resource in a simple conditional (e.g. if) statement based on that
fact.  In general, when you want Puppet to vary its behavior based on
details of a particular node, facts and providers are the Puppet ways
to approach the problem.


John

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



[Puppet Users] Could not request certificate: undefined method `closed?' for nil:NilClass

2011-05-02 Thread crosmuller
Hi list,

I am trying to get a puppet certificate on a new client but I get
error:

err: Could not request certificate: undefined method `closed?' for
nil:NilClass

I googled and found that it had something to do with reverse DNS
lookup, the client is behind a NAT firewall so I assume a reverse
lookup will fail. Can I bypass this somehow? Puppet version on master
and client is 0.25.4

Thanks,

regards

-- 
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] Could not request certificate: undefined method `closed?' for nil:NilClass

2011-05-02 Thread James Turnbull
crosmuller wrote:
 Hi list,
 
 I am trying to get a puppet certificate on a new client but I get
 error:
 
 err: Could not request certificate: undefined method `closed?' for
 nil:NilClass
 
 I googled and found that it had something to do with reverse DNS
 lookup, the client is behind a NAT firewall so I assume a reverse
 lookup will fail. Can I bypass this somehow? Puppet version on master
 and client is 0.25.4
 

This is a Ruby networking issue with 0.25.4 that is fixed in 0.25.5 and
later.  I'd recommend upgrading.

Regards

James Turnbull

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

-- 
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: run stages and mixed class styles

2011-05-02 Thread vagn scott


I took another pass at this and it seems to work
the way I expected it to.  I'm not sure why it didn't work before,
and I don't have time right now to look into it.

Anyway, thanks to those who replied.  If I find anything
interesting I will post it.

--
thanks,
vagn

On 04/29/2011 10:53 AM, jcbollinger wrote:


On Apr 28, 2:07 pm, vagn scottvagnsc...@gmail.com  wrote:
   

On 04/28/2011 09:54 AM, jcbollinger wrote:
  
You have to do some sort of provisioning to get Puppet working in the
first place, so option (1) wouldn't really be so bad.
  

There is no question that it could be done in provisioning.

My question is really: How do stages work?
Can I use stages to, as in this example, set up
a proxy that should be in place before
any other classes are expressed?
 

Run stages leverage Puppet's existing dependency system, to which the
require and before resource metaparameters and other features are
also hooked.  A run stage essentially creates a node in the dependency
graph such that all classes assigned to that stage have a before
relationship with that stage and a require relationship with all
previous stages.

You can achieve exactly the same effect without run stages, but it can
be messy.

   

Absolutely the wrong direction (says me).  To the extent possible --
and that's a very large extent -- use only *un*parameterized classes.
I don't see any particular reason to expect that using only
parameterized classes would help here, anyway.
  

Oh good.  But, to rephrase the question, can I control the
stage an unparameterized class gets expressed in?  Or, is
it guaranteed that unparameterized classes are expressed in
stage[main]?  Because if not, it is useless to have
parameterized classes that want to run before stage[main].
 

You can use the class { foo: ... } syntax with unparameterized
classes to assign them to stages (or simply as an alternative to
include), but only once each.  I do not recommend also include ing
the same classes elsewhere in the manifest, which otherwise you could
do with an unparameterized class.

   

First, consider why you (think you) need class Proxy to be
parameterized.

Because, according to the docs I've seen, only parameterized
classes run in stages other than stage[main].  Please clarify
if I'm mistaken.
 

You are mistaken.  You must use the class {foo: } syntax to assign a
class to a run stage, but that class does not need to be
parameterized.

   

 From where does the parameter value come?  If it's
really fixed for all nodes, as in your example, then it would be
better to make it an ordinary variable of class Proxy, or even to
inline it.  Perhaps you could switch to using source=  instead of
content=; then you could change the proxy host at need without
modifying any manifests.

Don't get sidetracked by the details of the example.
My question is about expressing sequence dependencies in puppet.
The proxy is a real-life example of something that should be done first,
never mind that there are other ways to do it.
 


My point is not so much to quibble the details, but to assert that
parameterized classes in general are not everything that they are
cracked up to be.  I like run stages better than parameterized
classes, to the extent that they are separable, but I don't think
those are the first tool anyone should reach for to deal with resource
ordering issues.  That's why I am suggesting alternatives.


   

Then recognize that run stages are purely a convenience feature,
providing nothing that you cannot get by using Puppet's dependency
system more directly.  For instance, you could consider doing this at
top level:
  
Package { require =  Class['proxy'] }

But I really don't want to require it.
I want to express that IF a node has Class['proxy'],
then proxy needs to go first.
 


That strikes me as a possible conceptualization problem, and,
separately, a possible design problem:

On the conceptual level, what does it or *should* it mean that a node
has Class['proxy']?  To you it seems to mean that the node positively
uses an HTTP proxy, at least for Apt.  But it could instead mean that
the node's proxy configuration is managed, which might include
ensuring that it doesn't use a proxy.

And that's where the design problem comes in: what do you do if a node
configured with a proxy ever needs to be reconfigured for direct
connection?  Simply excluding Class['proxy'] from that node's manifest
doesn't do the job: you must actively manage the config file absent.
You could do that by including a different class instead, but it's
smoother to give Class['proxy'] enough brains to know whether to
configure the node with a proxy or without.  If you do that then you
can include it on every node, and you probably would want to do so.


   

Any package that does not specify its own require parameter
will then be applied after class proxy.

This breaks modularity, 

[Puppet Users] Re: run stages and mixed class styles

2011-05-02 Thread jcbollinger

On Apr 29, 11:29 am, R.I.Pienaar r...@devco.net wrote:

 Sounds like you want resource chaining[1], you can resource chaining to affect
 the order of lots of other resources/classes.

 So:

 class aptproxy {
    # set up the proxy

    Class[aptproxy] - Package | provider == apt |

 }

 now if you include the proxy class it will adjust the
 relationships on packages using apt else those packages
 wont have the relationship at all.


That's a nice one.  I had forgotten that resource chaining could be
applied that way.


 careful though this has an unfortunate side effect that it
 will also realize all virtual packages with the provider apt
 onto a node.


Yes, that's an important drawback if you're concerned about the most
general case.  I tend not to use virtual packages, as
(unparameterized) classes provide everything I need for which I might
otherwise use virtual packages, but that's just me.



John

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



[Puppet Users] Resolving/ Expanding module puppet:/// URI in exec line

2011-05-02 Thread Edd Grant
Hi All,

I have defined the following module to untar/unzip and copy the Maven
distributable to a convenient location:

class apache-maven-v3 {
  exec { /bin/tar xzf /etc/puppet/modules/apache-maven-v3/files/
apache-maven-3.0.3-bin.tar.gz:
cwd = /usr/local/java,
creates = /usr/local/java/apache-maven-3.0.3,
  }
  ...
}

The above definition executes perfectly however in order to keep the
module portable I want to replace the absolute path to the .gz file
with a puppet:/// URI e.g.

exec { /bin/tar xzf 
puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz:

When I change the class to use the puppet:/// URI I get the following
error:

(/Stage[main]/Apache-maven-v3/Exec[/bin
/tar xzf puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz]/return
s) change from notrun to 0 failed: /bin/tar xzf puppet:///modules/apache-maven-v
3/apache-maven-3.0.3-bin.tar.gz returned 2 instead of one of [0] at /
etc/puppet/
modules/apache-maven-v3/manifests/init.pp:11

It appears to me that the puppet:/// URI is not being resolved in the
exec and this is causing the tar command to operate on the literal
path puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz
which of course doesn't exist.

Looking at the docs I can't see any examples of puppet:/// being used
in this way, is there anyway I can obtain the resolved absolute path
to pass this in to my exec? Failing that it there a standard approach
for combining a puppet:/// URI with an exec?

Cheers,

Edd

-- 
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: ssh::auth Question

2011-05-02 Thread jcbollinger

On Apr 30, 6:01 pm, Douglas Garstang doug.garst...@gmail.com wrote:
 Hmmm... I'm not sure how else to ask it. Does auth.pp run on the puppet
 master or the clients?

In an agent/master setup, all Puppet manifests are compiled on the
master into a node-specific catalog that is sent to and applied on the
client.  To the extent that by auth.pp running you mean specifically
that particular file's interpretation by the Puppet system, yes, it
happens on the master.  That is by no means the end of the story,
however.

It sounds like you have some specific concerns about the implications
of that answer.  You might receive more helpful responses if you
inquired about whether and how some of those concerns are addressed by
the module.


John

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



Re: [Puppet Users] Resolving/ Expanding module puppet:/// URI in exec line

2011-05-02 Thread Nan Liu
Use a file resource to deploy it to the agent and make the exec depend
on the file resource.

On May 2, 2011, at 7:58, Edd Grant e...@eddgrant.com wrote:

 Hi All,

 I have defined the following module to untar/unzip and copy the Maven
 distributable to a convenient location:

 class apache-maven-v3 {
  exec { /bin/tar xzf /etc/puppet/modules/apache-maven-v3/files/
 apache-maven-3.0.3-bin.tar.gz:
cwd = /usr/local/java,
creates = /usr/local/java/apache-maven-3.0.3,
  }
  ...
 }

 The above definition executes perfectly however in order to keep the
 module portable I want to replace the absolute path to the .gz file
 with a puppet:/// URI e.g.

 exec { /bin/tar xzf 
 puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz:

 When I change the class to use the puppet:/// URI I get the following
 error:

 (/Stage[main]/Apache-maven-v3/Exec[/bin
 /tar xzf 
 puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz]/return
 s) change from notrun to 0 failed: /bin/tar xzf 
 puppet:///modules/apache-maven-v
 3/apache-maven-3.0.3-bin.tar.gz returned 2 instead of one of [0] at /
 etc/puppet/
 modules/apache-maven-v3/manifests/init.pp:11

 It appears to me that the puppet:/// URI is not being resolved in the
 exec and this is causing the tar command to operate on the literal
 path puppet:///modules/apache-maven-v3/apache-maven-3.0.3-bin.tar.gz
 which of course doesn't exist.

 Looking at the docs I can't see any examples of puppet:/// being used
 in this way, is there anyway I can obtain the resolved absolute path
 to pass this in to my exec? Failing that it there a standard approach
 for combining a puppet:/// URI with an exec?

 Cheers,

 Edd

 --
 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] Automating Nagios with Puppet

2011-05-02 Thread Juan-Francisco Diez
Hi all,

Sorry to not reply earlier.

All you mention work fine. The directory can be change using the target
parameter. The path must be absolute.

Thanks for all.

Juan-FRancisco

2011/4/29 lluis ll...@ingent.net

 Hi,
 beware of this if you change default file locations:

 You can purge Nagios resources using the resources type, but only in
 the default file locations. This is an architectural limitation

 on Debian I prefer to link /etc/nagios3/conf.d to /etc/nagios

 greetings,
 Lluís

 El dt 26 de 04 de 2011 a les 12:44 +0200, en/na Cedric Jeanneret va
 escriure:
  Hello again,
 
  Yes, of course you can change the directory.
 
  Check out the mentioned module, we put all the nagios stuff in
 /etc/nagios.d directory, keeping clean a /etc/nagios3 directory. For what
 I've seen, it seems to do exactly what you're trying to do.
 
  For the basic:
  nagios accept different directories for its configuration, you have to
 add them in your nagios.cfg file using the cfg_dir directive. This can be
 done using either a simple file, a template or with augeas (not sure for the
 latest point).
 
  Cheers,
 
  C.
 
  On Tue, 26 Apr 2011 11:48:32 +0200
  Juan-Francisco Diez moch...@gmail.com wrote:
 
   OK, thenks for your help. I solved the trouble using the $hostname fact
 in
   front of services definitions.
  
   But I have another question about this:
  
   Is it possible to define the directory where the file are created in
 the
   nagios server?
  
   Now the files are stored in the /etc/nagios.
  
  
   2011/4/26 Cedric Jeanneret cedric.jeanne...@camptocamp.com
  
Hello,
   
Maybe have a look at our nagios module:
https://github.com/camptocamp/puppet-nagios
   
Your problem is that resources with same name are exported from
 multiple
hosts, and that make puppet crash with duplicated definition (as it's
exported resources, the error message is different ;) ).
You should name your nagios resources with the fqdn embedded so that
 it
will be really unique across the DB.
   
Cheers,
   
C.
   
On Tue, 26 Apr 2011 01:29:03 -0700 (PDT)
Fransua33 moch...@gmail.com wrote:
   
 Hi everyone,

 I'm trying to automate the nagios configuration of new host through
 Puppet. For this I define a nagios module with the generic
 configuration of my Nagios host definition.  The module look like
 this:

 class nagios {
   $packagelist=[nagios]

   package { $packagelist:
   ensure = installed
   }

   $servicelist=[nagios, httpd]

   service { $servicelist:
   ensure  = running,
   hasstatus   = true,
   hasrestart  = true
   }

   # collect resources and populate /etc/nagios/nagios_*.cfg
   Nagios_host | |
   Nagios_service | |
   Nagios_hostextinfo | |

   class target {
   @@nagios_host { $fqdn:
   ensure  = present,
   use =
ingacceso_$operatingsystem-server,
   alias   = $hostname,
   address = $ipaddress,
   contacts=
farconada,henry,fsariego,jfdiez
   }

   @@nagios_hostextinfo { $fqdn:
   ensure  = present,
   icon_image_alt  = $operatingsystem,
   icon_image  = $operatingsystem.png
   }

   @@nagios_service { Host - Carga CPU:
   use =
 ingacceso_generic-service,
   host_name   = $fqdn,
   check_command   = check_nrpe!check_load
   }

   @@nagios_service { Host - CPU:
 use = ingacceso_generic-
 service,
 host_name   = $fqdn,
 check_command   = check_nrpe!check_cpu
 }

   @@nagios_service { Host - Ping:
 use = ingacceso_generic-
 service,
 host_name   = $fqdn,
 check_command   = check_ping!400.0,20%!
 900.0,60%
 }

   @@nagios_service { Host - /:
 use = ingacceso_generic-
 service,
 host_name   = $fqdn,
 check_command   = check_nrpe!check_raiz
 }

   @@nagios_service { Host - /boot:
 use = ingacceso_generic-
 service,
 host_name   = $fqdn,
 check_command   = 

Re: [Puppet Users] Could not request certificate: undefined method `closed?' for nil:NilClass

2011-05-02 Thread Patrick

On May 2, 2011, at 7:43 AM, James Turnbull wrote:

 crosmuller wrote:
 Hi list,
 
 I am trying to get a puppet certificate on a new client but I get
 error:
 
 err: Could not request certificate: undefined method `closed?' for
 nil:NilClass
 
 I googled and found that it had something to do with reverse DNS
 lookup, the client is behind a NAT firewall so I assume a reverse
 lookup will fail. Can I bypass this somehow? Puppet version on master
 and client is 0.25.4
 
 
 This is a Ruby networking issue with 0.25.4 that is fixed in 0.25.5 and
 later.  I'd recommend upgrading.

To be a bit more clear.  This is a bug in the networking code that is hiding 
the real (useful) error message.  Until you get the real error-message it will 
be almost impossible for us to give you help more clear than, fix your 
network.

-- 
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] Could not request certificate: undefined method `closed?' for nil:NilClass

2011-05-02 Thread Chantal Rosmuller
On Mon, May 2, 2011 at 6:56 PM, Patrick kc7...@gmail.com wrote:


 On May 2, 2011, at 7:43 AM, James Turnbull wrote:

  crosmuller wrote:
  Hi list,
 
  I am trying to get a puppet certificate on a new client but I get
  error:
 
  err: Could not request certificate: undefined method `closed?' for
  nil:NilClass
 
  I googled and found that it had something to do with reverse DNS
  lookup, the client is behind a NAT firewall so I assume a reverse
  lookup will fail. Can I bypass this somehow? Puppet version on master
  and client is 0.25.4
 
 
  This is a Ruby networking issue with 0.25.4 that is fixed in 0.25.5 and
  later.  I'd recommend upgrading.

 To be a bit more clear.  This is a bug in the networking code that is
 hiding the real (useful) error message.  Until you get the real
 error-message it will be almost impossible for us to give you help more
 clear than, fix your network.

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


Thank you, I upgraded to 2.6.1 and now I get another error

root@client:~# puppetd --server client.mydomain.com --waitforcert 60 --test

err: Could not retrieve catalog from remote server: Connection refused -
connect(2)
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

I don't understand the error all other clients can contact the puppet server
just fine. The client is Ubuntu 10.04. Like I said the client is behind a
nat firewall, can that be the problem?

-- 
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] Could not request certificate: undefined method `closed?' for nil:NilClass

2011-05-02 Thread Patrick

On May 2, 2011, at 11:01 AM, Chantal Rosmuller wrote:

 
 
 On Mon, May 2, 2011 at 6:56 PM, Patrick kc7...@gmail.com wrote:
 
 On May 2, 2011, at 7:43 AM, James Turnbull wrote:
 
  crosmuller wrote:
  Hi list,
 
  I am trying to get a puppet certificate on a new client but I get
  error:
 
  err: Could not request certificate: undefined method `closed?' for
  nil:NilClass
 
  I googled and found that it had something to do with reverse DNS
  lookup, the client is behind a NAT firewall so I assume a reverse
  lookup will fail. Can I bypass this somehow? Puppet version on master
  and client is 0.25.4
 
 
  This is a Ruby networking issue with 0.25.4 that is fixed in 0.25.5 and
  later.  I'd recommend upgrading.
 
 To be a bit more clear.  This is a bug in the networking code that is hiding 
 the real (useful) error message.  Until you get the real error-message it 
 will be almost impossible for us to give you help more clear than, fix your 
 network.
 
 --
 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.
 
 
 Thank you, I upgraded to 2.6.1 and now I get another error
 
 root@client:~# puppetd --server client.mydomain.com --waitforcert 60 --test
 
 err: Could not retrieve catalog from remote server: Connection refused - 
 connect(2)
 warning: Not using cache on failed catalog
 err: Could not retrieve catalog; skipping run
 
 I don't understand the error all other clients can contact the puppet server 
 just fine. The client is Ubuntu 10.04. Like I said the client is behind a nat 
 firewall, can that be the problem?

First, and someone should have probably explained this to you, if you upgrade 
the major version (0.25-2.6) of the client to be above the server, you will 
have problems, but this doesn't sound like that.  To me it sounds like you are 
behind a restrictive corporate firewall, or else your server is configured 
through something other than puppet, to refuse communications from wherever 
you're connecting from.  This would be a hardware firewall or iptables or 
something.

Does ping work from that box?
Can you ssh in from that box (assuming ssh is turned on)?
Do any other services work in that direction?

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