vagrant-omnibus 1.4.1 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +19 -19
- data/.rspec +1 -1
- data/.travis.yml +18 -8
- data/.yardopts +7 -7
- data/CHANGELOG.md +98 -196
- data/Gemfile +28 -23
- data/LICENSE +201 -201
- data/README.md +147 -166
- data/Rakefile +98 -87
- data/TODO.md +5 -5
- data/lib/vagrant-omnibus.rb +31 -31
- data/lib/vagrant-omnibus/action/install_chef.rb +272 -258
- data/lib/vagrant-omnibus/config.rb +104 -128
- data/lib/vagrant-omnibus/plugin.rb +78 -55
- data/lib/vagrant-omnibus/version.rb +22 -22
- data/locales/en.yml +11 -8
- data/test/acceptance/aws/Vagrantfile +29 -29
- data/test/acceptance/digital_ocean/Vagrantfile +24 -24
- data/test/acceptance/rackspace/Vagrantfile +28 -28
- data/test/acceptance/virtualbox/Vagrantfile +93 -95
- data/test/acceptance/vmware_fusion/Vagrantfile +1 -95
- data/test/support/cookbooks/chef-inator/README.md +13 -13
- data/test/support/cookbooks/chef-inator/metadata.rb +7 -7
- data/test/support/cookbooks/chef-inator/recipes/default.rb +2 -2
- data/test/unit/spec_helper.rb +23 -25
- data/test/unit/vagrant-omnibus/config_spec.rb +121 -101
- data/test/unit/vagrant-omnibus/plugin_spec.rb +83 -0
- data/vagrant-omnibus.gemspec +27 -27
- metadata +28 -29
- data/.rubocop.yml +0 -10
- data/.ruby-version +0 -1
@@ -1,101 +1,121 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
# rubocop:disable LineLength
|
4
|
+
|
5
|
+
describe VagrantPlugins::Omnibus::Config do
|
6
|
+
let(:machine) { double("machine") }
|
7
|
+
let(:instance) { described_class.new }
|
8
|
+
|
9
|
+
subject(:config) do
|
10
|
+
instance.tap do |o|
|
11
|
+
o.chef_version = chef_version if defined?(chef_version)
|
12
|
+
o.install_url = install_url if defined?(install_url)
|
13
|
+
o.cache_packages = cache_packages if defined?(cache_packages)
|
14
|
+
o.finalize!
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
context "default values" do
|
19
|
+
describe "#chef_version" do
|
20
|
+
subject { super().chef_version }
|
21
|
+
it { is_expected.to be_nil }
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "#install_url" do
|
25
|
+
subject { super().install_url }
|
26
|
+
it { is_expected.to be_nil }
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "#cache_packages" do
|
30
|
+
subject { super().cache_packages }
|
31
|
+
it { is_expected.to be_truthy }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "no longer resolves :latest to a Chef version" do
|
36
|
+
let(:chef_version) { :latest }
|
37
|
+
|
38
|
+
describe "#chef_version" do
|
39
|
+
subject { super().chef_version }
|
40
|
+
it { is_expected.to eql(:latest) }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "setting a custom `install_url`" do
|
45
|
+
let(:install_url) { "http://some_path.com/install.sh" }
|
46
|
+
|
47
|
+
describe "#install_url" do
|
48
|
+
subject { super().install_url }
|
49
|
+
it { is_expected.to eq("http://some_path.com/install.sh") }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe "the `cache_packages` config option behaves truthy" do
|
54
|
+
[true, "something", :cachier].each do |obj|
|
55
|
+
describe "when `#{obj}` (#{obj.class})" do
|
56
|
+
let(:cache_packages) { obj }
|
57
|
+
|
58
|
+
describe "#cache_packages" do
|
59
|
+
subject { super().cache_packages }
|
60
|
+
it { is_expected.to be_truthy }
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
[nil, false].each do |obj|
|
65
|
+
describe "when `#{obj}` (#{obj.class})" do
|
66
|
+
let(:cache_packages) { obj }
|
67
|
+
|
68
|
+
describe "#cache_packages" do
|
69
|
+
subject { super().cache_packages }
|
70
|
+
it { is_expected.to be_falsey }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe "validate" do
|
77
|
+
it "is a be no-op" do
|
78
|
+
expect(subject.validate(machine)).to eq("VagrantPlugins::Omnibus::Config" => [])
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe "#validate!" do
|
83
|
+
describe "chef_version validation" do
|
84
|
+
{
|
85
|
+
"11.4.0" => {
|
86
|
+
description: "valid Chef version string",
|
87
|
+
valid: true,
|
88
|
+
},
|
89
|
+
"10.99.99" => {
|
90
|
+
description: "invalid Chef version string",
|
91
|
+
valid: false,
|
92
|
+
},
|
93
|
+
"FUFUFU" => {
|
94
|
+
description: "invalid RubyGems version string",
|
95
|
+
valid: false,
|
96
|
+
},
|
97
|
+
}.each_pair do |version_string, opts|
|
98
|
+
context "#{opts[:description]}: #{version_string}" do
|
99
|
+
let(:chef_version) { version_string }
|
100
|
+
if opts[:valid]
|
101
|
+
it "passes" do
|
102
|
+
expect { subject.validate!(machine) }.to_not raise_error
|
103
|
+
end
|
104
|
+
else
|
105
|
+
it "fails" do
|
106
|
+
expect { subject.validate!(machine) }.to raise_error(Vagrant::Errors::ConfigInvalid)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end # describe chef_version
|
112
|
+
|
113
|
+
describe "not specified chef_version validation" do
|
114
|
+
it "passes" do
|
115
|
+
allow_any_instance_of(Gem::DependencyInstaller).to receive(:find_gems_with_sources).and_return([])
|
116
|
+
expect { subject.validate!(machine) }.to_not raise_error
|
117
|
+
end
|
118
|
+
end # describe not specified chef_version validation
|
119
|
+
|
120
|
+
end # describe #validate
|
121
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe VagrantPlugins::Omnibus::Plugin do
|
4
|
+
|
5
|
+
context "action hooks" do
|
6
|
+
let(:hook) { double(append: true, prepend: true) }
|
7
|
+
let(:fake_class) { Class.new }
|
8
|
+
|
9
|
+
it "should hook InstallChef before Provision" do
|
10
|
+
stub_const("VagrantPlugins::Omnibus::Action::InstallChef", fake_class)
|
11
|
+
hook_proc = described_class.components.action_hooks[:__all_actions__][0]
|
12
|
+
hook = double
|
13
|
+
expect(hook).to receive(:after).with(Vagrant::Action::Builtin::Provision, VagrantPlugins::Omnibus::Action::InstallChef)
|
14
|
+
hook_proc.call(hook)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should define a config of type :omnibus" do
|
19
|
+
default_config = described_class.components.configs[:top].to_hash[:omnibus]
|
20
|
+
expect(default_config).to be(VagrantPlugins::Omnibus::Config)
|
21
|
+
end
|
22
|
+
|
23
|
+
describe ".check_vagrant_version" do
|
24
|
+
before :each do
|
25
|
+
stub_const("Vagrant::VERSION", "1.2.3")
|
26
|
+
end
|
27
|
+
|
28
|
+
it "accepts single String argument" do
|
29
|
+
expect(described_class.check_vagrant_version("~> 1.1")).to be_truthy
|
30
|
+
expect(described_class.check_vagrant_version("1.2")).to be_falsey
|
31
|
+
end
|
32
|
+
|
33
|
+
it "accepts an Array argument" do
|
34
|
+
expect(described_class.check_vagrant_version([">= 1.1", "< 1.3.0.beta"])).to be_truthy
|
35
|
+
expect(described_class.check_vagrant_version([">= 1.3"])).to be_falsey
|
36
|
+
end
|
37
|
+
|
38
|
+
it "accepts multiple arguments" do
|
39
|
+
expect(described_class.check_vagrant_version(">= 1.0", "<= 1.3")).to be_truthy
|
40
|
+
expect(described_class.check_vagrant_version("~> 1.2", ">= 1.2.5")).to be_falsey
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
describe ".check_vagrant_version!" do
|
45
|
+
subject { described_class.check_vagrant_version! }
|
46
|
+
let(:requirement) { ">= 1.1.0" }
|
47
|
+
let(:err_msg) { /requires Vagrant version #{Regexp.escape(requirement.inspect)}/ }
|
48
|
+
|
49
|
+
before :each do
|
50
|
+
stub_const(
|
51
|
+
"VagrantPlugins::ProxyConf::Plugin::VAGRANT_VERSION_REQUIREMENT",
|
52
|
+
requirement
|
53
|
+
)
|
54
|
+
stub_const("Vagrant::VERSION", vagrant_version)
|
55
|
+
allow($stderr).to receive(:puts)
|
56
|
+
end
|
57
|
+
|
58
|
+
context "on too old Vagrant version" do
|
59
|
+
let(:vagrant_version) { "1.0.9" }
|
60
|
+
it "raises error" do
|
61
|
+
expect { subject }.to raise_error(err_msg)
|
62
|
+
end
|
63
|
+
it "warns as stderr" do
|
64
|
+
expect($stderr).to receive(:puts).with(err_msg)
|
65
|
+
expect { subject }.to raise_error(err_msg)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
context "on exact required Vagrant version" do
|
70
|
+
let(:vagrant_version) { "1.1.0" }
|
71
|
+
it "does not raise" do
|
72
|
+
expect { subject }.not_to raise_error
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
context "on newer Vagrant version" do
|
77
|
+
let(:vagrant_version) { "1.3.5" }
|
78
|
+
it "does not raise" do
|
79
|
+
expect { subject }.not_to raise_error
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
data/vagrant-omnibus.gemspec
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path(
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
8
|
-
spec.version = VagrantPlugins::Omnibus::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
11
|
-
spec.description =
|
12
|
-
|
13
|
-
|
14
|
-
spec.summary = spec.description
|
15
|
-
spec.homepage =
|
16
|
-
spec.license =
|
17
|
-
|
18
|
-
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
19
|
-
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
|
20
|
-
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
21
|
-
spec.require_paths = [
|
22
|
-
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
end
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "vagrant-omnibus/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "vagrant-omnibus"
|
8
|
+
spec.version = VagrantPlugins::Omnibus::VERSION
|
9
|
+
spec.authors = ["Seth Chisamore"]
|
10
|
+
spec.email = ["schisamo@chef.io"]
|
11
|
+
spec.description = "A Vagrant plugin that ensures the desired version of" \
|
12
|
+
" Chef is installed via the platform-specific Omnibus" \
|
13
|
+
" packages."
|
14
|
+
spec.summary = spec.description
|
15
|
+
spec.homepage = "https://github.com/chef/vagrant-omnibus"
|
16
|
+
spec.license = "Apache 2.0"
|
17
|
+
|
18
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
19
|
+
spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
|
20
|
+
spec.test_files = spec.files.grep(/^(test|spec|features)\//)
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
24
|
+
spec.add_development_dependency "rake", "~> 11.0"
|
25
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
26
|
+
spec.add_development_dependency "chefstyle", "~> 0.4.0"
|
27
|
+
end
|
metadata
CHANGED
@@ -1,85 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-omnibus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Chisamore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '11.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '11.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '3.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '3.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: chefstyle
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.4.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.4.0
|
69
69
|
description: A Vagrant plugin that ensures the desired version of Chef is installed
|
70
70
|
via the platform-specific Omnibus packages.
|
71
71
|
email:
|
72
|
-
- schisamo@
|
72
|
+
- schisamo@chef.io
|
73
73
|
executables: []
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
-
- .gitignore
|
78
|
-
- .rspec
|
79
|
-
- .
|
80
|
-
- .
|
81
|
-
- .travis.yml
|
82
|
-
- .yardopts
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rspec"
|
79
|
+
- ".travis.yml"
|
80
|
+
- ".yardopts"
|
83
81
|
- CHANGELOG.md
|
84
82
|
- Gemfile
|
85
83
|
- LICENSE
|
@@ -102,8 +100,9 @@ files:
|
|
102
100
|
- test/support/cookbooks/chef-inator/recipes/default.rb
|
103
101
|
- test/unit/spec_helper.rb
|
104
102
|
- test/unit/vagrant-omnibus/config_spec.rb
|
103
|
+
- test/unit/vagrant-omnibus/plugin_spec.rb
|
105
104
|
- vagrant-omnibus.gemspec
|
106
|
-
homepage: https://github.com/
|
105
|
+
homepage: https://github.com/chef/vagrant-omnibus
|
107
106
|
licenses:
|
108
107
|
- Apache 2.0
|
109
108
|
metadata: {}
|
@@ -113,17 +112,17 @@ require_paths:
|
|
113
112
|
- lib
|
114
113
|
required_ruby_version: !ruby/object:Gem::Requirement
|
115
114
|
requirements:
|
116
|
-
- -
|
115
|
+
- - ">="
|
117
116
|
- !ruby/object:Gem::Version
|
118
117
|
version: '0'
|
119
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
119
|
requirements:
|
121
|
-
- -
|
120
|
+
- - ">="
|
122
121
|
- !ruby/object:Gem::Version
|
123
122
|
version: '0'
|
124
123
|
requirements: []
|
125
124
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.6.6
|
127
126
|
signing_key:
|
128
127
|
specification_version: 4
|
129
128
|
summary: A Vagrant plugin that ensures the desired version of Chef is installed via
|
@@ -139,4 +138,4 @@ test_files:
|
|
139
138
|
- test/support/cookbooks/chef-inator/recipes/default.rb
|
140
139
|
- test/unit/spec_helper.rb
|
141
140
|
- test/unit/vagrant-omnibus/config_spec.rb
|
142
|
-
|
141
|
+
- test/unit/vagrant-omnibus/plugin_spec.rb
|