Re: [Puppet Users] ensure => file, creating directories

2011-11-29 Thread Russell Howe
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 29/11/11 14:06, jasper.hargrea...@m-w.co.uk wrote:
> Hi all,
> 
> Recently upgraded one of our puppet servers from 2.6.4 to 2.7.5, and


>   
> "puppet://puppet/modules/standalone-configs/$folder/$name-$type-
> $fqdn",

Try


"puppet://puppet/modules/standalone-configs/${folder}/${name}-${type}-${fqdn}",

See http://projects.puppetlabs.com/issues/10146

I don't know if that will fix your directories issue, but it can't hurt
and shouldn't break even if you downgrade I think.

- -- 
Russell Howe
rh...@moonfruit.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJO1R7gAAoJEJ2trZuuThLOUVUH/iMg+hNS18hrOtqx9+4NGlp4
1BJP4iWchjsdX3RCaj6jjJMnVFwwJ1UG8yJyS9+7WspjGnsQlZ04nBPz5JsLB9/H
T3y4+2NdRvXTQeDctE4u9e3N330FSlRxvYp6A3NHjfldjX7zn6AQj6JYRedxq9NF
afz0F5cSZYqkZ+gffcOhWwQS7ZxyPMD0XsgWftpA+G402GgZca2ZO8yIdb79iQlD
Y3fuW4wH2CU+KUFDAcAEdqhN7NgChrUFJYAJpLeZ5EdZdznZFk9mQbyMfSZwvgxk
sEShQTvYo1ft7EEQnBgCRSen2LwzQSIWAPeffxR/TajkJYHEnoSLEFCyWVZmdyw=
=07Ph
-END PGP SIGNATURE-

-- 
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] Class Including.

2011-11-03 Thread Russell Howe
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 02/11/11 22:15, Douglas Garstang wrote:
> Ok, what am I doing wrong here? I'm including
> splunkforwarder::app_server and it's all working except that it
> appears that splunkforwarder::common isn't including
> splunkforwarder::enabled...
> 
> class splunkforwarder::enabled {
> service {
> 'splunkforwarder':
> ensure => running,
> enable => true,
> hasrestart => true,
> hasstatus  => true;
        ^
This should be either not here or a comma

- -- 
Russell Howe
rh...@moonfruit.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQEcBAEBAgAGBQJOsmzDAAoJEJ2trZuuThLOrvEIAKa4AfZokKk4BILj1Nker1IY
HuB80FmBdWMfZ27VPJ7DGbQo7GonDtPESdvcRNobdf1GsjET3MqXUe8lOQnqdVRo
usKefg+0ZzCSda3uFmL3fp36uR3R7BAIN3rvr3VjZGXyghmyx3vj7vhc5BLLYbgY
e+XfnDZjHsTI0gpLcH05aN4RUWXQalWZWh2uzzcCohsxkcRVbOMjPYRVoASBfEMb
BqWtwH/ICDPoP+3s2hSGZvyl2QSLym+hJY+sZ2bKW6w17O5oD/aYz4aMMBihQLJA
OE7DaE++jvwKg3EfT/FOsExZPgZeYB5AxZE5zShUPl+P6s2oNzmyOwriXgwxlgk=
=oQgS
-END PGP SIGNATURE-

-- 
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] How To Expand an .erb Template Without Doing a Full Puppet Run?

2011-09-15 Thread Russell Howe

On 15/09/11 04:24, Jon Forrest wrote:

In fact, this is only a special case of the more
general problem of getting access to any file generated
by a puppet run without actually putting the files
in the ultimate destination. In other words, it would
be like a --test run except files will be generated and
kept.


I have two ideas. The first is to introduce a preflight check run stage 
which has a clone of whatever you use to generate the zonefile, but puts 
it somewhere else and then does an exec with named-checkzone etc. If run 
stage "main" depends on "preflight" that should do the right thing 
assuming that failures of earlier run stages prevent execution of later 
ones.


I'm not sure if that could lead to a race condition should someone 
update the data between the preflight check and the main manifest run 
though. Also you may find that your preflight stage requires things 
which are in your main stage (installation of packages etc) which will 
just get messy.


The other option which I think I prefer is to have puppet deploy your 
zone files to a staging area, exec named-checkzone and whatever else you 
want to do and then have an exec or similar which moves the staged 
zonefiles into place on your nameserver. Make that exec depend on your 
sanity checks and it will only run if the zonefiles check out OK.


You could even go so far as to stage your zonefiles into a git repo or 
similar on your nameserver and end up with something like:


vcsrepo { "/staging/location":
# Set up git repo
}

file { "/staging/location/zone.a":
 # whatever gets zone.a there
}

exec { "check /staging/location/zone.a":
command => "named-checkzone /staging/location/zone.a",
require => 
[File["/staging/location/zone.a"],Vcsrepo["/staging/location"]],
}

exec { "commit staged zonefiles",
command => "git commit ...",
require => Exec["check /staging/location/zone.a"],
# ...
}

exec { "deploy zonefiles to nameserver",
	command => "tar cp . -C /staging/location | tar xp -C 
/var/lib/named/zones",

require => Exec["commit staged zonefiles"],
notify  => Service["named"],
}

--
Russell Howe
rh...@moonfruit.com

--
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: Resources existing in different operating systems.

2011-06-03 Thread Russell Howe
> What if the file doesn't exist at all on the other distro? I 
> know for example that centos creates a symlink from 
> /boot/grub/grub.conf to /etc/grub.conf. What if I only wanted 
> to manage this file for CentOS, and for other distro's, do nothing ?

Put the file resource inside the case statement itself?

-- 
Russell Howe
rh...@moonfruit.com

-- 
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: Resources existing in different operating systems.

2011-06-03 Thread Russell Howe
> -Original Message-
> From: puppet-users@googlegroups.com 
> [mailto:puppet-users@googlegroups.com] On Behalf Of Douglas Garstang
> Sent: 03 June 2011 16:21
> To: puppet-users@googlegroups.com
> Subject: Re: [Puppet Users] Re: Resources existing in 
> different operating systems.

> All I was asking for was a way to conditional manage a 
> resource based on the operating system. Something like:
> 
> file {
> 
> $operatingsystem ? {
>   'centos' => {
> "/etc/somefile":
> source =>  
>   },
>   'default' => {}
> }
> 
> Haven't tried it, but I don't think that's allowed.
> 
> Doug.

How about

case $operatingsystem {
'centos': { $filesource = "/bar" }
default: { $filesource = "/foo" }
}

file { "name":
source => $filesource,
# ...
}

-- 
Russell Howe
rh...@moonfruit.com

-- 
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: Any good documentation NGINX + Passenger + Puppet?

2011-06-02 Thread Russell Howe
> 3. SO my next issue is a function I wrote (random minute for 
> cron), this stopped working, So instead of executing the 
> function is takes is a value... Anyone ???

I can't help with the problem you're having, but would this do for your
random minute?

# Random minute between 10 past and 10 to the hour
$random_minute = fqdn_rand(40) + 10
cron { "foo":
command => "bar",
minute  => $random_minute,
ensure  => present,
}

fqdn_rand is described here: 
http://docs.puppetlabs.com/references/stable/function.html#fqdnrand

-- 
Russell Howe
rh...@moonfruit.com

-- 
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: templates on puppetmaster, shipped via scp to clients

2011-05-04 Thread Russell Howe
> Sent: 04 May 2011 16:07
> To: Puppet Users
> Subject: [Puppet Users] Re: templates on puppetmaster, 
> shipped via scp to clients
> 
> Thanks Russell and Felix!  That makes plenty of sense - the 
> puppet client can do all the manifest and template processing 
> that puppetmaster can do, plus it has access to facter facts.

I mean you don't even necessarily need the puppet client.

If you can pass the facter facts into erb you should be able to
process the templates directly I think.

-- 
Russell Howe
rh...@moonfruit.com

-- 
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: Resolving/ Expanding module puppet:/// URI in exec line

2011-05-04 Thread Russell Howe

> On 05/03/2011 08:37 PM, Edd Grant wrote:
> > Hi Martin,
> > 
> > Have tried this out and have noticed that the copied .gz 
> file is left in /usr/share/java after unpacking.

Is this so bad? I would probably do something like:

$tarball_dir = "/usr/local/src"
$maven_version = "1.2.3"

file { "$tarball_dir/apache-maven-$maven_version.tar.gz":
source => "puppet:///..."
[..]
}

exec { "extract maven archive" :
command => "/usr/bin/tar xzf 
$tarball_dir/apache-maven-$maven_version.tar.gz -C /usr/share/java",
require => File["$tarball_dir/apache-maven-$maven_version.tar.gz"]
}

Or somesuch and leave the tarball where it is.

If you want to prune old tarballs you could do something ugly like

exec { "cleanup old maven tarballs":
command => "/bin/find $tarball_dir -name 
'apache-maven-*.tar.gz'|/bin/grep -v 
apache-maven-$maven_version.tar.gz|/bin/xargs rm -f"
}

or do it the puppet way with a load of file { "foo": ensure => absent }

or have the first file be file { ".../apache-maven.tar.gz": source => 
"puppet:///.../apache-maven-$maven_version.tar.gz" } so that the filename is 
invariant, but the contents get replaced with whichever version you pick. This 
method has the advantage that you don't get a buildup of old tarballs on the 
node.

You could even do

exec { "download and extract mvn" :
command => "/usr/bin/curl 
http://foo/apache-maven-$maven_version.tar.gz|/usr/bin/tar xz -C 
/usr/share/java",
creates => "[...]",
}

Many ways to crack this egg, and I'm sure people will suggest others.

-- 
Russell Howe
rh...@moonfruit.com

-- 
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] templates on puppetmaster, shipped via scp to clients

2011-05-04 Thread Russell Howe
> Subject: [Puppet Users] templates on puppetmaster, shipped 
> via scp to clients
> 
> Hi folks,
> 
> I can't run puppet client on my nodes.  I want to fake facter 
> info to process templates and ship them via scp to my nodes.  
> Is it possible?
> Strategies?

I think puppet just uses the erb program to process its templates
so you should just be able to use that directly, I would expect.

-- 
Russell Howe
rh...@moonfruit.com

-- 
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] is it possible to take definition parameters from a database?

