beaker-puppet_install_helper 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfd5c439c7716c6e608e803b8b233c871a6added
4
- data.tar.gz: 51ad611cb0b5d67beb392d51914e221ab6c4ca1f
3
+ metadata.gz: be59c64ddf1bbf2d6467a1dcf22efb203441323b
4
+ data.tar.gz: e838e73da0145c0f8181572ca105114c1189acca
5
5
  SHA512:
6
- metadata.gz: 57d559f50199430bffa0fa7565a161cfd62395e24f335935d8c192b46c3a08cab4abd4c8b20cbd6d80c4e936ad99d17dee193a27cb6c1f1d9b86acff5153fcc5
7
- data.tar.gz: 981118b529218403ab27707c1e0fc2e6d1c5a176a9face7c9f0e15ad440f77b435a125b17231ee394e90d2c7f173d6d9e8d42d403199346667707e2a6503db79
6
+ metadata.gz: 04bb1747fd6ca6591807da4b9fc0785d2a3a0a178b114034de7621a04053998e51699e55c20012d9871cb1c56c9e456e04fc35c7ee8a9285ec978a7c4d057d24
7
+ data.tar.gz: 3b1c6beed2aa8f5fc2f0b2242d4e4a5cf5847d5e71e420c225c6f7c8b98b93c6ad46925baa2487865a1b63ff649d16af39858c76ff8c2f835435b0ec5318c0c6
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "beaker-puppet_install_helper"
3
- s.version = '0.3.1'
3
+ s.version = '0.4.0'
4
4
  s.authors = ["Puppetlabs"]
5
5
  s.email = ["hunter@puppetlabs.com"]
6
6
  s.homepage = "https://github.com/puppetlabs/beaker-puppet_install_helper"
@@ -15,11 +15,13 @@ module Beaker::CaCertHelper
15
15
  #
16
16
  ##
17
17
  def install_ca_certs_on(hosts)
18
- Array[hosts].each do |host|
18
+ [hosts].flatten.each do |host|
19
19
  get_cert_hash.each do |cert_name, ca|
20
20
  create_cert_on_host(host, cert_name, ca)
21
21
  if host['platform'] =~ /windows/i
22
22
  add_windows_cert host, cert_name
23
+ elsif host['platform'] =~ /solaris/i
24
+ add_solaris_cert host, cert_name
23
25
  end
24
26
  end
25
27
  end
@@ -40,6 +42,14 @@ module Beaker::CaCertHelper
40
42
  on host, "cmd /c certutil -v -addstore Root `cygpath -w #{ca_filename}`"
41
43
  end
42
44
 
45
+ ##
46
+ # Install cert, assumes cygwin currently
47
+ ##
48
+ def add_solaris_cert(host, ca_filename)
49
+ on host, "echo '# #{ca_filename}' >> /opt/puppet/ssl/cert.pem"
50
+ on host, "cat #{ca_filename} >> /opt/puppet/ssl/cert.pem"
51
+ end
52
+
43
53
  ##
44
54
  # Returns a hash of certificates where the Key is the pem cert name, and the value is the certificate
45
55
  # @return Hash<String,String>
@@ -126,4 +136,4 @@ A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y
126
136
 
127
137
  end
128
138
 
129
- include Beaker::CaCertHelper
139
+ include Beaker::CaCertHelper
@@ -22,6 +22,16 @@ describe 'beaker::ca_cert_helper' do
22
22
  expect(subject).to receive(:create_cert_on_host).with(w2k3, 'usertrust-network.pem', 'my user trust cert')
23
23
  subject.install_ca_certs_on w2k3
24
24
  end
25
+
26
+ it "solaris 11 node" do
27
+ sol = {"platform" => 'solaris-11-x86_64', 'distmoduledir' => '/dne', 'hieraconf' => '/dne'}
28
+
29
+ expect(subject).to receive(:add_solaris_cert).with(sol, 'geotrustglobal.pem')
30
+ expect(subject).to receive(:create_cert_on_host).with(sol, 'geotrustglobal.pem', 'my cert string')
31
+ expect(subject).to receive(:add_solaris_cert).with(sol, 'usertrust-network.pem')
32
+ expect(subject).to receive(:create_cert_on_host).with(sol, 'usertrust-network.pem', 'my user trust cert')
33
+ subject.install_ca_certs_on sol
34
+ end
25
35
  end
26
36
 
27
37
  describe 'add_windows_cert' do
@@ -32,6 +42,15 @@ describe 'beaker::ca_cert_helper' do
32
42
  }
33
43
  end
34
44
 
45
+ describe 'add_solaris_cert' do
46
+ it {
47
+ host = {"platform" => 'solaris-11-x86_64', 'distmoduledir' => '/dne', 'hieraconf' => '/dne'}
48
+ expect(subject).to receive(:on).with(host, 'echo \'# geotrustglobal.pem\' >> /opt/puppet/ssl/cert.pem')
49
+ expect(subject).to receive(:on).with(host, 'cat geotrustglobal.pem >> /opt/puppet/ssl/cert.pem')
50
+ subject.add_solaris_cert host, 'geotrustglobal.pem'
51
+ }
52
+ end
53
+
35
54
  describe 'get_cert_hash' do
36
55
  it 'should contain 3 certs' do
37
56
  cert_hash = subject.get_cert_hash
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-puppet_install_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-21 00:00:00.000000000 Z
11
+ date: 2015-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  requirements: []
79
79
  rubyforge_project:
80
- rubygems_version: 2.4.8
80
+ rubygems_version: 2.2.3
81
81
  signing_key:
82
82
  specification_version: 4
83
83
  summary: Puppet install helper for Beaker