chef-provisioning-vagrant 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f5391ad07acd823c4e855d727bca5422460994c
4
- data.tar.gz: 1cec32bc37d9cde64d727445e00080ffa4eca951
3
+ metadata.gz: a70be7cfd7be15988ef1d9ec3037d9bab25400ac
4
+ data.tar.gz: e08a613b0fee6542b061736d8e7ae80f8b4da4bc
5
5
  SHA512:
6
- metadata.gz: 83ab80f85009ea0ae000d0270a7a4d73410dc446816c2d37569854e4491d951e228238906075bdfc24ab6202fec7064693c1e6df5198cab097f3b0a39e0227ff
7
- data.tar.gz: cff66da7a46a3e4d39d58f2d95a1f03583c2dcf5cd90bf9c50f4fffa93f59ef9e3d59215ac186876cc2bbe0e472d6f24f5728f7c1ab5808ffa6c787ecb771a3c
6
+ metadata.gz: 4f35ed9accff44e6c20abc6584b984277691c4c7aa861d0e6ca4062fc86b6e394671b9cc66d89b203f05760fe663b023639f39b0b7d3e5080f1673330cf81e6e
7
+ data.tar.gz: b9c8668ea605e09cb1c5619f73f8b9a333b32cc3f6bb54eae6f54aad3f2b262d71a8cc55860da3c84259f2738482dc98d0024f455aec0cafcaad89e02d3929c8
data/Gemfile CHANGED
@@ -1,2 +1,3 @@
1
1
  source "https://rubygems.org"
2
+ gemfile
2
3
  gemspec
