kitchen-vagrant 0.17.0 → 0.18.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 +4 -4
- data/CHANGELOG.md +14 -0
- data/lib/kitchen/driver/vagrant.rb +8 -10
- data/lib/kitchen/driver/vagrant_version.rb +1 -1
- data/spec/kitchen/driver/vagrant_spec.rb +45 -26
- data/templates/Vagrantfile.erb +20 -5
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0217562d1cdfdc41b66c913b4fd79cf11719b457
|
|
4
|
+
data.tar.gz: 6d99a767f3dc6154a3b5019c2bc72cf5525acbb1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5fe5750855c7efd561e4643886213a8855d8bbeee9e2755b8bd7fd1c394d60cc677e34dabc403afa14f47b9a93c77d4541dda6fd3b3676b83d9fceaa294ea09d
|
|
7
|
+
data.tar.gz: f124d452f8d77fec21cb7f2b9ded0ebde8035dc7e30b324325978ebcb4ca02db1912a0e1888229da2f72c35f8f7b8f52e96e2a936769784ddea720bddd21f8b2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 0.18.0 / 2015-05-07
|
|
2
|
+
|
|
3
|
+
### Bug fixes
|
|
4
|
+
|
|
5
|
+
* Pull request [#161][]: Add handling for winrm communicator in username & password handling. ([@atiniir][])
|
|
6
|
+
|
|
7
|
+
### Improvements
|
|
8
|
+
|
|
9
|
+
* Pull request [#166][]: Allow a fuzzier match for known Bento box names. ([@fnichol][])
|
|
10
|
+
|
|
11
|
+
|
|
1
12
|
## 0.17.0 / 2015-04-28
|
|
2
13
|
|
|
3
14
|
(*A selected roll-up of 0.17.0 pre-release changelogs*)
|
|
@@ -302,6 +313,8 @@ The initial release.
|
|
|
302
313
|
[#156]: https://github.com/test-kitchen/kitchen-vagrant/issues/156
|
|
303
314
|
[#157]: https://github.com/test-kitchen/kitchen-vagrant/issues/157
|
|
304
315
|
[#158]: https://github.com/test-kitchen/kitchen-vagrant/issues/158
|
|
316
|
+
[#161]: https://github.com/test-kitchen/kitchen-vagrant/issues/161
|
|
317
|
+
[#166]: https://github.com/test-kitchen/kitchen-vagrant/issues/166
|
|
305
318
|
[@Annih]: https://github.com/Annih
|
|
306
319
|
[@Igorshp]: https://github.com/Igorshp
|
|
307
320
|
[@RobertRehberg]: https://github.com/RobertRehberg
|
|
@@ -311,6 +324,7 @@ The initial release.
|
|
|
311
324
|
[@antonio-osorio]: https://github.com/antonio-osorio
|
|
312
325
|
[@arangamani]: https://github.com/arangamani
|
|
313
326
|
[@ashb]: https://github.com/ashb
|
|
327
|
+
[@atiniir]: https://github.com/atiniir
|
|
314
328
|
[@bdclark]: https://github.com/bdclark
|
|
315
329
|
[@bradleyd]: https://github.com/bradleyd
|
|
316
330
|
[@byggztryng]: https://github.com/byggztryng
|
|
@@ -93,7 +93,7 @@ module Kitchen
|
|
|
93
93
|
|
|
94
94
|
# @return [String,nil] the Vagrant box for this Instance
|
|
95
95
|
def default_box
|
|
96
|
-
if
|
|
96
|
+
if bento_box?(instance.platform.name)
|
|
97
97
|
"opscode-#{instance.platform.name}"
|
|
98
98
|
else
|
|
99
99
|
instance.platform.name
|
|
@@ -102,7 +102,7 @@ module Kitchen
|
|
|
102
102
|
|
|
103
103
|
# @return [String,nil] the Vagrant box URL for this Instance
|
|
104
104
|
def default_box_url
|
|
105
|
-
return unless
|
|
105
|
+
return unless bento_box?(instance.platform.name)
|
|
106
106
|
|
|
107
107
|
provider = config[:provider]
|
|
108
108
|
provider = "vmware" if config[:provider] =~ /^vmware_(.+)$/
|
|
@@ -186,17 +186,15 @@ module Kitchen
|
|
|
186
186
|
attr_accessor :vagrant_version
|
|
187
187
|
end
|
|
188
188
|
|
|
189
|
-
# Retuns
|
|
189
|
+
# Retuns whether or not a platform name could have a correcponding Bento
|
|
190
|
+
# box produced by the Bento project.
|
|
190
191
|
# (https://github.com/chef/bento).
|
|
191
192
|
#
|
|
192
|
-
# @return [
|
|
193
|
+
# @return [TrueClass,FalseClass] whether or not the name could be a Bento
|
|
194
|
+
# box
|
|
193
195
|
# @api private
|
|
194
|
-
def
|
|
195
|
-
|
|
196
|
-
centos-5.11 centos-6.6 centos-7.0 debian-6.0.10 debian-7.8 fedora-20
|
|
197
|
-
fedora-21 freebsd-9.3 freebsd-10.1 opensuse-13.1 ubuntu-10.04
|
|
198
|
-
ubuntu-12.04 ubuntu-14.04 ubuntu-14.10
|
|
199
|
-
].map { |name| [name, "#{name}-i386"] }.flatten
|
|
196
|
+
def bento_box?(name)
|
|
197
|
+
name =~ /^(centos|debian|fedora|freebsd|opensuse|ubuntu)-/
|
|
200
198
|
end
|
|
201
199
|
|
|
202
200
|
# Renders and writes out a Vagrantfile dedicated to this instance.
|
|
@@ -79,42 +79,45 @@ describe Kitchen::Driver::Vagrant do
|
|
|
79
79
|
|
|
80
80
|
describe "configuration" do
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
%W[centos debian fedora opensuse ubuntu].each do |name|
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
context "for known bento platform names starting with #{name}" do
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
expect(driver[:box]).to eq("opscode-ubuntu-14.04")
|
|
88
|
-
end
|
|
86
|
+
before { allow(platform).to receive(:name) { "#{name}-99.04" } }
|
|
89
87
|
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
it "sets :box based on the platform name by default" do
|
|
89
|
+
expect(driver[:box]).to eq("opscode-#{name}-99.04")
|
|
90
|
+
end
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
it "sets :box to a custom value" do
|
|
93
|
+
config[:box] = "booya"
|
|
95
94
|
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
expect(driver[:box]).to eq("booya")
|
|
96
|
+
end
|
|
98
97
|
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
"opscode_ubuntu-14.04_chef-provisionerless.box"
|
|
102
|
-
)
|
|
103
|
-
end
|
|
98
|
+
it "sets :box_url to a bento box URL for a virtualbox provider" do
|
|
99
|
+
config[:provider] = "virtualbox"
|
|
104
100
|
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
expect(driver[:box_url]).to eq(
|
|
102
|
+
"https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/" \
|
|
103
|
+
"opscode_#{name}-99.04_chef-provisionerless.box"
|
|
104
|
+
)
|
|
105
|
+
end
|
|
107
106
|
|
|
108
|
-
|
|
109
|
-
"
|
|
110
|
-
"opscode_ubuntu-14.04_chef-provisionerless.box"
|
|
111
|
-
)
|
|
112
|
-
end
|
|
107
|
+
it "sets :box_url to a bento box URL for a vmware-based provider" do
|
|
108
|
+
config[:provider] = "vmware_awesometown"
|
|
113
109
|
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
expect(driver[:box_url]).to eq(
|
|
111
|
+
"https://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/" \
|
|
112
|
+
"opscode_#{name}-99.04_chef-provisionerless.box"
|
|
113
|
+
)
|
|
114
|
+
end
|
|
116
115
|
|
|
117
|
-
|
|
116
|
+
it "sets :box_url to nil for any other provider" do
|
|
117
|
+
config[:provider] = "the-next-coolness"
|
|
118
|
+
|
|
119
|
+
expect(driver[:box_url]).to eq(nil)
|
|
120
|
+
end
|
|
118
121
|
end
|
|
119
122
|
end
|
|
120
123
|
|
|
@@ -935,6 +938,22 @@ describe Kitchen::Driver::Vagrant do
|
|
|
935
938
|
expect(vagrantfile).to match(regexify(%{c.ssh.password = "okay"}))
|
|
936
939
|
end
|
|
937
940
|
|
|
941
|
+
it "sets communicator.username if :communicator and :username are set" do
|
|
942
|
+
config[:communicator] = "wat"
|
|
943
|
+
config[:username] = "jdoe"
|
|
944
|
+
cmd
|
|
945
|
+
|
|
946
|
+
expect(vagrantfile).to match(regexify(%{c.wat.username = "jdoe"}))
|
|
947
|
+
end
|
|
948
|
+
|
|
949
|
+
it "sets communicator.password if :communicator and :password are set" do
|
|
950
|
+
config[:communicator] = "wat"
|
|
951
|
+
config[:password] = "okay"
|
|
952
|
+
cmd
|
|
953
|
+
|
|
954
|
+
expect(vagrantfile).to match(regexify(%{c.wat.password = "okay"}))
|
|
955
|
+
end
|
|
956
|
+
|
|
938
957
|
it "sets no ssh.private_key_path if missing" do
|
|
939
958
|
config[:ssh_key] = nil
|
|
940
959
|
cmd
|
data/templates/Vagrantfile.erb
CHANGED
|
@@ -30,18 +30,33 @@ Vagrant.configure("2") do |c|
|
|
|
30
30
|
c.vm.guest = "<%= config[:guest] %>"
|
|
31
31
|
<% end %>
|
|
32
32
|
|
|
33
|
-
<% if config[:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<%
|
|
37
|
-
|
|
33
|
+
<% if config[:communicator] %>
|
|
34
|
+
<% if config[:username] %>
|
|
35
|
+
c.<%= config[:communicator] %>.username = "<%= config[:username] %>"
|
|
36
|
+
<% end %>
|
|
37
|
+
<% if config[:password] %>
|
|
38
|
+
c.<%= config[:communicator] %>.password = "<%= config[:password] %>"
|
|
39
|
+
<% end %>
|
|
40
|
+
<% else %>
|
|
41
|
+
<% if config[:username] %>
|
|
42
|
+
c.ssh.username = "<%= config[:username] %>"
|
|
43
|
+
<% end %>
|
|
44
|
+
<% if config[:password] %>
|
|
45
|
+
c.ssh.password = "<%= config[:password] %>"
|
|
46
|
+
<% end %>
|
|
38
47
|
<% end %>
|
|
48
|
+
|
|
39
49
|
<% if config[:ssh_key] %>
|
|
40
50
|
c.ssh.private_key_path = "<%= config[:ssh_key] %>"
|
|
41
51
|
<% end %>
|
|
42
52
|
<% config[:ssh].each do |key, value| %>
|
|
43
53
|
c.ssh.<%= key %> = <%= value %>
|
|
44
54
|
<% end %>
|
|
55
|
+
<% if config[:winrm] %>
|
|
56
|
+
<% config[:winrm].each do |key, value| %>
|
|
57
|
+
c.winrm.<%= key %> = <%= value %>
|
|
58
|
+
<% end %>
|
|
59
|
+
<% end %>
|
|
45
60
|
|
|
46
61
|
<% Array(config[:network]).each do |opts| %>
|
|
47
62
|
c.vm.network(:<%= opts[0] %>, <%= opts[1..-1].join(", ") %>)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-vagrant
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.18.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fletcher Nichol
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: test-kitchen
|