vagrant-puppet-install 2.3.0 → 2.5.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: ab0aabd67d98ad87eb8e7ce4405fa4272dcde43a
4
- data.tar.gz: e0f2ff19923c1cd587f4b70f0af25c92a11259fd
3
+ metadata.gz: 45ad0388b5d74099abab471358cd265018ed6755
4
+ data.tar.gz: 8dc1380f5b877af48f7b01bc8ce57866071205d3
5
5
  SHA512:
6
- metadata.gz: e2995ec1fa084f36fb31c2a6a4922cf0f3c417926e5e9e89222120123ed038374957b20f844f1e1091312cdef328fe31c9d75ee95502f9d15c3e860790145e8c
7
- data.tar.gz: 5a72cfa9d2d0a6d5afc4fc69afac7ab593a2425a3ef641c91666bed584bab724abf2c426998921271dc78dde564a18cca85cec16689f6433400915a58866b070
6
+ metadata.gz: b36a925d100c275c3386309f96494ac2102697aba0989ed18a2dc56e3fbf96f668d17851dc7a4589e8e84844b796db52172448d3c523f2cfd992cb490c79f41b
7
+ data.tar.gz: 13894480fe4620767b61058157a9d7f9d9e8047c7d928f4af6fbad970ef7ba17d68f78c6b463c36362efe579d512430c86e7968e43de9c022e33a1ae3f058fd7
data/LICENSE CHANGED
@@ -1,201 +1,7 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
1
+ Copyright © 2014 Peter Souter
4
2
 
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
4
 
