From 7b3fed95f91a6877a88758558babf1bc549eeffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 9 Jun 2023 14:38:51 +0200 Subject: Place each zone and key declaration in own file. This removes the dependency on concat, and allows for non-purging configurations. --- manifests/key.pp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'manifests/key.pp') diff --git a/manifests/key.pp b/manifests/key.pp index c5bdb55..b36bf35 100644 --- a/manifests/key.pp +++ b/manifests/key.pp @@ -8,13 +8,18 @@ # Secret hash, must match algorithm # @param keyname # Name of key +# @param ensure +# Allows for manual removal of the key. Note that if +# $dns::purge_keyconf is true then simply removing the +# dns::key resource removes the file. define dns::key ( String $algorithm, Variant[String, Sensitive[String]] $secret, String $keyname = $name, + Enum['present', 'absent'] $ensure = 'present', ) { - concat::fragment { "Dns::Key - ${keyname}": - target => $dns::config_file, + file { "${dns::keyconf_dir}/${keyname}.conf": + ensure => $ensure, content => epp("${module_name}/key.epp", { keyname => $keyname, algorithm => $algorithm, -- cgit v1.2.3