From 4fcce7637ad239f8107d1fba6479bb9467fe7bd2 Mon Sep 17 00:00:00 2001 From: Raffael Schmid Date: Mon, 8 Sep 2014 15:08:21 +0200 Subject: [PATCH 1/6] use latest 1.9.3 ruby version --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 7a895c21..671d1fe4 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -1.9.3-p484 +1.9.3-p545 From 3dd279f4fa9635a5f0bdbddd1cc6973b4ce7775a Mon Sep 17 00:00:00 2001 From: Raffael Schmid Date: Mon, 8 Sep 2014 15:18:33 +0200 Subject: [PATCH 2/6] Set the permissions of directories and files --- manifests/server.pp | 9 ++++++++- spec/defines/openvpn_server_spec.rb | 15 ++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/manifests/server.pp b/manifests/server.pp index 9a4b4867..68c6baad 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -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 { @@ -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}"]; } diff --git a/spec/defines/openvpn_server_spec.rb b/spec/defines/openvpn_server_spec.rb index ce5f1925..193a931f 100644 --- a/spec/defines/openvpn_server_spec.rb +++ b/spec/defines/openvpn_server_spec.rb @@ -24,14 +24,19 @@ } } # 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/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/easy-rsa/revoked'). + with(ensure: 'directory', mode: '0750', recurse: true, group: 'nogroup') } it { should contain_file('/etc/openvpn/test_server/keys').with( 'ensure' => 'link', 'target' => '/etc/openvpn/test_server/easy-rsa/keys' From 5a32ce90e54ab3623151cb4feea54e6a3f901466 Mon Sep 17 00:00:00 2001 From: Raffael Schmid Date: Mon, 8 Sep 2014 15:20:51 +0200 Subject: [PATCH 3/6] reformat specs for better readability --- spec/defines/openvpn_server_spec.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/spec/defines/openvpn_server_spec.rb b/spec/defines/openvpn_server_spec.rb index 193a931f..903e3dfc 100644 --- a/spec/defines/openvpn_server_spec.rb +++ b/spec/defines/openvpn_server_spec.rb @@ -32,15 +32,14 @@ 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/vars')} - 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/easy-rsa/revoked'). with(ensure: 'directory', mode: '0750', recurse: true, group: 'nogroup') } - 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/vars')} + 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( From d82455ee213e5f4356c0374e8fa07d0cd37ff92f Mon Sep 17 00:00:00 2001 From: Raffael Schmid Date: Mon, 8 Sep 2014 15:23:40 +0200 Subject: [PATCH 4/6] build on puppet 3.7.0 as well --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c9928ac3..24010af0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,7 @@ env: - 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 From 97290b3ea2df5fcb755c7e01283e47fa1b4b34c7 Mon Sep 17 00:00:00 2001 From: Raffael Schmid Date: Mon, 8 Sep 2014 15:29:32 +0200 Subject: [PATCH 5/6] ruby 1.8.7 compatibility --- spec/defines/openvpn_server_spec.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/defines/openvpn_server_spec.rb b/spec/defines/openvpn_server_spec.rb index 903e3dfc..e94eaea7 100644 --- a/spec/defines/openvpn_server_spec.rb +++ b/spec/defines/openvpn_server_spec.rb @@ -25,21 +25,21 @@ # Files associated with a server config it { should contain_file('/etc/openvpn/test_server'). - with(ensure: 'directory', mode: '0750', recurse: true, group: 'nogroup') } + 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') } + 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') } + 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') } + 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') } + 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/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') } + 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') } + 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( From 6f552ec664af9f73a8b019eb2749363d3f7a67c3 Mon Sep 17 00:00:00 2001 From: Raffael Schmid Date: Mon, 8 Sep 2014 15:34:29 +0200 Subject: [PATCH 6/6] remove some older puppet versions to speed up the build --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 24010af0..47552768 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,10 +10,6 @@ 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"