Ask Your Question
0

hiera_exclude

asked 2015-06-11 13:35:12 -0600

rgv gravatar image

Is there anything like hiera_exclude("classes") to exclude a class from some of the nodes but include for rest? Or how to exclude a class for some nodes and include for rest of the nodes?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-06-11 16:35:32 -0600

cbarbour gravatar image

updated 2015-06-12 01:52:50 -0600

hiera_include is simply a hiera lookup and an include bundled into one command. Functionally these are the same:

hiera_include('classes')
include hiera('classes')

You can do what youre asking using the difference() function from puppetlabs/stdlib

$classes = difference(hiera('classes'), hiera('rejected_classes', []))
include $classes
edit flag offensive delete link more

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-06-11 13:35:12 -0600

Seen: 166 times

Last updated: Jun 12 '15