data/README.md CHANGED
@@ -1,41 +1,64 @@
1
1
  # chef-provisioning-vagrant
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/chef-provisioning-vagrant.svg)](https://badge.fury.io/rb/chef-provisioning-vagrant) [![Build Status](https://travis-ci.org/chef/chef-provisioning-vagrant.svg?branch=master)](https://travis-ci.org/chef/chef-provisioning-vagrant)
4
+
3
5
  This is the Vagrant driver for chef-provisioning.
4
6
 
5
7
  # Resources
6
8
 
7
9
  ## vagrant_box
8
10
 
9
- Specifying this resource will verify that the correct vagrant box is downloaded to the box directory (default of ```~/.chefdk/vms``` when using the chefdk) for the correct vagrant provider. The vagrant provider defaults to virtualbox.
11
+ Specifying this resource will verify that the correct vagrant box is downloaded to the box directory (default of `~/.chefdk/vms` when using the chefdk) for the correct vagrant provider. The vagrant provider defaults to virtualbox.
10
12
 
11
- This example will ```vagrant box add``` the box if it is not currently on your system.
12
- ```
13
+ This example will `vagrant box add` the box if it is not currently on your system.
14
+
15
+ ```ruby
13
16
  vagrant_box 'opscode-centos-6.4' do
14
17
  url 'http://opscode-vm-bento.s3.amazonaws.com/vagrant/vmware/opscode_centos-6.4_chef-provisionerless.box'
15
18
  vagrant_provider 'vmware_desktop'
16
19
  end
17
20
  ```
21
+
18
22
  This example will ensure that the vmware_desktop/fusion based box exists on your system, and will fail if the box does not exist. If this fails, you can always add the URL source as per the previous example. **Note: since bento boxes appear as 'vmware_desktop', 'vmware_fusion' will not work here**
19
- ```
23
+
24
+ ```ruby
20
25
  vagrant_box 'custom_box' do
21
26
  vagrant_provider 'vmware_desktop'
22
27
  end
23
28
  ```
29
+
24
30
  This example will ensure that the virtualbox based box already exists on your system, and will fail if the box does not exist. As before, adding the URL will cause it to download the box.
25
- ```
31
+
32
+ ```ruby
26
33
  vagrant_box 'custom_box'
27
34
  ```
35
+
28
36
  # Machine Options
29
37
 
30
38
  An example of machine options would be as follows:
31
- ```
39
+
40
+ ```ruby
32
41
  options = {
33
42
  vagrant_options: {
34
43
  'vm.box' => 'opscode-centos-6.4',
35
- # becomes vm.network(:forwarded_port, guest: 80, host: 8080) in
36
- # Vagrantfile:
37
- 'vm.network' => ':forwarded_port, guest: 80, host: 8080'
44
+ # becomes
45
+ # config.vm.network(:private_network, {ip: "22.22.22.22"})
46
+ # config.vm.network(:forwarded_port, guest: 4001, host: 4001)
47
+ # config.vm.network(:forwarded_port, guest: 3001, host: 3001)
48
+ # in Vagrantfile:
49
+ 'vm.network' => [
50
+ ':private_network, {ip: "22.22.22.22"}',
51
+ ':forwarded_port, guest: 4001, host: 4001',
52
+ ':forwarded_port, guest: 3001, host: 3001'
53
+ ]
38
54
  },
55
+ # `vagrant_config` gets appended to the Vagrantfile
56
+ vagrant_config: <<EOF
57
+ config.vm.provider 'virtualbox' do |v|
58
+ v.memory = 4096
59
+ v.cpus = 2
60
+ end
61
+ EOF
39
62
  }
40
63
 
41
64
  machine 'marley' do
@@ -43,8 +66,10 @@ machine 'marley' do
43
66
  converge true
44
67
  end
45
68
  ```
46
- You can also add a ```vagrant_provider``` attribute to override the default virtualbox provider:
47
- ```
69
+
70
+ You can also add a `vagrant_provider` attribute to override the default virtualbox provider:
71
+
72
+ ```ruby
48
73
  options = {
49
74
  vagrant_provider: 'vmware_fusion'
50
75
  vagrant_options: {
@@ -57,7 +82,25 @@ machine 'marley' do
57
82
  converge true
58
83
  end
59
84
  ```
85
+
60
86
  **Note: even though the bento based boxes appear as 'vmware_desktop', 'vmware_fusion' is required here, as it is the name of the vagrant provider**
61
87
 
88
+ You can also add a `vagrant_config` attribute to specify provider specific options. For example, to specify a memory setting of 1536 MB in a virtual box provider:
89
+
90
+ ```ruby
91
+ options = {
92
+ vagrant_config: "config.vm.provider \"virtualbox\" do |vb|\n vb.memory = 1536\nend\n",
93
+ vagrant_options: {
94
+ 'vm.box' => 'opscode-centos-6.4'
95
+ }
96
+ }
97
+
98
+ machine 'marley' do
99
+ machine_options options
100
+ converge true
101
+ end
102
+ ```
103
+
62
104
  # Known Issues
105
+
63
106
  It would be really nice to do some magic to make the vmware_fusion vs vmware_desktop providers match in the machine_options and the vagrant_box resource, but some magic would happen there...
data/Rakefile CHANGED
@@ -4,3 +4,12 @@ require 'bundler/gem_tasks'
4
4
  task :spec do
5
5
  require File.expand_path('spec/run')
6
6
  end
7
+
8
+ require "github_changelog_generator/task"
9
+
10
+ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
11
+ config.future_release = Chef::Provisioning::VagrantDriver::VERSION
12
+ config.enhancement_labels = "enhancement,Enhancement,New Feature,Improvement".split(",")
13
+ config.bug_labels = "bug,Bug,Improvement,Upstream Bug".split(",")
14
+ config.exclude_labels = "duplicate,question,invalid,wontfix,no_changelog,Exclude From Changelog,Question".split(",")
15
+ end
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.summary = 'Driver for creating Vagrant instances in Chef Provisioning.'
10
10
  s.description = s.summary
11
11
  s.author = 'John Keiser'
12
- s.email = 'jkeiser@getchef.com'
12
+ s.email = 'jkeiser@chef.io'
13
13
  s.homepage = 'https://github.com/chef/chef-provisioning-vagrant'
14
14
 
15
15
  s.add_dependency 'chef-provisioning'
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
17
17
  s.add_development_dependency 'chef'
18
18
  s.add_development_dependency 'rspec'
19
19
  s.add_development_dependency 'rake'
20
+ s.add_development_dependency 'github_changelog_generator'
20
21
 
21
22
  s.bindir = "bin"
22
23
  s.executables = %w( )
@@ -2,7 +2,7 @@ require 'chef/provider/lwrp_base'
2
2
  require 'chef/mixin/shell_out'
3
3
 
4
4
  class Chef::Provider::VagrantBox < Chef::Provider::LWRPBase
5
-
5
+ provides :vagrant_box
6
6
  use_inline_resources
7
7
 
8
8
  include Chef::Mixin::ShellOut
@@ -50,7 +50,8 @@ class Chef::Provider::VagrantBox < Chef::Provider::LWRPBase
50
50
  # the box name to make sure we have the correct box already installed.
51
51
  def box_exists?(new_resource)
52
52
  boxes = list_boxes
53
- boxes[new_resource.vagrant_provider].has_key?(new_resource.name)
53
+ provider = new_resource.vagrant_provider
54
+ boxes.has_key?(provider) && boxes[provider].has_key?(new_resource.name)
54
55
  end
55
56
 
56
57
  def load_current_resource
@@ -2,7 +2,7 @@ require 'chef/provider/lwrp_base'
2
2
  require 'cheffish'
3
3
 
4
4
  class Chef::Provider::VagrantCluster < Chef::Provider::LWRPBase
5
-
5
+ provides :vagrant_cluster
6
6
  use_inline_resources
7
7
 
8
8
  def whyrun_supported?
@@ -4,6 +4,7 @@ require 'chef/provisioning/machine/windows_machine'
4
4
  require 'chef/provisioning/machine/unix_machine'
5
5
  require 'chef/provisioning/convergence_strategy/install_msi'
6
6
  require 'chef/provisioning/convergence_strategy/install_cached'
7
+ require 'chef/provisioning/convergence_strategy/install_sh'
7
8
  require 'chef/provisioning/transport/winrm'
8
9
  require 'chef/provisioning/transport/ssh'
9
10
  require 'chef/provisioning/vagrant_driver/version'
@@ -61,7 +62,7 @@ class Chef
61
62
  }
62
63
  machine_spec.location['needs_reload'] = true if vm_file_updated
63
64
  if machine_options[:vagrant_options]
64
- %w(vm.guest winrm.host winrm.port winrm.username winrm.password).each do |key|
65
+ %w(vm.guest winrm.host winrm.port winrm.transport winrm.username winrm.password).each do |key|
65
66
  machine_spec.location[key] = machine_options[:vagrant_options][key] if machine_options[:vagrant_options][key]
66
67
  end
67
68
  end
@@ -381,9 +382,12 @@ class Chef
381
382
  if machine_spec.location['vm.guest'].to_s == 'windows'
382
383
  Chef::Provisioning::ConvergenceStrategy::InstallMsi.
383
384
  new(machine_options[:convergence_options], config)
384
- else
385
+ elsif machine_options[:cached_installer] == true
385
386
  Chef::Provisioning::ConvergenceStrategy::InstallCached.
386
387
  new(machine_options[:convergence_options], config)
388
+ else
389
+ Chef::Provisioning::ConvergenceStrategy::InstallSh.
390
+ new(machine_options[:convergence_options], config)
387
391
  end
388
392
  end
389
393
 
@@ -412,14 +416,14 @@ class Chef
412
416
  port = machine_spec.location['winrm.port'] || 5985
413
417
  port = forwarded_ports[port] if forwarded_ports[port]
414
418
  endpoint = "http://#{hostname}:#{port}/wsman"
415
- type = :plaintext
419
+ type = machine_spec.location['winrm.transport'] || :plaintext
416
420
  options = {
417
421
  :user => machine_spec.location['winrm.username'] || 'vagrant',
418
422
  :pass => machine_spec.location['winrm.password'] || 'vagrant',
419
423
  :disable_sspi => true
420
424
  }
421
425
 
422
- Chef::Provisioning::Transport::WinRM.new(endpoint, type, options)
426
+ Chef::Provisioning::Transport::WinRM.new(endpoint, type, options, config)
423
427
  end
424
428
 
425
429
  def create_ssh_transport(machine_spec)
@@ -1,7 +1,7 @@
1
1
  class Chef
2
2
  module Provisioning
3
3
  module VagrantDriver
4
- VERSION = '0.11.0'
4
+ VERSION = '0.12.0'
5
5
  end
6
6
  end
7
7
  end
@@ -1,4 +1,5 @@
1
1
  require 'vagrant_support'
2
+ require 'chef/provisioning'
2
3
 
3
4
  RSpec.configure do |config|
4
5
  config.expect_with :rspec do |expectations|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-provisioning-vagrant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-21 00:00:00.000000000 Z
11
+ date: 2017-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-provisioning
@@ -66,8 +66,22 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: github_changelog_generator
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: Driver for creating Vagrant instances in Chef Provisioning.
70
- email: jkeiser@getchef.com
84
+ email: jkeiser@chef.io
71
85
  executables: []
72
86
  extensions: []
73
87
  extra_rdoc_files:
@@ -109,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
123
  version: '0'
110
124
  requirements: []
111
125
  rubyforge_project:
112
- rubygems_version: 2.4.7
126
+ rubygems_version: 2.6.12
113
127
  signing_key:
114
128
  specification_version: 4
115
129
  summary: Driver for creating Vagrant instances in Chef Provisioning.