kitchen-vagrant 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9430d9441747a79f824f1e3184ce45c0625f81db
4
+ data.tar.gz: 3308136470c272ea805a8488d2f2d68a98069474
5
+ SHA512:
6
+ metadata.gz: 3cb8a5e5124fc64ddc6ac844a68c2f98459ae55815071109f49e41a369325569f88c6288e1be26e97ebbbecba11a2b368478016bc55a915fb254157298051337
7
+ data.tar.gz: 05b4128d4ad3b1e3841211c335c523de928c13c1bc83d51f23c40838aa53c322b7e942974dc4b3847528ca4cbd76e37c7d87c40dc2da1a397f9f505eae2d65da
data/.travis.yml CHANGED
@@ -1,9 +1,3 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
- notifications:
5
- irc:
6
- channels:
7
- - "irc.freenode.org#jamie-ci"
8
- use_notice: true
9
- skip_join: true
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## 0.11.0 / 2013-07-23
2
+
3
+ ### New features
4
+
5
+ * Pull request #30: Support computed defaults for a select list of pre-determined platforms (see pull request and readme for quick example). (@fnichol)
6
+ * Pull request #25: Add rackspace support. (@josephholsten)
7
+
8
+ ### Improvements
9
+
10
+ * Pull request #20: Respect `VAGRANT_DEFAULT_PROVIDER` environment variable. (@tmatilai)
11
+ * Pull request #24: Allow to override Vagrant default SSH username. (@gildegoma)
12
+ * Pull request #21: Configure tailor to actually check the code style. (@tmatilai)
13
+
14
+ ### Bug fixes
15
+
16
+ * Pull request #29, issue #28: Allow the vagrant guest setting to be set in the generated Vagrantfile via the kitchen.yml. (@keiths-osc)
17
+ * Pull request #31: Add some quotes around Vagrantfile value. (@albertsj1)
18
+
19
+
1
20
  ## 0.10.0 / 2013-05-08
2
21
 
3
22
  ### New features
data/README.md CHANGED
@@ -60,6 +60,43 @@ berkshelf-vagrant, so upgrading this Vagrant plugin is recommended.
60
60
 
61
61
  Please read the [Driver usage][driver_usage] page for more details.
62
62
 
63
+ ## <a name="default-config"></a> Default Configuration
64
+
65
+ This driver can determine the Vagrant box name and download URL for a select
66
+ number of platforms. Currently, the following platform names are supported:
67
+
68
+ ```ruby
69
+ ---
70
+ platforms:
71
+ - name: ubuntu-10.04
72
+ - name: ubuntu-12.04
73
+ - name: ubuntu-12.10
74
+ - name: ubuntu-13.04
75
+ - name: centos-5.9
76
+ - name: centos-6.4
77
+ - name: debian-7.1.0
78
+ ```
79
+
80
+ This will effectively generate a configuration similar to:
81
+
82
+ ```ruby
83
+ ---
84
+ platforms:
85
+ - name: ubuntu-10.04
86
+ driver_config:
87
+ box: opscode-ubuntu-10.04
88
+ box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-10.04_provisionerless.box
89
+ - name: ubuntu-12.04
90
+ driver_config:
91
+ box: opscode-ubuntu-12.04
92
+ box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box
93
+ - name: ubuntu-12.10
94
+ driver_config:
95
+ box: opscode-ubuntu-12.10
96
+ box_url: ...
97
+ # ...
98
+ ```
99
+
63
100
  ## <a name="config"></a> Configuration
64
101
 
65
102
  ### <a name="config-box"></a> box
@@ -199,6 +236,16 @@ installed. There are several different behaviors available:
199
236
 
200
237
  The default value is unset, or `nil`.
201
238
 
239
+ ### <a name="config-username"></a> username
240
+
241
+ This is the username used for SSH authentication if you
242
+ would like to connect with a different account than Vagrant default user.
243
+
244
+ If this value is nil, then Vagrant parameter `config.ssh.default.username`
245
+ will be used (which is usually set to 'vagrant').
246
+
247
+ The default value is unset, or `nil`.
248
+
202
249
  ## <a name="development"></a> Development
203
250
 
204
251
  * Source hosted at [GitHub][repo]
data/Rakefile CHANGED
@@ -5,7 +5,9 @@ require 'tailor/rake_task'
5
5
  desc "Run cane to check quality metrics"