2011-04-20 Thread Russell Howe
> -Original Message-
> From: puppet-users@googlegroups.com 
> [mailto:puppet-users@googlegroups.com] On Behalf Of rowan holmes
> Sent: 19 April 2011 22:22
> To: Puppet Users
> Subject: [Puppet Users] is it possible to take definition 
> parameters from a database?
> 
> There may be thousands of lines like above. so is it possible 
> to store val1, val2 values in a database and do our job only 
> calling a line like this:
> 
> for every $p1 and $p2 in valueTable in mypuppetDB:
>apache:addvhost {"abc": param1=>$p1, param2=>$p2}

I don't know about doing it via puppet - I suspect not without custom
Functions and/or outside help.

I assume you know about this:

http://httpd.apache.org/docs/2.0/vhosts/mass.html

and deem it not suitable.

-- 
Russell Howe
rh...@moonfruit.com

-- 
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] Dependencies between nodes

2011-04-19 Thread Russell Howe
> -Original Message-
> From: puppet-users@googlegroups.com 
> [mailto:puppet-users@googlegroups.com] On Behalf Of Michael.Lausch
> Sent: 17 April 2011 09:56
> To: Puppet Users
> Subject: [Puppet Users] Dependencies between nodes
> 
> Hi,
> I'm just getting my feet wet with puppet and I want to solve 
> inter- node dependencies.
> For example I want to install client-server programs on 
> different nodes and make sure the version installed on the 
> clients are the same as on the server. The concrete example 
> used C# WCF server and client components.
> I have two tasks to do
> 
> 1) I will insert/configure the SOAP endpoints in the clients 
> config files using data from the SOAP server recipe (http 
> port, host name(s) of nodes where the server is installed
> 
> 2) If configuring a client, check if a server with a matching 
> version is installed somewhere
> 
> I know that puppet may need some work to make it run on 
> windows and therefore i want to check if this scenario can be 
> implemented using puppet, before "wasting" work on making 
> sure if this can be done

You may be able to consider using "environments" for this - each
environment would only have a specific version available to both
Clients and servers within that environment.

So long as you don't mix environments between nodes you ought to
be OK.

It might not be smart enough to cope with your scenario though
and it's a bit all-or-nothing.

-- 
Russell Howe
rh...@moonfruit.com

-- 
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] How to manage a big cluster of 100s of node?

2011-04-15 Thread Russell Howe
> -Original Message-
> From: puppet-users@googlegroups.com 
> [mailto:puppet-users@googlegroups.com] On Behalf Of Sans
> Sent: 15 April 2011 11:57
> To: Puppet Users
> Subject: [Puppet Users] How to manage a big cluster of 100s of node?
> 
> to 80 machines, how do I do that? I don't think the only way 
> is to add individual node one by one in the nodes.pp. How do 
> you guys do it? You input/comment is already appreciated. Cheers!!

You can pattern match on the hostname in the node definition...

-- 
Russell Howe
rh...@moonfruit.com

-- 
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: allow_duplicate_certs = true not working?

2011-04-15 Thread Russell Howe
> -Original Message-
> From: puppet-users@googlegroups.com 
> [mailto:puppet-users@googlegroups.com] On Behalf Of Jake - USPS
> Sent: 14 April 2011 19:58
> To: Puppet Users
> Subject: [Puppet Users] Re: allow_duplicate_certs = true not working?
> 
> Thanks Matt.  Just for clarification on why I'm trying to do 
> this.  We often rebuild systems in our environment.  Things 
> are 'decommissioned', hostname 'released' and new system 
> built with previously used hostname for new purposes.

Apologies for sending an email from Outlook, but could you store up a stash of 
the certificate and private key from when a host is commissioned and then place 
it on the host next time it's built?

-- 
Russell Howe
rh...@moonfruit.com

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