Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated source_permissions #360

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 37 additions & 13 deletions manifests/ca.pp
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,45 @@
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}"],
}

file { "${etc_directory}/openvpn/${name}/easy-rsa/revoked":
file { "${etc_directory}/openvpn/${name}/easy-rsa":
ensure => directory,
mode => '0750',
recurse => true,
require => File["${etc_directory}/openvpn/${name}/easy-rsa"],
links => 'follow',
ignore => '*.cnf',
owner => 0,
group => 0,
mode => '0755',
source => "file:${openvpn::easyrsa_source}",
require => File["${etc_directory}/openvpn/${name}"],
}

exec { "copy *.cnf files from easyrsa source to ${name}":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that copying data with an exec resource is a good idea. @alexjfisher any ideas?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open for new ideas. From #315 I grab the idea with puppetlabs-rsync which use a exec resource to copy data with rsync.

The current solution is a nasty hack. Thats all what I know.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about restore the old behavior

9f54ab8#diff-b386e10e7f4de7981ca1d52c90456a0dL127

command => "cp '${openvpn::easyrsa_source}/'*.cnf .",
cwd => "${etc_directory}/openvpn/${name}/easy-rsa",
unless => 'ls *.cnf',
provider => 'shell',
require => File["${etc_directory}/openvpn/${name}/easy-rsa"],
before => Exec["initca ${name}"];
}

file {
"${etc_directory}/openvpn/${name}/easy-rsa/.rnd":
ensure => present,
owner => 0,
group => 0,
mode => '0600',
require => File["${etc_directory}/openvpn/${name}/easy-rsa"];
"${etc_directory}/openvpn/${name}/easy-rsa/keys":
ensure => directory,
owner => 0,
group => 0,
mode => '0700',
require => File["${etc_directory}/openvpn/${name}/easy-rsa"];
"${etc_directory}/openvpn/${name}/easy-rsa/revoked":
ensure => directory,
mode => '0750',
recurse => true,
require => File["${etc_directory}/openvpn/${name}/easy-rsa"];
}

case $openvpn::easyrsa_version {
Expand Down