6
6
  Cane::RakeTask.new
7
7
 
8
- Tailor::RakeTask.new
8
+ Tailor::RakeTask.new do |task|
9
+ task.file_set('lib/**/*.rb', 'code')
10
+ end
9
11
 
10
12
  desc "Display LOC stats"
11
13
  task :stats do
@@ -13,4 +15,7 @@ task :stats do
13
15
  sh "countloc -r lib/kitchen"
14
16
  end
15
17
 
16
- task :default => [ :cane, :tailor, :stats ]
18
+ desc "Run all quality tasks"
19
+ task :quality => [:cane, :tailor, :stats]
20
+
21
+ task :default => [ :quality ]
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.add_dependency 'test-kitchen', '~> 1.0.0.alpha.6'
20
+ gem.add_dependency 'test-kitchen', '~> 1.0.0.beta.1'
21
21
 
22
22
  gem.add_development_dependency 'cane'
23
23
  gem.add_development_dependency 'tailor'
@@ -34,8 +34,14 @@ module Kitchen
34
34
  # dependency hook checks when feature is released
35
35
  class Vagrant < Kitchen::Driver::SSHBase
36
36
 
37
- default_config :customize, {:memory => '256'}
37
+ default_config :customize, { :memory => '256' }
38
38
  default_config :synced_folders, {}
39
+ default_config :box do |driver|
40
+ driver.default_values("box")
41
+ end
42
+ default_config :box_url do |driver|
43
+ driver.default_values("box_url")
44
+ end
39
45
 
40
46
  required_config :box
41
47
 
@@ -52,14 +58,10 @@ module Kitchen
52
58
 
53
59
  def converge(state)
54
60
  create_vagrantfile
55
- ssh_args = build_ssh_args(state)
56
- install_omnibus(ssh_args) if config[:require_chef_omnibus]
57
61
  if config[:use_vagrant_provision]
58
62
  run "vagrant provision"
59
63
  else
60
- prepare_chef_home(ssh_args)
61
- upload_chef_data(ssh_args)
62
- run_chef_solo(ssh_args)
64
+ super
63
65
  end
64
66
  end
65
67
 
@@ -89,10 +91,32 @@ module Kitchen
89
91
  check_berkshelf_plugin if config[:use_vagrant_berkshelf_plugin]
90
92
  end
91
93
 
94
+ def default_values(value)
95
+ (default_boxes[instance.platform.name] || Hash.new)[value]
96
+ end
97
+
92
98
  protected
93
99
 
94
100
  WEBSITE = "http://downloads.vagrantup.com/"
95
101
  MIN_VER = "1.1.0"
102
+ OMNITRUCK_PREFIX = "https://opscode-vm-bento.s3.amazonaws.com/vagrant"
103
+ PLATFORMS = %w{
104
+ ubuntu-10.04 ubuntu-12.04 ubuntu-12.10 ubuntu-13.04
105
+ centos-6.4 centos-5.9 debian-7.1.0
106
+ }
107
+
108
+ def default_boxes
109
+ @default_boxes ||= begin
110
+ hash = Hash.new
111
+ PLATFORMS.each do |platform|
112
+ hash[platform] = Hash.new
113
+ hash[platform]["box"] = "opscode-#{platform}"
114
+ hash[platform]["box_url"] =
115
+ "#{OMNITRUCK_PREFIX}/opscode_#{platform}_provisionerless.box"
116
+ end
117
+ hash
118
+ end
119
+ end
96
120
 
97
121
  def run(cmd, options = {})
98
122
  cmd = "echo #{cmd}" if config[:dry_run]
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Driver
22
22
 
23
23
  # Version string for Vagrant Kitchen driver
24
- VAGRANT_VERSION = "0.10.0"
24
+ VAGRANT_VERSION = "0.11.0"
25
25
  end
26
26
  end
@@ -34,6 +34,7 @@ module Kitchen
34
34
  arr = []
35
35
  arr << %{Vagrant.configure("2") do |c|}
36
36
  common_block(arr)
37
+ guest_block(arr)
37
38
  network_block(arr)
38
39
  provider_block(arr)
39
40
  chef_block(arr) if config[:use_vagrant_provision]
