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

fix the permissions of directories and files and some maintenance stuff #92

Merged
merged 6 commits into from
Sep 8, 2014
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.3-p484
1.9.3-p545
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ script:
- "rake spec SPEC_OPTS='--format documentation'"
env:
- PUPPET_VERSION="~> 2.7.0"
- PUPPET_VERSION="~> 3.0.0"
- PUPPET_VERSION="~> 3.1.0"
- PUPPET_VERSION="~> 3.2.0"
- PUPPET_VERSION="~> 3.3.0"
- PUPPET_VERSION="~> 3.4.0"
- PUPPET_VERSION="~> 3.5.0"
- PUPPET_VERSION="~> 3.6.0"
- PUPPET_VERSION="~> 3.7.0"
matrix:
exclude:
- rvm: 1.9.3
Expand Down
9 changes: 8 additions & 1 deletion manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,18 @@
default => $group
}

File {
group => $group_to_set,
recurse => true,
}

file {
[ "/etc/openvpn/${name}",
"/etc/openvpn/${name}/auth",
"/etc/openvpn/${name}/client-configs",
"/etc/openvpn/${name}/download-configs" ]:
ensure => directory;
mode => '0750',
ensure => directory;
}

exec {
Expand All @@ -386,6 +392,7 @@

file {
"/etc/openvpn/${name}/easy-rsa/revoked":
mode => '0750',
ensure => directory,
require => Exec["copy easy-rsa to openvpn config folder ${name}"];
}
Expand Down
26 changes: 15 additions & 11 deletions spec/defines/openvpn_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@
} }

# Files associated with a server config
it { should contain_file('/etc/openvpn/test_server').with('ensure' => 'directory')}
it { should contain_file('/etc/openvpn/test_server/client-configs').with('ensure' => 'directory')}
it { should contain_file('/etc/openvpn/test_server/download-configs').with('ensure' => 'directory')}
it { should contain_file('/etc/openvpn/test_server/auth').with('ensure' => 'directory')}
it { should contain_file('/etc/openvpn/test_server').
with(:ensure =>'directory', :mode =>'0750', :recurse =>true, :group =>'nogroup') }
it { should contain_file('/etc/openvpn/test_server/client-configs').
with(:ensure =>'directory', :mode =>'0750', :recurse =>true, :group =>'nogroup') }
it { should contain_file('/etc/openvpn/test_server/download-configs').
with(:ensure =>'directory', :mode =>'0750', :recurse =>true, :group =>'nogroup') }
it { should contain_file('/etc/openvpn/test_server/auth').
with(:ensure =>'directory', :mode =>'0750', :recurse =>true, :group =>'nogroup') }
it { should contain_file('/etc/openvpn/test_server/easy-rsa/revoked').
with(:ensure =>'directory', :mode =>'0750', :recurse =>true, :group =>'nogroup') }
it { should contain_file('/etc/openvpn/test_server/easy-rsa/vars')}
it { should contain_file('/etc/openvpn/test_server/easy-rsa/revoked').with('ensure' => 'directory')}
it { should contain_file('/etc/openvpn/test_server/easy-rsa/openssl.cnf')}
it { should contain_file('/etc/openvpn/test_server/easy-rsa/keys/crl.pem').with('target' => '/etc/openvpn/test_server/crl.pem')}
it { should contain_file('/etc/openvpn/test_server/keys').with(
'ensure' => 'link',
'target' => '/etc/openvpn/test_server/easy-rsa/keys'
)}
it { should contain_file('/etc/openvpn/test_server/easy-rsa/openssl.cnf') }
it { should contain_file('/etc/openvpn/test_server/easy-rsa/keys/crl.pem').
with(:ensure =>'link', :target =>'/etc/openvpn/test_server/crl.pem') }
it { should contain_file('/etc/openvpn/test_server/keys').
with(:ensure =>'link', :target =>'/etc/openvpn/test_server/easy-rsa/keys') }

# Execs to working with certificates
it { should contain_exec('copy easy-rsa to openvpn config folder test_server').with(
Expand Down