[Puppet Users] Re: Conditional host file entries, Puppet's non-sequential tree

2009-08-22 Thread Duncan Hill

2009/8/21 Duncan Hill bajand...@googlemail.com:
 2009/8/20 Larry Ludwig la...@reductivelabs.com:


 On Aug 19, 2009, at 11:03 AM, Duncan Hill wrote:

 why not define the variables per 'node'?  Why use inheritance at all?
 Personally I'm not a fan of node inheritance and like putting all of
 the classes in another class which then is in included in each node.

 node foo {
  $ip1 = 1.1.1.1
  $ip2 = 2.2.2.2

  include host_definitions
 }

 class host_definitions {
  host {
  'fred': { ip = $ip1, alias = [ a, b, c ] }
  }
 }

 and more often than not I get an error that $ip1 isn't defined, and
 puppet falls over in a heap.

Well, now it works.  So I'll spend the weekend refactoring my setup to
behave in this manner, and hopefully lots of problems will go away.
Thanks Larry.

--~--~-~--~~~---~--~~
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: Conditional host file entries, Puppet's non-sequential tree

2009-08-21 Thread Duncan Hill

2009/8/20 Larry Ludwig la...@reductivelabs.com:


 On Aug 19, 2009, at 11:03 AM, Duncan Hill wrote:

 why not define the variables per 'node'?  Why use inheritance at all?
 Personally I'm not a fan of node inheritance and like putting all of
 the classes in another class which then is in included in each node.

I can do this, it just amplifies my work rather than reducing it.

The scenario is multiple stacks of 'identical' servers - Glassfish,
Tomcat, Postgres.  All of them have identical host files in terms of
names that are aliased to the IP addresses, it's just the addresses
that change.  (Basically, umpteen development or QA environments in
VMware, all configured the same barring the IPs that the symbolic
names point to.)

So each node needs to define a set of IP addresses in variables, and I
just change the block of variables for each server, conditional on the
hostname, generating custom host addresses.  Well, that was the theory
at least.

I've tried the approach of

node foo {
 $ip1 = 1.1.1.1
 $ip2 = 2.2.2.2

 include host_definitions
}

class host_definitions {
 host {
  'fred': { ip = $ip1, alias = [ a, b, c ] }
 }
}

and more often than not I get an error that $ip1 isn't defined, and
puppet falls over in a heap.

Inheritance has been useful for me, but I am actually moving a lot of
code over to class/module based (as and when I can; the current system
works, and I have enough keeping me busy that rewriting it isn't high
on the list).

Cheers.

--~--~-~--~~~---~--~~
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] Conditional host file entries, Puppet's non-sequential tree

2009-08-19 Thread Duncan Hill

Hello folks,

Running 0.24.6, and I need a clue-by-4 with something I'm trying to do.

I have a single manifest file, used by 3 servers.  Depending on the
server name, I need to allocate a different set of variables that get
used to populate a host {} block.

Since Puppet doesn't work in a top-down manner, this has a chance of
working sometimes, but not all the time.

A convoluted approach that just came to mind is to use inheritance
tricks.  Namely:

node application-server inherits generic-server {
 all common stuff other than hosts
 possibly the if logic to set the IPs
}
node specific-1 inherits application-server {
 host {}
}
node specific-2 inherits application-server {
 host {}
}

Are there any better solutions to this?  I'm making the assumption
(that I'm about to test) that inheritance is top-down.

--~--~-~--~~~---~--~~
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: ANNOUNCE: 0.25.0 Release Candidate 1 is out!

2009-08-05 Thread Duncan Hill

2009/8/4 James Turnbull ja...@lovedthanlost.net:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 This is the rc1 release of Puppet 0.25.0.

 It is available at:

 http://reductivelabs.com/downloads/puppet/puppet-0.25.0rc1.tar.gz
 New Language Features
 - -

 Regular expression matching is now possible in node definitions.

 node /web|db/ {
    include blah
 }

 node /^(foo|bar)\.example\.com$/ {
    include blah
 }

 Puppet now also allows regular expressions in if statements with the use
 of the =~ (match) and !~ (not match) operators.

 if $uname =~ /Linux|Debian/ {
  ...
 }

Woot!  This solves a problem I've just created for myself (multiple
servers that are all essentially identical other than their name and
IP) in a much nicer method than I was using.

--~--~-~--~~~---~--~~
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: 32bit and 64bit versions of packages

2009-08-05 Thread Duncan Hill

2009/8/4 Ohad Levy ohadl...@gmail.com:
 Hi,

 It does work, the main problem is that usually libs are dependents of other
 rpms.
 if you do it this way, you have to find out the  each and every lib rpm
 which the application you actually want to use depends upon.

Yum certainly handles this.

What I have done in the past is store the 64 and 32-bit RPMs in the
same repository.  yum install package then grabs both unless you
explicitly override the arch.  (To be honest, this bit me in the ass
with an install and then I realised that it was a useful trick.)

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