diff --git a/global/overlay/etc/puppet/modules/dns/manifests/knotdns.pp b/global/overlay/etc/puppet/modules/dns/manifests/knotdns.pp index 3f241c9..b5e1998 100644 --- a/global/overlay/etc/puppet/modules/dns/manifests/knotdns.pp +++ b/global/overlay/etc/puppet/modules/dns/manifests/knotdns.pp @@ -4,6 +4,8 @@ class dns::knotdns( $knotrestversion = '0.0.2-1~ubuntu22.04', ){ + $knot_rest_token_secret = lookup({ 'name' => 'knot_rest_token_secret', 'default_value' => undef }) + # Stop & disable systemd-resloved service { "systemd-resolved": ensure => 'stopped', @@ -60,9 +62,11 @@ class dns::knotdns( } # Install KnotREST configuration - file { "/etc/knot_rest/knot_rest.yaml": - ensure => "file", - content => template("dns/knot/knot_rest.yaml.erb") + if $knot_rest_token_secret { + file { "/etc/knot_rest/knot_rest.yaml": + ensure => "file", + content => template("dns/knot/knot_rest.yaml.erb") + } } file{"/var/log/knot_rest": ensure => directory, @@ -70,5 +74,4 @@ class dns::knotdns( owner => 'knot_rest', group => 'knot_rest', } - }