From 3ed4fbca32dec6381fc6985be40e5a75443bc5d9 Mon Sep 17 00:00:00 2001 From: Nicolas Bigler Date: Fri, 13 Dec 2019 17:08:26 +0100 Subject: [PATCH] Replace deprecated source_permissions parameter The parameter has been deprecated by Puppetlabs and will be removed in Puppet6. In order to ensure that the module keeps working in the future the functionality of the parameter had to be replaced. The only easy way to solve this, is by using an exec statement that uses rsync to sync the files from the source folder --- manifests/ca.pp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/manifests/ca.pp b/manifests/ca.pp index 6d123b73..55328d92 100644 --- a/manifests/ca.pp +++ b/manifests/ca.pp @@ -62,21 +62,17 @@ mode => '0750' }) - file { "${etc_directory}/openvpn/${name}/easy-rsa" : - ensure => directory, - recurse => true, - links => 'follow', - source_permissions => 'use', - group => 0, - source => "file:${openvpn::easyrsa_source}", - require => File["${etc_directory}/openvpn/${name}"], + exec { "init easy-rsa ${name}": + command => "rsync -a --exclude vars ${openvpn::easyrsa_source} ${etc_directory}/openvpn/${name}/easy-rsa", + provider => "shell", + require => File["${etc_directory}/openvpn/${name}"], } file { "${etc_directory}/openvpn/${name}/easy-rsa/revoked": ensure => directory, mode => '0750', recurse => true, - require => File["${etc_directory}/openvpn/${name}/easy-rsa"], + require => Exec["init easy-rsa ${name}"], } case $openvpn::easyrsa_version { @@ -85,7 +81,7 @@ ensure => file, mode => '0550', content => template('openvpn/vars.erb'), - require => File["${etc_directory}/openvpn/${name}/easy-rsa"], + require => Exec["init easy-rsa ${name}"], } if $openvpn::link_openssl_cnf { @@ -151,7 +147,7 @@ 'key_ou' => $key_ou, } ), - require => File["${etc_directory}/openvpn/${name}/easy-rsa"], + require => Exec["init easy-rsa ${name}"], } if $openvpn::link_openssl_cnf { @@ -208,14 +204,14 @@ } file { "${etc_directory}/openvpn/${name}/easy-rsa/openssl.cnf": - require => File["${etc_directory}/openvpn/${name}/easy-rsa"], + require => Exec["init easy-rsa ${name}"], } file { "${etc_directory}/openvpn/${name}/keys": ensure => link, target => "${etc_directory}/openvpn/${name}/easy-rsa/keys", mode => '0640', - require => File["${etc_directory}/openvpn/${name}/easy-rsa"], + require => Exec["init easy-rsa ${name}"], } file { "${etc_directory}/openvpn/${name}/crl.pem":