Skip to content

Commit

Permalink
Replace deprecated source_permissions parameter
Browse files Browse the repository at this point in the history
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
  • Loading branch information
TheBigLee committed Dec 13, 2019
1 parent 5f8c245 commit 3ed4fbc
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions manifests/ca.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit 3ed4fbc

Please sign in to comment.