beaker-puppet_install_helper 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTE3YjkzOTlhZjAwYjAyYzI5NmJmY2U4ZjNhYzBjNmRmODA1NThlNA==
4
+ OGMwYzBjYWE3ZWY0Zjk4MDBmODMzMzNjZDJlZmVhZmZiOTEwNTJkNQ==
5
5
  data.tar.gz: !binary |-
6
- MTdlYjcxZTJkZTc4YTg4YzlkYzAwYjBiNGUyYTZiZDljMmU2NDA1ZQ==
6
+ OGVmMzlkMWRjNzdhOTUxMDlhMmYxY2ExZTM1NDhjNzlhY2QyYmI0MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjYxZTAyNmM5ZjViMjQ4MTRmMDQxMjBhYjYxZWEyOWM3YjhmMzgyODYwMzU5
10
- NzBkZWQxMTY4YjMxY2VjYzMzNmIyMGIyZjc3OTYxOTNiOGFiMzk2ZjdhMjRi
11
- YmVkYTczNDJmYmRhZmMzOTJiMzU4MDY5Nzc2YTkwMjdhNWJmMGM=
9
+ Y2U4N2IzMDk4NDU2NTAxMmE5NDY0YTZhYjJhZDhhMTcyNTUzYjg5M2E4NTVk
10
+ YTRjNjM5MDY0NDEwZTI4ODNhYmU4ZTA1ZGI4ZjNlY2NhY2Q0MGM5ZjA0NDM0
11
+ ZjE2MjA0NTNkZjYwNTFiYzMyMWE3MmExNzAxOTM3ZGQ4ZGVmY2Y=
12
12
  data.tar.gz: !binary |-
13
- NmU3MDRiZWYwZDFhYTliYmUxY2FmZDA0MTUyOGRjYTA2MDg4OWI0YjY5ZGY3
14
- MTUwMGZlZTNlMTYwZjUwYWU4YTIyMGUxNWE1OWM0OGQ1ZDIxZWMwMzAyNjVm
15
- NDY0Y2Q1NjkyOTZiY2IwMzE4ZmRmZTJkYzU1NzVkM2ZlOWQyMGM=
13
+ MWEyYjYwNWE4M2VmYzgwY2JjOTI2ZDEzNTg2NmI5NTNmYTRmZmYwYjMyZDkz
14
+ NDZiYmYxOTUxMDJjNjcyOTM0MzMwNjFiNGU0YjBiODc2NGI1OTU4Nzg3NDUx
15
+ ZDNhNTZjN2MwMDNhNWFlZGY0N2RiMGJjODk0ZWRmZDk1NzljZGY=
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ script: "bundle exec rspec spec"
3
+ notifications:
4
+ email: false
5
+ rvm:
6
+ - 2.1.6
7
+ - 1.9.3
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "beaker-puppet_install_helper"
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
4
4
  s.authors = ["Puppetlabs"]
5
5
  s.email = ["hunter@puppetlabs.com"]
6
6
  s.homepage = "https://github.com/puppetlabs/beaker-puppet_install_helper"
@@ -27,13 +27,21 @@ module Beaker::PuppetInstallHelper
27
27
  when "pe"
28
28
  # This will skip hosts that are not supported
29
29
  install_pe_on(hosts,{"pe_ver" => version})
30
+ add_pe_defaults_on(hosts)
31
+ add_puppet_paths_on(hosts)
30
32
  when "foss"