7
- 1. Definitions.
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
6
 
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/vagrant-puppet-install.png)](http://badge.fury.io/rb/vagrant-puppet-install)
4
4
  [![Build Status](https://travis-ci.org/petems/vagrant-puppet-install.png?branch=master)](https://travis-ci.org/petems/vagrant-puppet-install)
5
5
  [![Dependency Status](https://gemnasium.com/petems/vagrant-puppet-install.png)](https://gemnasium.com/petems/vagrant-puppet-install)
6
- [![Code Climate](https://codeclimate.com/github/petems/vagrant-puppet-install.png)](https://codeclimate.com/petems/patcon/vagrant-puppet-install)
6
+ [![Code Climate](https://codeclimate.com/github/petems/vagrant-puppet-install.png)](https://codeclimate.com/github/petems/vagrant-puppet-install)
7
7
 
8
8
  A Vagrant plugin that ensures the desired version of Puppet is installed via the
9
9
  Puppet Labs package repo. This proves very useful when using Vagrant
@@ -42,7 +42,7 @@ Install the latest version of Puppet:
42
42
  ```ruby
43
43
  Vagrant.configure("2") do |config|
44
44
 
45
- config.puppet_install.puppet_version = "*"
45
+ config.puppet_install.puppet_version = :latest
46
46
 
47
47
  ...
48
48
 
@@ -61,6 +61,20 @@ Vagrant.configure("2") do |config|
61
61
  end
62
62
  ```
63
63
 
64
+ Specify a custom install script:
65
+
66
+ ```ruby
67
+ Vagrant.configure("2") do |config|
68
+
69
+ config.puppet_install.install_url = 'http://acme.com/install.sh'
70
+ # config.puppet_install.install_url = 'http://acme.com/install.msi'
71
+ # config.puppet_install.install_url = '/some/path/on/the/host'
72
+
73
+ ...
74
+
75
+ end
76
+ ```
77
+
64
78
  ## Tests
65
79
 
66
80
  ### Unit
data/Rakefile CHANGED
@@ -43,7 +43,7 @@ namespace :test do
43
43
 
44
44
  Dir.chdir("test/acceptance/#{provider}") do
45
45
  system("vagrant destroy -f")
46
- system("vagrant up --provider=#{provider}")
46
+ system("vagrant up --provider=#{provider} --provision")
47
47
  system("vagrant destroy -f")
48
48
  end
49
49
  end
@@ -6,9 +6,6 @@ require 'vagrant/util/downloader'
6
6
  module VagrantPlugins
7
7
  module PuppetInstall
8
8
  module Action
9
- # @author Seth Chisamore <schisamo@opscode.com>
10
- #
11
- # This action installs Puppet packages at the desired version.
12
9
  class InstallPuppet
13
10
 
14
11
  def initialize(app, env)
@@ -25,6 +22,9 @@ module VagrantPlugins
25
22
 
26
23
  return unless @machine.communicate.ready? && provision_enabled?(env)
27
24
 
25
+ # Perform delayed validation
26
+ @machine.config.puppet.validate!(@machine)
27
+
28
28
  desired_version = @machine.config.puppet_install.puppet_version
29
29
  unless desired_version.nil?
30
30
  if installed_version == desired_version
@@ -46,12 +46,21 @@ module VagrantPlugins
46
46
 
47
47
  private
48
48
 
49
- # Determines what flavor of install script should be used
49
+ def config_install_url
50
+ @machine.config.puppet_install.install_url
51
+ end
52
+
53
+ def env_install_url
54
+ ENV['PUPPET_INSTALL_URL']
55
+ end
56
+
50
57
  def find_install_script
51
- if !ENV['PUPPET_INSTALL_URL'].nil?
52
- ENV['PUPPET_INSTALL_URL']
53
- elsif windows_guest?
54
- #
58
+ config_install_url || env_install_url || default_install_url
59
+ end
60
+
61
+ def default_install_url
62
+ if windows_guest?
63
+ # No Windows Version yet
55
64
  else
56
65
  'https://raw2.github.com/petems/puppet-install-shell/master/install_puppet.sh'
57
66
  end
@@ -59,7 +68,7 @@ module VagrantPlugins
59
68
 
60
69
  def install_script_name
61
70
  if windows_guest?
62
- #
71
+ # No Windows Version yet
63
72
  else
64
73
  'install.sh'
65
74
  end
@@ -102,9 +111,9 @@ module VagrantPlugins
102
111
  if windows_guest?
103
112
  # Not sure yet...
104
113
  else
105
- # TODO: Execute with `sh` once install.sh removes it's bash-isms.
106
- install_cmd =
107
- "bash #{install_script_name} -v #{shell_escaped_version} 2>&1"
114
+ install_cmd = "sh #{install_script_name}"
115
+ install_cmd << " -v #{shell_escaped_version}"
116
+ install_cmd << ' 2>&1'
108
117
  end
109
118
  comm.sudo(install_cmd) do |type, data|
110
119
  if [:stderr, :stdout].include?(type)
@@ -3,16 +3,13 @@ require 'rubygems/dependency_installer'
3
3
  require 'vagrant'
4
4
 
5
5
  module VagrantPlugins
6
- #
7
6
  module PuppetInstall
8
- # @author Seth Chisamore <schisamo@opscode.com>
9
7
  class Config < Vagrant.plugin('2', :config)
10
- # @return [String]
11
- # The version of Puppet to install.
12
- attr_accessor :puppet_version
8
+ attr_accessor :puppet_version, :install_url
13
9
 
14
10
  def initialize
15
11
  @puppet_version = UNSET_VALUE
12
+ @install_url = UNSET_VALUE
16
13
  @logger = Log4r::Logger.new('vagrantplugins::puppet_install::config')
17
14
  end
18
15
 
@@ -23,12 +20,14 @@ module VagrantPlugins
23
20
  # resolve `latest` to a real version
24
21
  @puppet_version = retrieve_latest_puppet_version
25
22
  end
23
+ @install_url = nil if @install_url == UNSET_VALUE
26
24
  end
27
25
 
28
- def validate(machine)
26
+ def validate!(machine)
27
+ finalize!
29
28
  errors = []
30
29
 
31
- unless valid_puppet_version?(puppet_version)
30
+ if !puppet_version.nil? && !valid_puppet_version?(puppet_version)
32
31
  msg = <<-EOH
33
32
  '#{ puppet_version }' is not a valid version of Puppet.
34
33
 
@@ -37,7 +36,13 @@ A list of valid versions can be found at: http://docs.puppetlabs.com/release_not
37
36
  errors << msg
38
37
  end
39
38
 
40
- { 'Puppet Install Plugin' => errors }
39
+ if errors.any?
40
+ rendered_errors = Vagrant::Util::TemplateRenderer.render(
41
+ 'config/validation_failed',
42
+ errors: { 'vagrant-puppet-install' => errors }
43
+ )
44
+ fail Vagrant::Errors::ConfigInvalid, errors: rendered_errors
45
+ end
41
46
  end
42
47
 
43
48
  private
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module PuppetInstall
3
- VERSION = "2.3.0"
3
+ VERSION = "2.5.0"
4
4
  end
5
5
  end
@@ -12,7 +12,7 @@ Vagrant.configure('2') do |config|
12
12
  provider.api_key = ENV['DO_API_KEY']
13
13
  provider.region = 'Amsterdam 1'
14
14
  provider.size = '512MB'
15
- provider.image = 'Ubuntu 12.04.3 x32'
15
+ provider.image = 'Ubuntu 12.04.4 x32'
16
16
  override.ssh.private_key_path = '~/.ssh/id_rsa'
17
17
  end
18
18
 
@@ -35,4 +35,34 @@ Vagrant.configure("2") do |config|
35
35
 
36
36
  end
37
37
 
38
+ config.vm.define :new_install_url do |new_install_url|
39
+ new_install_url.puppet_install.puppet_version = :latest
40
+ config.puppet_install.install_url = 'https://raw.githubusercontent.com/hashicorp/puppet-bootstrap/master/centos_6_x.sh'
41
+ new_install_url.vm.box = 'centos-64-x64-vbox4210-nocm'
42
+ new_install_url.vm.box_url = 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box'
43
+
44
+ config.vm.provision :puppet do |puppet|
45
+ puppet.manifests_path = File.expand_path('../../../support/manifests', __FILE__)
46
+ puppet.manifest_file = "base.pp"
47
+ end
48
+
49
+ new_install_url.vm.provision "shell", inline: "puppet --version"
50
+
51
+ end
52
+
53
+ config.vm.define :new_install_path do |new_install_path|
54
+ new_install_path.puppet_install.puppet_version = :latest
55
+ config.puppet_install.install_url = File.expand_path('../../support/puppet_install_script/centos_6_x.sh')
56
+ new_install_path.vm.box = 'centos-64-x64-vbox4210-nocm'
57
+ new_install_path.vm.box_url = 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box'
58
+
59
+ config.vm.provision :puppet do |puppet|
60
+ puppet.manifests_path = File.expand_path('../../../support/manifests', __FILE__)
61
+ puppet.manifest_file = "base.pp"
62
+ end
63
+
64
+ new_install_path.vm.provision "shell", inline: "puppet --version"
65
+
66
+ end
67
+
38
68
  end
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ echo "THIS IS RUNNING ON YOUR MACHINE!"
6
+
7
+ REPO_URL="http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-7.noarch.rpm"
8
+
9
+ if [ "$EUID" -ne "0" ]; then
10
+ echo "This script must be run as root." >&2
11
+ exit 1
12
+ fi
13
+
14
+ if which puppet > /dev/null 2>&1; then
15
+ echo "Puppet is already installed."
16
+ exit 0
17
+ fi
18
+
19
+ # Install puppet labs repo
20
+ echo "Configuring PuppetLabs repo..."
21
+ repo_path=$(mktemp)
22
+ wget --output-document="${repo_path}" "${REPO_URL}" 2>/dev/null
23
+ rpm -i "${repo_path}" >/dev/null
24
+
25
+ # Install Puppet...
26
+ echo "Installing puppet"
27
+ yum install -y puppet > /dev/null
28
+
29
+ echo "Puppet installed!"
@@ -1,71 +1,72 @@
1
- # We have to use `require_relative` until RSpec 2.14.0. As non-standard RSpec
2
- # default paths are not on the $LOAD_PATH.
3
- #
4
- # More info here:
5
- # https://github.com/rspec/rspec-core/pull/831
6
- #
7
1
  require_relative '../spec_helper'
8
2
 
9
3
  describe VagrantPlugins::PuppetInstall::Config do
10
- let(:instance){ described_class.new }
4
+ let(:machine) { double('machine') }
5
+ let(:instance) { described_class.new }
11
6
 
12
7
  subject(:config) do
13
8
  instance.tap do |o|
14
9
  o.puppet_version = puppet_version if defined?(puppet_version)
10
+ o.install_url = install_url if defined?(install_url)
15
11
  o.finalize!
16
12
  end
17
13
  end
18
14
 
19
- describe "defaults" do
20
- its(:puppet_version){ should be_nil }
15
+ describe 'defaults' do
16
+ its(:puppet_version) { should be_nil }
17
+ its(:install_url) { should be_nil }
21
18
  end
22
19
 
23
- describe "resolving `:latest` to a real Puppet version" do
20
+ describe 'resolving `:latest` to a real Puppet version' do
24
21
  let(:puppet_version) { :latest }
25
- its(:puppet_version){ should be_a(String) }
26
- its(:puppet_version){ should match(/\d*\.\d*\.\d*/) }
22
+ its(:puppet_version) { should be_a(String) }
23
+ its(:puppet_version) { should match(/\d*\.\d*\.\d*/) }
27
24
  end
28
25
 
29
- describe "#validate" do
30
- let(:machine) { double('machine') }
31
- let(:error_hash_key) { "Puppet Install Plugin" }
32
- let(:result) { subject.validate(machine) }
33
- let(:errors) { result[error_hash_key] }
34
-
35
- it "returns a Hash with an 'Puppet Install Plugin' key" do
36
- result.should be_a(Hash)
37
- result.should have_key(error_hash_key)
26
+ describe 'validate' do
27
+ it 'should be no-op' do
28
+ expect(subject.validate(machine)).to eq('VagrantPlugins::PuppetInstall::Config' => [])
38
29
  end
30
+ end
39
31
 
40
- describe "puppet_version validation" do
32
+ describe '#validate!' do
33
+ describe 'puppet_version validation' do
41
34
  {
42
- "3.4.0" => {
43
- :description => "valid Puppet version string",
44
- :valid => true
35
+ '3.4.0' => {
36
+ description: 'valid puppet version string',
37
+ valid: true
45
38
  },
46
- "10.99.99" => {
47
- :description => "invalid Puppet version string",
48
- :valid => false
39
+ '9.9.9' => {
40
+ description: 'invalid puppet version string',
41
+ valid: false
49
42
  },
50
- "FUFUFU" => {
51
- :description => "invalid RubyGems version string",
52
- :valid => false
43
+ 'FUFUFU' => {
44
+ description: 'invalid RubyGems version string',
45
+ valid: false
53
46
  }
54
47
  }.each_pair do |version_string, opts|
55
48
  context "#{opts[:description]}: #{version_string}" do
56
49
  let(:puppet_version) { version_string }
57
50
  if opts[:valid]
58
- it "passes" do
59
- errors.should be_empty
51
+ it 'passes' do
52
+ expect { subject.validate!(machine) }.to_not raise_error
60
53
  end
61
54
  else
62
- it "fails" do
63
- errors.should_not be_empty
55
+ it 'fails' do
56
+ expect { subject.validate!(machine) }.to raise_error(Vagrant::Errors::ConfigInvalid)
64
57
  end
65
58
  end
66
59
  end
67
60
  end
68
61
  end # describe puppet_version
69
- end # describe #validate
62
+
63
+ describe 'not specified puppet_version validation' do
64
+ it 'passes' do
65
+ Gem::DependencyInstaller.any_instance.stub(:find_gems_with_sources).and_return([])
66
+ expect { subject.validate!(machine) }.to_not raise_error
67
+ end
68
+ end # describe not specified puppet_version validation
69
+
70
+ end
70
71
 
71
72
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-puppet-install
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Chisamore
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-07-01 00:00:00.000000000 Z
13
+ date: 2014-08-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -99,6 +99,7 @@ files:
99
99
  - test/acceptance/rackspace/Vagrantfile
100
100
  - test/acceptance/virtualbox/Vagrantfile
101
101
  - test/support/manifests/base.pp
102
+ - test/support/puppet_install_script/centos_6_x.sh
102
103
  - test/unit/spec_helper.rb
103
104
  - test/unit/vagrant-puppet-install/config_spec.rb
104
105
  - vagrant-puppet-install.gemspec
@@ -133,6 +134,7 @@ test_files:
133
134
  - test/acceptance/rackspace/Vagrantfile
134
135
  - test/acceptance/virtualbox/Vagrantfile
135
136
  - test/support/manifests/base.pp
137
+ - test/support/puppet_install_script/centos_6_x.sh
136
138
  - test/unit/spec_helper.rb
137
139
  - test/unit/vagrant-puppet-install/config_spec.rb
138
140
  has_rdoc: