Ask Your Question
1

how to inherit from regex defined nodes

asked 2014-02-07 17:28:40 -0500

bismark gravatar image

Hey all, I want to keep extending nodes first defined with a matching fqdn regex. suppose I have this:

node /\.domain\.com$/
{
  include stuff1
}
node www2.domain.com    #  inherits /\.domain\.com$/ 
{
  include stuff2
}

Is there any artifact to help solve this?

Thanks in advance

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-02-08 11:18:54 -0500

ramindk gravatar image

Let me be the first to say this is a common idea and also a horrible one. Multiple levels of inheritance within Puppet almost always results in strange problems and not quite getting the config you were expecting.

What you could do is something like

node basenode {
  # this node contains all the common classes that all node should have
  include sshd
  include puppet
  include smnp
  include postfix
  include logrotate
}

node www.domain.com inherits basenode {
  include apache
  include php
}

Rather than loads of inheritance at the node level you might consider looking at Puppet's Role/Profile. The idea is ... (more)

edit flag offensive delete link more

Comments

the problem is that there's an overlapping node definition and I don't know how to handle. Maybe I should make this more clear. I have around a 100 ...(more)

bismark gravatar imagebismark ( 2014-02-10 08:58:50 -0500 )edit

You might want to add that to your question. Couple of idea come to mind. using hiera_include to dynaicallly query for modules to include based on Hiera data for individual ...(more)

ramindk gravatar imageramindk ( 2014-02-10 09:23:37 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-02-07 17:28:40 -0500

Seen: 437 times

Last updated: Feb 08 '14