From d4b9d17b3233c0b11296cfb94146bf94e23e00fc Mon Sep 17 00:00:00 2001 From: timdeluxe <5765175+timdeluxe@users.noreply.github.com> Date: Tue, 4 Oct 2022 11:09:38 +0200 Subject: [PATCH] Adding option to not manage pubkey as well as workaround for issue #27 --- manifests/config.pp | 21 +++++++++++---------- manifests/init.pp | 5 +++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 4430b9e..5d9e085 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -165,18 +165,19 @@ } } - $selector = $key['selector'] - $domain = $key['domain'] - $publickey = $key['publickey'] + if($opendkim::manage_public_keys == true) { + $selector = $key['selector'] + $domain = $key['domain'] + $publickey = $key['publickey'] - file { "${opendkim::configdir}/keys/${key['domain']}/${key['selector']}.txt": - ensure => 'file', - content => template('opendkim/public-rsa-key.erb'), - owner => 'root', - group => $opendkim::group, - mode => '0640', + file { "${opendkim::configdir}/keys/${key['domain']}/${key['selector']}.txt": + ensure => 'file', + content => template('opendkim/public-rsa-key.erb'), + owner => 'root', + group => $opendkim::group, + mode => '0640', + } } - } } diff --git a/manifests/init.pp b/manifests/init.pp index 790c178..a04ed04 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -28,6 +28,7 @@ Optional[String] $trustanchorfile = $opendkim::params::trustanchorfile, Optional[Array] $senderheaders = $opendkim::params::senderheaders, Boolean $manage_private_keys = $opendkim::params::manage_private_keys, + Boolean $manage_public_keys = $opendkim::params::manage_public_keys, Boolean $alldomain = $opendkim::params::alldomain, Optional[String] $selector = $opendkim::params::selector, Optional[String] $publickey = $opendkim::params::publickey, @@ -38,8 +39,8 @@ Array[Struct[{ domain => String, selector => String, - publickey => String, - privatekey => Variant[String,Deferred], + publickey => Optional[String], + privatekey => Optional[Variant[String,Deferred]], signingdomains => Array[String], }]] $keys = $opendkim::params::keys,