Skip to content

Commit

Permalink
Merge pull request #92 from luxflux/fix-permissions
Browse files Browse the repository at this point in the history
fix the permissions of directories and files and some maintenance stuff
  • Loading branch information
luxflux committed Sep 8, 2014
2 parents 962ce03 + 6f552ec commit 15935af
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
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

0 comments on commit 15935af

Please sign in to comment.