Ask Your Question

how to inherit from regex defined nodes

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

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

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

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


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 -0600 )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 -0600 )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


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

Seen: 538 times

Last updated: Feb 08 '14