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
data/README.md
CHANGED
@@ -1,166 +1,147 @@
|
|
1
|
-
# vagrant-omnibus
|
2
|
-
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/vagrant-omnibus.
|
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
|
-
config.omnibus.
|
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
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
```
|
150
|
-
rake test:acceptance:PROVIDER_NAME
|
151
|
-
```
|
152
|
-
|
153
|
-
And as expected, all acceptance tests only uses provisioner-less baseboxes and
|
154
|
-
cloud images!
|
155
|
-
|
156
|
-
## Contributing
|
157
|
-
|
158
|
-
1. Fork it
|
159
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
160
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
161
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
162
|
-
5. Create new Pull Request
|
163
|
-
|
164
|
-
## Authors
|
165
|
-
|
166
|
-
Seth Chisamore (schisamo@opscode.com)
|
1
|
+
# vagrant-omnibus
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/vagrant-omnibus.svg)](https://rubygems.org/gems/vagrant-omnibus) [![Build Status](https://travis-ci.org/chef/vagrant-omnibus.svg?branch=master)](https://travis-ci.org/chef/vagrant-omnibus) [![Dependency Status](https://gemnasium.com/chef/vagrant-omnibus.svg)](https://gemnasium.com/chef/vagrant-omnibus) [![Code Climate](https://codeclimate.com/github/chef/vagrant-omnibus.svg)](https://codeclimate.com/github/chef/vagrant-omnibus)
|
4
|
+
|
5
|
+
A Vagrant plugin that ensures the desired version of Chef is installed via the platform-specific Omnibus packages. This proves very useful when using Vagrant with provisioner-less baseboxes OR cloud images.
|
6
|
+
|
7
|
+
The plugin should work correctly with most all providers that hook into `Vagrant::Action::Builtin::Provision` for provisioning and is known to work with the following [Vagrant providers](https://www.vagrantup.com/docs/providers/index.html):
|
8
|
+
|
9
|
+
- VirtualBox (part of core)
|
10
|
+
- AWS (ships in [vagrant-aws](https://github.com/mitchellh/vagrant-aws) plugin)
|
11
|
+
- Rackspace (ships in [vagrant-rackspace](https://github.com/mitchellh/vagrant-rackspace) plugin)
|
12
|
+
- VMWare Fusion (can be [purchased from Hashicorp](https://www.vagrantup.com/vmware/))
|
13
|
+
- LXC (ships in [vagrant-lxc](https://github.com/fgrehm/vagrant-lxc))
|
14
|
+
- OpenStack (ships in [vagrant-openstack-plugin](https://github.com/cloudbau/vagrant-openstack-plugin))
|
15
|
+
- Digital Ocean (ships in [vagrant-digitalocean](https://github.com/smdahlen/vagrant-digitalocean))
|
16
|
+
- Parallels Desktop (ships in [vagrant-parallels](https://github.com/yshahin/vagrant-parallels))
|
17
|
+
|
18
|
+
## Installation
|
19
|
+
|
20
|
+
Ensure you have downloaded and installed Vagrant 1.1 or newer from the [Vagrant downloads page](https://www.vagrantup.com/downloads.html). If you require Windows support then Vagrant 1.6.1 or newer is needed.
|
21
|
+
|
22
|
+
Installation is performed in the prescribed manner for Vagrant 1.1 plugins.
|
23
|
+
|
24
|
+
```
|
25
|
+
$ vagrant plugin install vagrant-omnibus
|
26
|
+
```
|
27
|
+
|
28
|
+
## Usage
|
29
|
+
|
30
|
+
The Omnibus Vagrant plugin automatically hooks into the Vagrant provisioning middleware. You specify the version of the Chef Omnibus package you want installed using the `omnibus.chef_version` config key. The version string should be a valid Chef release version or `:latest`.
|
31
|
+
|
32
|
+
Install the latest version of Chef:
|
33
|
+
|
34
|
+
```ruby
|
35
|
+
Vagrant.configure("2") do |config|
|
36
|
+
|
37
|
+
config.omnibus.chef_version = :latest
|
38
|
+
|
39
|
+
...
|
40
|
+
|
41
|
+
end
|
42
|
+
```
|
43
|
+
|
44
|
+
Install a specific version of Chef:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
Vagrant.configure("2") do |config|
|
48
|
+
|
49
|
+
config.omnibus.chef_version = "11.4.0"
|
50
|
+
|
51
|
+
...
|
52
|
+
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
Specify a custom install script:
|
57
|
+
|
58
|
+
```ruby
|
59
|
+
Vagrant.configure("2") do |config|
|
60
|
+
|
61
|
+
config.omnibus.install_url = 'http://acme.com/install.sh'
|
62
|
+
# config.omnibus.install_url = 'http://acme.com/install.msi'
|
63
|
+
# config.omnibus.install_url = '/some/path/on/the/host'
|
64
|
+
|
65
|
+
...
|
66
|
+
|
67
|
+
end
|
68
|
+
```
|
69
|
+
|
70
|
+
If [vagrant-cachier](https://github.com/fgrehm/vagrant-cachier) is present and `config.cache.auto_detect` enabled the downloaded omnibus packages will be cached by vagrant-cachier. In case you want to turn caching off:
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
Vagrant.configure("2") do |config|
|
74
|
+
|
75
|
+
config.omnibus.cache_packages = false
|
76
|
+
|
77
|
+
...
|
78
|
+
|
79
|
+
end
|
80
|
+
```
|
81
|
+
|
82
|
+
This plugin is also multi-vm aware so it would possible to say install a different version of Chef on each VM:
|
83
|
+
|
84
|
+
```ruby
|
85
|
+
Vagrant.configure("2") do |config|
|
86
|
+
|
87
|
+
config.vm.define :new_chef do |new_chef_config|
|
88
|
+
|
89
|
+
...
|
90
|
+
|
91
|
+
new_chef_config.omnibus.chef_version = :latest
|
92
|
+
|
93
|
+
...
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
config.vm.define :old_chef do |old_chef_config|
|
98
|
+
|
99
|
+
...
|
100
|
+
|
101
|
+
old_chef_config.omnibus.chef_version = "10.24.0"
|
102
|
+
|
103
|
+
...
|
104
|
+
|
105
|
+
end
|
106
|
+
end
|
107
|
+
```
|
108
|
+
|
109
|
+
## Tests
|
110
|
+
|
111
|
+
### Unit
|
112
|
+
|
113
|
+
The unit tests can be run with:
|
114
|
+
|
115
|
+
```
|
116
|
+
rake test:unit
|
117
|
+
```
|
118
|
+
|
119
|
+
The test are also executed by Travis CI every time code is pushed to GitHub.
|
120
|
+
|
121
|
+
### Acceptance
|
122
|
+
|
123
|
+
Currently this repo ships with a set of basic acceptance tests that will:
|
124
|
+
|
125
|
+
- Provision a Vagrant instance.
|
126
|
+
- Attempt to install Chef using this plugin.
|
127
|
+
- Perform a very basic chef-solo run to ensure Chef is in fact installed.
|
128
|
+
|
129
|
+
The acceptance tests can be run against a subset of the Vagrant providers listed above. The acceptance tests can be run with:
|
130
|
+
|
131
|
+
```
|
132
|
+
rake test:acceptance:PROVIDER_NAME
|
133
|
+
```
|
134
|
+
|
135
|
+
And as expected, all acceptance tests only uses provisioner-less baseboxes and cloud images!
|
136
|
+
|
137
|
+
## Contributing
|
138
|
+
|
139
|
+
1. Fork it
|
140
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
141
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
142
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
143
|
+
5. Create new Pull Request
|
144
|
+
|
145
|
+
## Authors
|
146
|
+
|
147
|
+
Seth Chisamore (schisamo@chef.io)
|
data/Rakefile
CHANGED
@@ -1,87 +1,98 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
puts "
|
12
|
-
puts '
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
system("vagrant
|
17
|
-
system(
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
desc
|
26
|
-
|
27
|
-
task.patterns = [
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
]
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
namespace :test do
|
38
|
-
|
39
|
-
RSpec::Core::RakeTask.new(:unit) do |t|
|
40
|
-
t.pattern =
|
41
|
-
end
|
42
|
-
|
43
|
-
namespace :acceptance do
|
44
|
-
desc
|
45
|
-
task :aws do
|
46
|
-
unless system("vagrant box list | grep 'dummy\s*(aws)' &>/dev/null")
|
47
|
-
system(
|
48
|
-
end
|
49
|
-
run_acceptance_tests(
|
50
|
-
end
|
51
|
-
|
52
|
-
desc
|
53
|
-
task
|
54
|
-
unless system("vagrant box list | grep 'digital_ocean' &>/dev/null")
|
55
|
-
system(
|
56
|
-
end
|
57
|
-
run_acceptance_tests(
|
58
|
-
end
|
59
|
-
|
60
|
-
desc
|
61
|
-
task :rackspace do
|
62
|
-
unless system("vagrant box list | grep 'dummy\s*(rackspace)' &>/dev/null")
|
63
|
-
system(
|
64
|
-
end
|
65
|
-
run_acceptance_tests(
|
66
|
-
end
|
67
|
-
|
68
|
-
desc
|
69
|
-
task :virtualbox do
|
70
|
-
run_acceptance_tests(
|
71
|
-
end
|
72
|
-
|
73
|
-
desc
|
74
|
-
task :vmware_fusion do
|
75
|
-
run_acceptance_tests(
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
# We cannot run Test Kitchen on Travis CI yet...
|
81
|
-
namespace :travis do
|
82
|
-
desc
|
83
|
-
task ci: [
|
84
|
-
end
|
85
|
-
|
86
|
-
|
87
|
-
task
|
1
|
+
require "bundler/setup"
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
require "rspec/core/rake_task"
|
4
|
+
require "chefstyle"
|
5
|
+
require "rubocop/rake_task"
|
6
|
+
require "yard"
|
7
|
+
|
8
|
+
# rubocop:disable LineLength
|
9
|
+
|
10
|
+
def run_acceptance_tests(provider = "virtualbox")
|
11
|
+
puts "=================================================================="
|
12
|
+
puts "Running acceptance tests against '#{provider}' provider..."
|
13
|
+
puts "=================================================================="
|
14
|
+
|
15
|
+
Dir.chdir("test/acceptance/#{provider}") do
|
16
|
+
system("vagrant destroy -f")
|
17
|
+
system("vagrant up --provider=#{provider}")
|
18
|
+
system("vagrant destroy -f")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
YARD::Rake::YardocTask.new
|
23
|
+
|
24
|
+
namespace :style do
|
25
|
+
desc "Run Ruby style checks"
|
26
|
+
RuboCop::RakeTask.new(:ruby) do |task|
|
27
|
+
task.patterns = [
|
28
|
+
"**/*.rb",
|
29
|
+
"**/Vagrantfile",
|
30
|
+
"*.gemspec",
|
31
|
+
"Gemfile",
|
32
|
+
"Rakefile",
|
33
|
+
]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
namespace :test do
|
38
|
+
|
39
|
+
RSpec::Core::RakeTask.new(:unit) do |t|
|
40
|
+
t.pattern = "test/unit/**/*_spec.rb"
|
41
|
+
end
|
42
|
+
|
43
|
+
namespace :acceptance do
|
44
|
+
desc "Run acceptance tests with AWS provider"
|
45
|
+
task :aws do
|
46
|
+
unless system("vagrant box list | grep 'dummy\s*(aws)' &>/dev/null")
|
47
|
+
system("vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box")
|
48
|
+
end
|
49
|
+
run_acceptance_tests("aws")
|
50
|
+
end
|
51
|
+
|
52
|
+
desc "Run acceptance tests with Digital Ocean provider"
|
53
|
+
task "digital_ocean" do
|
54
|
+
unless system("vagrant box list | grep 'digital_ocean' &>/dev/null")
|
55
|
+
system("vagrant box add digital_ocean https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box")
|
56
|
+
end
|
57
|
+
run_acceptance_tests("digital_ocean")
|
58
|
+
end
|
59
|
+
|
60
|
+
desc "Run acceptance tests with Rackspace provider"
|
61
|
+
task :rackspace do
|
62
|
+
unless system("vagrant box list | grep 'dummy\s*(rackspace)' &>/dev/null")
|
63
|
+
system("vagrant box add dummy https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box")
|
64
|
+
end
|
65
|
+
run_acceptance_tests("rackspace")
|
66
|
+
end
|
67
|
+
|
68
|
+
desc "Run acceptance tests with VirtualBox provider"
|
69
|
+
task :virtualbox do
|
70
|
+
run_acceptance_tests("virtualbox")
|
71
|
+
end
|
72
|
+
|
73
|
+
desc "Run acceptance tests with VMware provider"
|
74
|
+
task :vmware_fusion do
|
75
|
+
run_acceptance_tests("vmware_fusion")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# We cannot run Test Kitchen on Travis CI yet...
|
81
|
+
namespace :travis do
|
82
|
+
desc "Run tests on Travis"
|
83
|
+
task ci: ["style:ruby", "test:unit"]
|
84
|
+
end
|
85
|
+
|
86
|
+
require "vagrant-omnibus/version"
|
87
|
+
require "github_changelog_generator/task"
|
88
|
+
|
89
|
+
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
90
|
+
config.issues = false
|
91
|
+
config.future_release = VagrantPlugins::Omnibus::VERSION
|
92
|
+
config.enhancement_labels = "enhancement,Enhancement,New Feature".split(",")
|
93
|
+
config.bug_labels = "bug,Bug,Improvement,Upstream Bug".split(",")
|
94
|
+
config.exclude_labels = "duplicate,question,invalid,wontfix,no_changelog,Exclude From Changelog".split(",")
|
95
|
+
end
|
96
|
+
|
97
|
+
# The default rake task should just run it all
|
98
|
+
task default: ["style:ruby", "test:unit", "test:acceptance:virtualbox"]
|