31
- foss_opts = {
33
+ opts = {
32
34
  :version => version,
33
35
  :default_action => "gem_install",
34
36
  }
35
37
 
36
- install_puppet_on(hosts, foss_opts)
38
+ install_puppet_on(hosts, opts)
39
+ if opts[:version] and not version_is_less(opts[:version], '4.0.0')
40
+ add_aio_defaults_on(hosts)
41
+ else
42
+ add_foss_defaults_on(hosts)
43
+ end
44
+ add_puppet_paths_on(hosts)
37
45
  Array(hosts).each do |host|
38
46
  if fact_on(host,"osfamily") != "windows"
39
47
  on host, "mkdir -p #{host["distmoduledir"]}"
@@ -49,6 +57,8 @@ module Beaker::PuppetInstallHelper
49
57
  when "agent"
50
58
  # This will fail on hosts that are not supported; use foss and specify a 4.x version instead
51
59
  install_puppet_agent_on(hosts, {:version => version})
60
+ add_aio_defaults_on(hosts)
61
+ add_puppet_paths_on(hosts)
52
62
  else
53
63
  raise ArgumentError, "Type must be pe, foss, or agent; got #{type.inspect}"
54
64
  end
@@ -18,8 +18,8 @@ describe 'beaker::puppet_install_helper' do
18
18
  end
19
19
  describe '#run_puppet_install_helper' do
20
20
  before :each do
21
- expect(subject).to receive(:default).and_return(double(:is_pe? => false))
22
- expect(subject).to receive(:hosts).and_return(hosts)
21
+ allow(subject).to receive(:default).and_return(double(:is_pe? => false))
22
+ allow(subject).to receive(:hosts).and_return(hosts)
23
23
  end
24
24
  it 'calls run_puppet_install_helper_on on each host' do
25
25
  expect(subject).to receive(:run_puppet_install_helper_on).with(hosts,"foss",nil)
@@ -36,11 +36,15 @@ describe 'beaker::puppet_install_helper' do
36
36
  it "uses foss by default for non-pe nodes" do
37
37
  expect(subject).to receive(:default).and_return(double(:is_pe? => false))
38
38
  expect(subject).to receive(:install_puppet_on).with(hosts,{:version => nil,:default_action => "gem_install"})
39
+ expect(subject).to receive(:add_foss_defaults_on).with(hosts)
40
+ expect(subject).to receive(:add_puppet_paths_on).with(hosts)
39
41
  subject.run_puppet_install_helper_on(hosts)
40
42
  end
41
43
  it "uses PE by default for PE nodes" do
42
44
  expect(subject).to receive(:default).and_return(double(:is_pe? => true))
43
45
  expect(subject).to receive(:install_pe_on).with(hosts,{"pe_ver" => nil})
46
+ expect(subject).to receive(:add_pe_defaults_on).with(hosts)
47
+ expect(subject).to receive(:add_puppet_paths_on).with(hosts)
44
48
  subject.run_puppet_install_helper_on(hosts)
45
49
  end
46
50
  end
@@ -48,12 +52,24 @@ describe 'beaker::puppet_install_helper' do
48
52
  it "uses foss explicitly" do
49
53
  ENV["PUPPET_INSTALL_TYPE"] = "foss"
50
54
  expect(subject).to receive(:install_puppet_on).with(hosts,{:version => nil,:default_action => "gem_install"})
55
+ expect(subject).to receive(:add_foss_defaults_on).with(hosts)
56
+ expect(subject).to receive(:add_puppet_paths_on).with(hosts)
51
57
  subject.run_puppet_install_helper_on(hosts)
52
58
  end
53
59
  it "uses foss with a version" do
54
60
  ENV["PUPPET_INSTALL_TYPE"] = "foss"
55
61
  ENV["PUPPET_VERSION"] = "3.8.1"
56
62
  expect(subject).to receive(:install_puppet_on).with(hosts,{:version => "3.8.1",:default_action => "gem_install"})
63
+ expect(subject).to receive(:add_foss_defaults_on).with(hosts)
64
+ expect(subject).to receive(:add_puppet_paths_on).with(hosts)
65
+ subject.run_puppet_install_helper_on(hosts)
66
+ end
67
+ it "uses foss with a >4 version detects AIO" do
68
+ ENV["PUPPET_INSTALL_TYPE"] = "foss"
69
+ ENV["PUPPET_VERSION"] = "4.1.0"
70
+ expect(subject).to receive(:install_puppet_on).with(hosts,{:version => "4.1.0",:default_action => "gem_install"})
71
+ expect(subject).to receive(:add_aio_defaults_on).with(hosts)
72
+ expect(subject).to receive(:add_puppet_paths_on).with(hosts)
57
73
  subject.run_puppet_install_helper_on(hosts)
58
74
  end
59
75
  end
@@ -61,12 +77,16 @@ describe 'beaker::puppet_install_helper' do
61
77
  it "uses PE explicitly" do
62
78
  ENV["PUPPET_INSTALL_TYPE"] = "pe"
63
79
  expect(subject).to receive(:install_pe_on).with(hosts,{"pe_ver" => nil})
80
+ expect(subject).to receive(:add_pe_defaults_on).with(hosts)
81
+ expect(subject).to receive(:add_puppet_paths_on).with(hosts)
64
82
  subject.run_puppet_install_helper_on(hosts)
65
83
  end
66
84
  it "uses PE with a version" do
67
85
  ENV["PUPPET_INSTALL_TYPE"] = "pe"
68
86
  ENV["PUPPET_VERSION"] = "3.8.1"
69
87
  expect(subject).to receive(:install_pe_on).with(hosts,{"pe_ver" => "3.8.1"})
88
+ expect(subject).to receive(:add_pe_defaults_on).with(hosts)
89
+ expect(subject).to receive(:add_puppet_paths_on).with(hosts)
70
90
  subject.run_puppet_install_helper_on(hosts)
71
91
  end
72
92
  end
@@ -74,12 +94,16 @@ describe 'beaker::puppet_install_helper' do
74
94
  it "uses agent explicitly" do
75
95
  ENV["PUPPET_INSTALL_TYPE"] = "agent"
76
96
  expect(subject).to receive(:install_puppet_agent_on).with(hosts,{:version => nil})
97
+ expect(subject).to receive(:add_aio_defaults_on).with(hosts)
98
+ expect(subject).to receive(:add_puppet_paths_on).with(hosts)
77
99
  subject.run_puppet_install_helper_on(hosts)
78
100
  end
79
101
  it "uses foss with a version" do
80
102
  ENV["PUPPET_INSTALL_TYPE"] = "agent"
81
103
  ENV["PUPPET_VERSION"] = "1.1.0"
82
104
  expect(subject).to receive(:install_puppet_agent_on).with(hosts,{:version => "1.1.0"})
105
+ expect(subject).to receive(:add_aio_defaults_on).with(hosts)
106
+ expect(subject).to receive(:add_puppet_paths_on).with(hosts)
83
107
  subject.run_puppet_install_helper_on(hosts)
84
108
  end
85
109
  end
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-10 00:00:00.000000000 Z
11
+ date: 2015-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -46,6 +46,7 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - .gitignore
49
+ - .travis.yml
49
50
  - Gemfile
50
51
  - beaker-puppet_install_helper.gemspec
51
52
  - lib/beaker/puppet_install_helper.rb