Re: [Puppet Users] Installing Jenkins with Puppet fails to import GPG key

2012-04-26 Thread Michael Harris
On Thursday, 26 April 2012 11:17:05 UTC+10, denmat wrote: > > > The way that i import my keys is to set the gpg key for the yum repo like > so: > > yumrepo { "jenkins": > baseurl => "http://pkg.jenkins-ci.org/redhat";, > descr=> "Jenkins", > enabl

[Puppet Users] A simple solution to the "deep directory tree" problem

2012-04-26 Thread Amos Shapira
Hello, Like many others, I once again had to deal with creation of deep directory trees with puppet. I did the usual: file { [ "/a", "/a/b/", "/a/b/c"...]: ensure => directory } And again got sick of it. I still didn't find a good answer for it on the web so here is what I came up with in a

Re: [Puppet Users] Installing Jenkins with Puppet fails to import GPG key

2012-04-26 Thread denmat
Hi, I just spun up a fresh AWS instance and did this: $ cat puppet.repo.pp class jenkins { yumrepo { "jenkins": baseurl => "http://pkg.jenkins-ci.org/redhat";, descr=> "Jenkins", enabled => 1, gpgcheck => 1, gpgkey => "http

Re: [Puppet Users] Re: exec's onlyif parameter fails for a bash one-liner

2012-04-26 Thread Matthias Saou
On Wed, 25 Apr 2012 10:29:23 -0700 (PDT) Shantanu wrote: > > On Apr 25, 11:46 am, Craig Dunn wrote: > > On 25/04/2012 17:01, Shantanu wrote: > > > > > > > > > I would like to 'exec' an installation script 'onlyif' an > > > installation directory is empty. I tried using following bash > > > one-

[Puppet Users] Creating configuration for dhcpd

2012-04-26 Thread Jiří Červenka
Hi, I am trying to set up puppet for creating configuration files for automatic installation. I have a node which runs both puppet master and dhcp server. On this node I wanna create configuration file for dhcpd which will contain static ip address definition for each host. Like this : ... host no

Re: [Puppet Users] Host/Agent should not install if there are no changes in file

2012-04-26 Thread Suresh
class filecheck { include myapp file { "puppet:///modules/myapp/MyApp_GA.tar.gz": owner => 'myapp', group => 'myapp', ensure => latest, path => "/opt/apps/myapp/artifacts/MyApp_GA.tar.gz", } } class myapp::decompress { exec { "myapp::decompress": owner => 'myapp',

[Puppet Users] Optional values from Hiera (no default value)

2012-04-26 Thread Lars Francke
Hello Puppet List, I'm writing a module that should take an optional value and I want to get it (amongst other places) from Hiera. $repository = $::java_repository ? { undef => hiera('java_repository') default => $::java_repository, } But this fails because Hiera raises an error if it can'

[Puppet Users] Re: Host/Agent should not install if there are no changes in file

2012-04-26 Thread jcbollinger
On Apr 25, 10:02 pm, Suresh wrote: > class filecheck { >   include myapp >   file { "puppet:///modules/myapp/MyApp_GA.tar.gz": >     owner => 'myapp', >     group => 'myapp', >     ensure => latest, >     path => "/opt/apps/myapp/artifacts/MyApp_GA.tar.gz", >   } > > } > > class myapp::decompres

[Puppet Users] Re: ordering or chaining for generate() function

2012-04-26 Thread jcbollinger
On Apr 25, 11:49 am, psychobyte wrote: > Essentially, yeah. > > we have a data file that needs updating on the server.  This is done > through a custom script. i want to use generate() to run that script server > side >  before we re-create the config files via puppet.  I want to guarantee that

Re: [Puppet Users] Host/Agent should not install if there are no changes in file

2012-04-26 Thread Michael Baydoun
add something like notify => Exec["myapp::decompress"], to your file resource also, according to the documentation, for a file resource the ensure parameter possible values are *absent*, *present*, *file*, and *directory* I'm not sure what latest is going to do there, but you don't need it, just

Re: [Puppet Users] A simple solution to the "deep directory tree" problem

2012-04-26 Thread Christopher Wood
I hope you have more moments of despair because that's nifty and I'll use it. You could possibly use ruby's dirname and basename (http://ruby-doc.org/core-1.8.7/File.html) inside an inline template to do the directory/file split for you in a single resource. The parameters for permissions and o

[Puppet Users] Mac users: Textbucket scripts for puppet types

2012-04-26 Thread Wolf Noble
Hi Gang, If you're a mac user and haven't heard of text bucket, but find yourself typing the same things semi-often.. you might want to check it out. http://bassetsoftware.com/b.cgi/textbucket/index I started using it about 9 months ago when someone showed me klypper on linux and I went searchi

[Puppet Users] Re: Host/Agent should not install if there are no changes in file

2012-04-26 Thread jcbollinger
On Apr 25, 10:02 pm, Suresh wrote: >   file { "puppet:///modules/myapp/MyApp_GA.tar.gz": >     owner => 'myapp', >     group => 'myapp', >     ensure => latest, >     path => "/opt/apps/myapp/artifacts/MyApp_GA.tar.gz", >   } Furthermore, if you continue to use File and Exec resources instead

[Puppet Users] extdata from MySQL

2012-04-26 Thread Jonathan Gazeley
There doesn't seem to be much information about this on the web, but is it possible to use MySQL as a backend for handling extdata? It would be enormously easier for me to use a database that could be easily updated rather than csv files that live on the puppet master. Cheers, Jonathan -- Yo

Re: [Puppet Users] extdata from MySQL

2012-04-26 Thread Gary Larizza
I believe Craig Dunn had an article on using a MySQL backend for Hiera --> http://www.craigdunn.org/2012/03/introducing-hiera-mysql-mysql-backend-for-hiera/ -- Gary Larizza Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Thursday, April 26, 2012 at 7:36 AM, Jonathan Gazeley wrote:

Re: [Puppet Users] extdata from MySQL

2012-04-26 Thread Craig Dunn
On 26/04/2012 15:51, Gary Larizza wrote: I believe Craig Dunn had an article on using a MySQL backend for Hiera --> http://www.craigdunn.org/2012/03/introducing-hiera-mysql-mysql-backend-for-hiera/ Until hiera 0.3.1 is actually released you'll need to manually apply the patch in http://project

[Puppet Users] Help with parametrized class include

2012-04-26 Thread Andre Nathan
Hello I have some puppet code that does the equivalent of the following. The idea is to have a define "foo" with some actions that must be executed before it runs ("foo::pre"). Since the resources in "foo::pre" can only be defined once, it's implemented as a class, and included from the define: c

[Puppet Users] Templating DHCP3-Server Need To Loop Through Subnets

2012-04-26 Thread Brian Carpio
I know the title doesn't define what I am trying to do very well but this is what I'd like to accomplish. I have a params.pp which defines the subnets I would like to have setup in my .dhcpd.conf.erb, but default the dhcpd.conf looks like this: subnet 192.168.10.0 netmask 255.255.255.0 { range

Re: [Puppet Users] Templating DHCP3-Server Need To Loop Through Subnets

2012-04-26 Thread Greg Sutcliffe
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu 26 Apr 2012 17:24:17 BST, Brian Carpio wrote: > $subnet = [ 192.168.10.0, 192.168.20.0, 192.168.30.0 ] > $range = [ 192.168.10.115 192.168.10.120 ] Sounds like you need a Hash here: $subnets = { '192.168.10.0' => '192.168.10.115 192.168.10.120

[Puppet Users] Re: Templating DHCP3-Server Need To Loop Through Subnets

2012-04-26 Thread Brian Carpio
Thanks Greg. Just what I was looking for! Brian Carpio On Apr 26, 10:43 am, Greg Sutcliffe wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Thu 26 Apr 2012 17:24:17 BST, Brian Carpio wrote: > > > $subnet = [ 192.168.10.0, 192.168.20.0, 192.168.30.0 ] > > $range = [ 192.168.10.115

Re: [Puppet Users] Optional values from Hiera (no default value)

2012-04-26 Thread Tim Mooney
In regard to: [Puppet Users] Optional values from Hiera (no default value),...: Hello Puppet List, I'm writing a module that should take an optional value and I want to get it (amongst other places) from Hiera. $repository = $::java_repository ? { undef => hiera('java_repository') default

Re: [Puppet Users] Installing Jenkins with Puppet fails to import GPG key

2012-04-26 Thread Michael Harris
On Thursday, 26 April 2012 18:33:18 UTC+10, denmat wrote: > > Hi, I just spun up a fresh AWS instance and did this: > > $ cat puppet.repo.pp > class jenkins { > > yumrepo { "jenkins": > baseurl => "http://pkg.jenkins-ci.org/redhat";, > descr=> "Jenkins", >

Re: [Puppet Users] Optional values from Hiera (no default value)

2012-04-26 Thread Lars Francke
Hey Tim, thanks for your answer. > hiera() can take a second argument which is the default you want to > supply if no data store provides a value.  Before you ask, no, I don't > know where that's documented, but we've been using it for a while in > our puppet manifests and it has been mentioned o

[Puppet Users] Using backreferences from node name regex match

2012-04-26 Thread Guy Knights
I appears that backreferences when using regexes in node names doesn't work. Can anyone confirm this? If I'm incorrect, how do I go about using a backreference to the name regex within the node definition container? Thanks, Guy -- You received this message because you are subscribed to the Go

Re: [Puppet Users] Re: Why latest stable Debian Squeeze package is 2.6.2-5+squeeze4 please ?

2012-04-26 Thread Michael Stahnke
Added a pull request to puppet-docs https://github.com/puppetlabs/puppet-docs/pull/67 Updated the wiki as well. On Tue, Apr 24, 2012 at 2:35 AM, Christophe L wrote: > Hello Mike, > > Sorry for the late feedback. > > On this page > http://docs.puppetlabs.com/guides/installation.html > it is writ

Re: [Puppet Users] Re: Creating a system module path (starting with Telly)

2012-04-26 Thread Michael Stahnke
On Tue, Apr 24, 2012 at 1:53 AM, Bill Proud wrote: > Sounds good. > > One problem that I have with the forge is that the extent to which the > modules have been tested is not clear to me.  Can I take it that the core > modules that ship with puppet will have been through a similar testing cycle >

[Puppet Users] Re: Using backreferences from node name regex match

2012-04-26 Thread Nick Fagerlund
Yeah, I'm pretty sure that's not supported. But you could implement whatever you're trying to do with a regular regex match, if you need to. Use the built-in $clientcert variable, which contains the node's certname. (This assumes you're doing the default behavior of using the certname as the node

Re: [Puppet Users] Installing Jenkins with Puppet fails to import GPG key

2012-04-26 Thread Michael Harris
The following manifest results in the jenkins and epel repos being installed, rpm -qa gpg-pub* shows the epel key but not the jenkins key, and git is installed but not jenkins. class jenkins { yumrepo {"jenkins": baseurl => "http://pkg.jenkins-ci.org/redhat";, desc

Re: [Puppet Users] Installing Jenkins with Puppet fails to import GPG key

2012-04-26 Thread denmat
Well, the good news is you're not crazy :) I loaded up a 5.7 instance and puppet 2.7.9+ and got the same result as you! I did a yum update and got the same issue - so it is not a common issue that is already fixed. I did a manual rpm --import of the key and the subsequent yum install worked. It