0

I have a site.pp file which looks like this:

Package {allow_virtual => false,}

stage { 'pre': before => Stage['main'] }
stage { 'post': require => Stage['main'] }

resources { 'firewall': purge => true }

node default {
  hiera_include('classes')
}

I’d like to be able to set the firewall purge line based on the value of a hiera parameter. Is this possible?

1 Answer 1

0

You don't say which version of puppet you're using but this should work with any recent version . Add this to hiera:

firewall::purge: true

Then modify your site.pp like this:

if hiera('firewall::purge') {
    resources { 'firewall': purge => true } 
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .