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', $knotrestversion = '0.0.2-1~ubuntu22.04',
){ ){
$knot_rest_token_secret = lookup({ 'name' => 'knot_rest_token_secret', 'default_value' => undef })
# Stop & disable systemd-resloved # Stop & disable systemd-resloved
service { "systemd-resolved": service { "systemd-resolved":
ensure => 'stopped', ensure => 'stopped',
@ -60,15 +62,16 @@ class dns::knotdns(
} }
# Install KnotREST configuration # Install KnotREST configuration
if $knot_rest_token_secret {
file { "/etc/knot_rest/knot_rest.yaml": file { "/etc/knot_rest/knot_rest.yaml":
ensure => "file", ensure => "file",
content => template("dns/knot/knot_rest.yaml.erb") content => template("dns/knot/knot_rest.yaml.erb")
} }
}
file{"/var/log/knot_rest": file{"/var/log/knot_rest":
ensure => directory, ensure => directory,
mode => '0750', mode => '0750',
owner => 'knot_rest', owner => 'knot_rest',
group => 'knot_rest', group => 'knot_rest',
} }
} }