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?

RikSaunderson
  • 207
  • 4
  • 13

1 Answers1

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 } 
}
Ian
  • 376
  • 1
  • 6