@@ -51,6 +52,13 @@ module Kitchen
51
52
  arr << %{ c.vm.box = "#{config[:box]}"}
52
53
  arr << %{ c.vm.box_url = "#{config[:box_url]}"} if config[:box_url]
53
54
  arr << %{ c.vm.hostname = "#{instance.name}.vagrantup.com"}
55
+ arr << %{ c.ssh.username = "#{config[:username]}"} if config[:username]
56
+ end
57
+
58
+ def guest_block(arr)
59
+ if config[:guest]
60
+ arr << %{ c.vm.guest = #{config[:guest]}}
61
+ end
54
62
  end
55
63
 
56
64
  def network_block(arr)
@@ -62,14 +70,14 @@ module Kitchen
62
70
  end
63
71
 
64
72
  def provider_block(arr)
65
- provider = config[:provider] || 'virtualbox'
66
-
67
73
  arr << %{ c.vm.provider :#{provider} do |p|}
68
74
  case provider
69
75
  when 'virtualbox'
70
76
  virtualbox_customize(arr)
71
77
  when 'vmware_fusion', 'vmware_workstation'
72
78
  vmware_customize(arr)
79
+ when 'rackspace'
80
+ rackspace_customize(arr)
73
81
  end
74
82
  arr << %{ end}
75
83
  end
@@ -124,9 +132,13 @@ module Kitchen
124
132
  File.join(config[:kitchen_root], "Berksfile")
125
133
  end
126
134
 
135
+ def provider
136
+ config[:provider] || ENV['VAGRANT_DEFAULT_PROVIDER'] || 'virtualbox'
137
+ end
138
+
127
139
  def virtualbox_customize(arr)
128
140
  config[:customize].each do |key, value|
129
- arr << %{ p.customize ["modifyvm", :id, "--#{key}", #{value}]}
141
+ arr << %{ p.customize ["modifyvm", :id, "--#{key}", "#{value}"]}
130
142
  end
131
143
  end
132
144
 
@@ -148,6 +160,12 @@ module Kitchen
148
160
  end
149
161
  end
150
162
 
163
+ def rackspace_customize(arr)
164
+ config[:customize].each do |key, value|
165
+ arr << %{ p.#{key} = "#{value}"}
166
+ end
167
+ end
168
+
151
169
  def key_path
152
170
  return nil if instance.suite.encrypted_data_bag_secret_key_path.nil?
153
171
 
metadata CHANGED
@@ -1,78 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
5
- prerelease:
4
+ version: 0.11.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Fletcher Nichol
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-05-08 00:00:00.000000000 Z
11
+ date: 2013-07-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: test-kitchen
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: 1.0.0.alpha.6
19
+ version: 1.0.0.beta.1
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
29
- version: 1.0.0.alpha.6
26
+ version: 1.0.0.beta.1
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: cane
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: tailor
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: countloc
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  description: Kitchen::Driver::Vagrant - A Vagrant Driver for Test Kitchen.
@@ -95,32 +86,25 @@ files:
95
86
  - lib/kitchen/vagrant/vagrantfile_creator.rb
96
87
  homepage: https://github.com/opscode/kitchen-vagrant/
97
88
  licenses: []
89
+ metadata: {}
98
90
  post_install_message:
99
91
  rdoc_options: []
100
92
  require_paths:
101
93
  - lib
102
94
  required_ruby_version: !ruby/object:Gem::Requirement
103
- none: false
104
95
  requirements:
105
- - - ! '>='
96
+ - - '>='
106
97
  - !ruby/object:Gem::Version
107
98
  version: '0'
108
- segments:
109
- - 0
110
- hash: 4281053971058593237
111
99
  required_rubygems_version: !ruby/object:Gem::Requirement
112
- none: false
113
100
  requirements:
114
- - - ! '>='
101
+ - - '>='
115
102
  - !ruby/object:Gem::Version
116
103
  version: '0'
117
- segments:
118
- - 0
119
- hash: 4281053971058593237
120
104
  requirements: []
121
105
  rubyforge_project:
122
- rubygems_version: 1.8.24
106
+ rubygems_version: 2.0.3
123
107
  signing_key:
124
- specification_version: 3
108
+ specification_version: 4
125
109
  summary: Kitchen::Driver::Vagrant - A Vagrant Driver for Test Kitchen.
126
110
  test_files: []