Create knot_rest_token_secret variable from secret

This commit is contained in:
Patrik Lundin 2024-06-13 09:39:05 +02:00
parent a54c86b584
commit 27289f0be5
Signed by: patlu
GPG key ID: A0A812BA2249F294

View file

@ -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',
}
}