I solve similar problem using the parameter option in external nodes.
cheers,
Ohad
On Thu, Nov 13, 2008 at 7:47 PM, Mark Drayton <[EMAIL PROTECTED]> wrote:
>
> Hi there
>
> In common with many of you, we run various types of server
> (webservers, mail gateways, etc) in several datacentres. I can't work
> out a clean way to configure location-specific variables in otherwise
> identically-configured servers. These location-dependent settings are
> used in many modules: e.g., the HTTP proxy name is needed by yum,
> Apache, Squid, etc.
>
> At the moment I'm using a pretty clumsy-feeling set of custom facts. I
> have a $location fact that determines the location from $domain and
> then installs a specific /etc/facts.txt file containing the location-
> specific settings, which are turned into Facter variables using
> another custom fact. This sort of works, but it's not ideal: what if
> the domain name doesn't match the location? It also falls flat on its
> face during the bootstrap run; I need to configure yum to use a proxy
> in the first instance, but I don't know the proxy name until I've run
> Puppet once to fact sync and then a second time to use the facts. It
> all feels very brittle.
>
> I could set global variables in the node definitions:
>
> node "web1.london.my.domain" {
> include apache
> include sendmail
> $httpproxy = "http-proxy.london.my.domain"
> $dnsservers = ["10.1.1.1", "10.1.1.2"]
> }
>
> node "web1.ny.my.domain" {
> include apache
> include sendmail
> $httpproxy = "http-proxy.ny.my.domain"
> $dnsservers = ["10.2.2.1", "10.2.2.2"]
> }
>
> This doesn't seem very Puppety to me. I'd prefer:
>
> node "web1.london.my.domain" {
> include apache
> include sendmail
> include location::london
> }
>
> node "web1.ny.my.domain" {
> include apache
> include sendmail
> include location::ny
> }
>
> Where the appropriate location class somehow informs other classes
> that need to make changes based on the node's location. Obviously
> setting variables inside location will scope them to location, where
> apache:: and friends can't see them. And I don't particularly like
> setting a slew of global variables for every node (yeah, LDAP or
> external nodes would help; they're on the todo list) -- it's not very
> DRY.
>
> So, how're you coping with this?
>
> Cheers,
>
> Mark
>
> PS I know, I should configure my HTTP proxy name to be http-proxy.
> $datacentre.my.domain so "http_proxy=http-proxy" works in all
> locations. I'm heading that way, but it's not a lot more flexible and
> some services (DNS resolvers) have to be listed by IP anyway.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---