Ask Your Question
0

generic settings for all specific settings for individual

asked 2015-02-24 12:52:36 -0500

Gintas gravatar image

Hi,

what is the best practice to apply general settings for all nodes + specific settings for each node? I would expect to achieve such behaviour in a similar way as the following:

#I know that this code does not behave as specified in the comments
#Apply these settings on all nodes, including nodes xx.xx.xx.xx and yy.yy.yy.yy 
node * {   
Class["generic"] 
}

#ADDITIONALLY apply specific settings for the specific node node xx.xx.xx.xx 
{  
 Class["SpecificXX"] 
}

#ADDITIONALLY apply specific settings for the specific node node yy.yy.yy.yy 
{   
Class["SpecificYY"] 
}

One workaround I can come up with is to create a module GenericConfModule and use it in all nodes explicitly. However, this still involves some repetition such as "include GenericConfModule".

Cheers, Gin

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-02-24 22:17:30 -0500

GregLarkin gravatar image

I think you would benefit greatly from watching Craig Dunn's excellent presentation about roles and profiles found here: https://puppetlabs.com/presentations/designing-puppet-rolesprofiles-pattern

With well-defined role and profile modules, combined with lookups in a Hiera hierarchical database, you will be able to achieve exactly what you're trying to do with your data and code separated and one business role assigned per node.

Hope that helps!

edit flag offensive delete link more
0

answered 2015-02-25 06:31:12 -0500

Gintas gravatar image

Thanks Greg. Your patience and input is much appreciated!

edit flag offensive delete link more

Comments

Glad to help - cheers!

GregLarkin gravatar imageGregLarkin ( 2015-02-25 09:48:27 -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: 2015-02-24 12:52:36 -0500

Seen: 26 times

Last updated: Feb 25 '15