vagrant-puppet-install 1.0.0 → 2.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c81a82cc75935848916d51c5d41fac45c44f42c5
4
+ data.tar.gz: 4a5f3385055b26590fdc2056eb372ef74db7ad5a
5
+ SHA512:
6
+ metadata.gz: edab6ce0a9d2decaa06dc909c3f55fed535cb6d710f9035bf993607bb7d734078df9c3b4eea0e53b1bfaed65caa966f3b9566c12ebf3a62c492561024b1f4c2f
7
+ data.tar.gz: 55372748cdc0077416c99efac3db070451f4c15ed6aaa27729d51b2552ce8174056e986e0deac813e672b42f802e65041e89b4f08b954ddf5246bc87b6356c5a
data/.rubocop.yml ADDED
@@ -0,0 +1,10 @@
1
+ AllCops:
2
+ Excludes:
3
+ - vendor/**
4
+ - bin/**
5
+ Encoding:
6
+ Enabled: false
7
+ ClassLength:
8
+ Enabled: false
9
+ MethodLength:
10
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.0
4
6
  script: rake test:unit
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
- ## 1.0.0 (unreleased)
1
+ ## 2.0.0
2
+
3
+ * Changed references to Chef to Puppet
4
+ * Fixed install script so it works on all *nix platforms
5
+ * General fixes to r
6
+
7
+ ## 1.0.0
2
8
 
3
9
  * The initial release.
data/Gemfile CHANGED
@@ -6,12 +6,13 @@ group :development do
6
6
  # We depend on Vagrant for development, but we don't add it as a
7
7
  # gem dependency because we expect to be installed within the
8
8
  # Vagrant environment itself using `vagrant plugin`.
9
- gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => "v1.2.1"
9
+ gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => "v1.3.5"
10
10
  end
11
11
 
12
- group :test do
13
- gem "vagrant-aws", "~> 0.2.2"
14
- gem "vagrant-rackspace", "~> 0.1.1"
12
+ group :acceptance do
13
+ gem 'vagrant-digitalocean', '~> 0.4.0'
14
+ gem 'vagrant-aws', '~> 0.4.0'
15
+ gem 'vagrant-rackspace', '~> 0.1.4'
15
16
  end
16
17
 
17
18
  group :docs do
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # vagrant-puppet-install
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/vagrant-omnibus.png)](https://badge.fury.io/rb/vagrant-omnibus.png)
4
- [![Build Status](https://travis-ci.org/schisamo/vagrant-omnibus.png?branch=master)](https://travis-ci.org/schisamo/vagrant-omnibus)
5
- [![Dependency Status](https://gemnasium.com/schisamo/vagrant-omnibus.png)](https://gemnasium.com/schisamo/vagrant-omnibus)
6
- [![Code Climate](https://codeclimate.com/github/schisamo/vagrant-omnibus.png)](https://codeclimate.com/github/schisamo/vagrant-omnibus)
3
+ [![Gem Version](https://badge.fury.io/rb/vagrant-puppet-install.png)](http://badge.fury.io/rb/vagrant-puppet-install)
4
+ [![Build Status](https://travis-ci.org/patcon/vagrant-puppet-install.png?branch=master)](https://travis-ci.org/patcon/vagrant-puppet-install)
5
+ [![Dependency Status](https://gemnasium.com/patcon/vagrant-puppet-install.png)](https://gemnasium.com/patcon/vagrant-puppet-install)
6
+ [![Code Climate](https://codeclimate.com/github/patcon/vagrant-puppet-install.png)](https://codeclimate.com/github/patcon/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
@@ -14,8 +14,8 @@ This plugin has been verified to work with the following
14
14
 
15
15
  * VirtualBox (part of core)
16
16
  * AWS (ships in [vagrant-aws](https://github.com/mitchellh/vagrant-aws) plugin)
17
- * Rackspace (ships in [vagrant-rackspace](https://github.com/mitchellh/vagrant-rackspace)
18
- plugin)
17
+ * Rackspace (ships in [vagrant-rackspace](https://github.com/mitchellh/vagrant-rackspace) plugin)
18
+ * DigitalOcean (ships in [vagrant-digital_ocean](https://github.com/smdahlen/vagrant-digitalocean) plugin)
19
19
 
20
20
  It may work with other Vagrant providers but is not guaranteed to!
21
21
 
@@ -68,24 +68,24 @@ end
68
68
  The unit tests can be run with:
69
69
 
70
70
  ```
71
- rake test:unit
71
+ bundle exec rake
72
+ #or
73
+ bundle exec rake test:unit
72
74
  ```
73
75
 
74
76
  The test are also executed by Travis CI every time code is pushed to GitHub.
75
77
 
76
78
  ### Acceptance
77
79
 
78
- Currently this repo ships with a set of basic acceptance tests that will:
80
+ The acceptance tests will be run against the Vagrant providers mentioned above.
79
81
 
80
- * Provision a Vagrant instance.
81
- * Attempt to install Chef 11.4.0 using this plugin.
82
- * Perform a very basic chef-solo run to ensure Chef is in fact installed.
83
-
84
- The acceptance tests are run against the Vagrant providers mentioned above. The
85
- acceptance tests can be run with:
82
+ The acceptance tests can be run with:
86
83
 
87
84
  ```
85
+ # to run them all
88
86
  rake test:acceptance
87
+ # or specify a provider
88
+ rake test:acceptance['virtualbox']
89
89
  ```
90
90
 
91
91
  And as expected, all acceptance tests only uses provisioner-less baseboxes and
@@ -101,4 +101,10 @@ cloud images!
101
101
 
102
102
  ## Authors
103
103
 
104
- Seth Chisamore (schisamo@opscode.com)
104
+ Patrick Connolly
105
+ Martin Lazarov
106
+ Peter Souter
107
+
108
+ ### Adapted from original code by
109
+
110
+ Seth Chisamore
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'bundler/setup'
2
2
  require 'bundler/gem_tasks'
3
3
  require 'rspec/core/rake_task'
4
+ require 'rubocop/rake_task'
4
5
  require 'yard'
5
6
 
6
7
  YARD::Rake::YardocTask.new
@@ -21,6 +22,10 @@ namespace :test do
21
22
  end
22
23
  end
23
24
 
25
+ unless system("vagrant box list | grep 'digital_ocean' &>/dev/null")
26
+ system('vagrant box add digital_ocean https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box')
27
+ end
28
+
24
29
  all_providers = Dir["test/acceptance/*"].map{|dir| File.basename(File.expand_path(dir))}
25
30
 
26
31
  # If a provider wasn't passed to the task run acceptance tests against
@@ -44,3 +49,5 @@ namespace :test do
44
49
  end
45
50
  end
46
51
  end
52
+
53
+ task :default => "test:unit"
@@ -14,6 +14,11 @@
14
14
  # limitations under the License.
15
15
  #
16
16
 
17
+ require 'log4r'
18
+ require 'shellwords'
19
+
20
+ require 'vagrant/util/downloader'
21
+
17
22
  module VagrantPlugins
18
23
  module PuppetInstall
19
24
  module Action
@@ -22,26 +27,36 @@ module VagrantPlugins
22
27
  # This action installs Puppet packages at the desired version.
23
28
  class InstallPuppet
24
29
 
25
- ubuntu_codename = %x[lsb_release --codename | awk '{ print $2 }'].chomp
26
- APT_PACKAGE_FILE = "puppetlabs-release-lucid.deb"
27
- APT_PACKAGE_FILE_URL = "http://apt.puppetlabs.com/#{APT_PACKAGE_FILE}".freeze
28
-
29
30
  def initialize(app, env)
30
31
  @app = app
31
- # Config#finalize! SHOULD be called automatically
32
- env[:global_config].puppet_install.finalize!
32
+ @logger =
33
+ Log4r::Logger.new('vagrantplugins::puppet_install::action::installpuppet')
34
+ @machine = env[:machine]
35
+ @install_script = find_install_script
36
+ @machine.config.puppet_install.finalize!
33
37
  end
34
38
 
35
39
  def call(env)
36
- desired_puppet_version = env[:global_config].puppet_install.version
40
+ @app.call(env)
41
+
42
+ return unless @machine.communicate.ready? && provision_enabled?(env)
37
43
 
38
- unless desired_puppet_version.nil?
39
- env[:ui].info("Ensuring Puppet is installed at requested version of #{desired_puppet_version}.")
40
- if env[:installed_puppet_version] == desired_puppet_version
41
- env[:ui].info("Puppet #{desired_puppet_version} package is already installed...skipping installation.")
44
+ desired_version = @machine.config.puppet_install.puppet_version
45
+
46
+ unless desired_version.nil?
47
+ if installed_version == desired_version
48
+ env[:ui].info I18n.t(
49
+ 'vagrant-puppet_install.action.installed',
50
+ version: desired_version
51
+ )
42
52
  else
43
- env[:ui].info("Puppet #{desired_puppet_version} package is not installed...installing now.")
44
- env[:ssh_run_command] = install_puppet_command(desired_puppet_version)
53
+ fetch_or_create_install_script(env)
54
+ env[:ui].info I18n.t(
55
+ 'vagrant-puppet_install.action.installing',
56
+ version: desired_version
57
+ )
58
+ install(desired_version, env)
59
+ recover(env)
45
60
  end
46
61
  end
47
62
 
@@ -50,21 +65,114 @@ module VagrantPlugins
50
65
 
51
66
  private
52
67
 
53
- def install_puppet_command(version='*')
54
- <<-INSTALL_PUPPET
55
- cd /tmp
56
- if command -v wget &>/dev/null; then
57
- wget --quiet #{APT_PACKAGE_FILE_URL}
58
- elif command -v curl &>/dev/null; then
59
- curl --location --remote-name #{APT_PACKAGE_FILE_URL}
60
- else
61
- echo "Neither wget nor curl found. Please install one and try again." >&2
62
- exit 1
63
- fi
64
- sudo dpkg --install #{APT_PACKAGE_FILE}
65
- sudo apt-get update --quiet
66
- sudo apt-get install puppet-common=#{version}*
67
- INSTALL_PUPPET
68
+ # Determines what flavor of install script should be used
69
+ def find_install_script
70
+ if !ENV['PUPPET_INSTALL_URL'].nil?
71
+ ENV['PUPPET_INSTALL_URL']
72
+ else
73
+ 'https://raw2.github.com/petems/puppet-install-shell/master/install_puppet.sh'
74
+ end
75
+ end
76
+
77
+ def install_script_name
78
+ 'install.sh'
79
+ end
80
+
81
+ def windows_guest?
82
+ @machine.config.vm.guest.eql?(:windows)
83
+ end
84
+
85
+ def provision_enabled?(env)
86
+ env.fetch(:provision_enabled, true)
87
+ end
88
+
89
+ def installed_version
90
+ version = nil
91
+ opts = nil
92
+ if windows_guest?
93
+ # Not sure how to do this yet...
94
+ else
95
+ command = 'echo $(puppet --version)'
96
+ end
97
+ @machine.communicate.sudo(command, opts) do |type, data|
98
+ if [:stderr, :stdout].include?(type)
99
+ version_match = data.match(/^(.+)/)
100
+ version = version_match.captures[0].strip if version_match
101
+ end
102
+ end
103
+ version
104
+ end
105
+
106
+ #
107
+ # Upload install script from Host's Vagrant TMP directory to guest
108
+ # and executes.
109
+ #
110
+ def install(version, env)
111
+ shell_escaped_version = Shellwords.escape(version)
112
+
113
+ @machine.communicate.tap do |comm|
114
+ comm.upload(@script_tmp_path, install_script_name)
115
+ if windows_guest?
116
+ # Not sure yet...
117
+ else
118
+ # TODO: Execute with `sh` once install.sh removes it's bash-isms.
119
+ install_cmd =
120
+ "bash #{install_script_name} -v #{shell_escaped_version} 2>&1"
121
+ end
122
+ comm.sudo(install_cmd) do |type, data|
123
+ if [:stderr, :stdout].include?(type)
124
+ next if data =~ /stdin: is not a tty/
125
+ env[:ui].info(data)
126
+ end
127
+ end
128
+ end
129
+ end
130
+
131
+ #
132
+ # Fetches or creates a platform specific install script to the Host's
133
+ # Vagrant TMP directory.
134
+ #
135
+ def fetch_or_create_install_script(env)
136
+ @script_tmp_path =
137
+ env[:tmp_path].join("#{Time.now.to_i.to_s}-#{install_script_name}")
138
+
139
+ @logger.info("Generating install script at: #{@script_tmp_path}")
140
+
141
+ url = @install_script
142
+
143
+ if File.file?(url) || url !~ /^[a-z0-9]+:.*$/i
144
+ @logger.info('Assuming URL is a file.')
145
+ file_path = File.expand_path(url)
146
+ file_path = Vagrant::Util::Platform.cygwin_windows_path(file_path)
147
+ url = "file:#{file_path}"
148
+ end
149
+
150
+ # Download the install.sh or create install.bat file to a temporary
151
+ # path. We store the temporary path as an instance variable so that
152
+ # the `#recover` method can access it.
153
+ begin
154
+ if windows_guest?
155
+ # Not sure how to do this in Windows yet...
156
+ else
157
+ downloader = Vagrant::Util::Downloader.new(
158
+ url,
159
+ @script_tmp_path,
160
+ {}
161
+ )
162
+ downloader.download!
163
+ end
164
+ rescue Vagrant::Errors::DownloaderInterrupted
165
+ # The downloader was interrupted, so just return, because that
166
+ # means we were interrupted as well.
167
+ env[:ui].info(I18n.t('vagrant-puppet_install.download.interrupted'))
168
+ return
169
+ end
170
+ end
171
+
172
+ def recover(env)
173
+ if @script_tmp_path && File.exist?(@script_tmp_path)
174
+ File.unlink(@script_tmp_path)
175
+ end
68
176
  end
69
177
  end
70
178
  end
@@ -24,39 +24,39 @@ module VagrantPlugins
24
24
  class Config < Vagrant.plugin("2", :config)
25
25
 
26
26
  # @return [String]
27
- # The version of Chef to install.
28
- attr_accessor :version
27
+ # The version of Puppet to install.
28
+ attr_accessor :puppet_version
29
29
 
30
30
  def initialize
31
- @version = UNSET_VALUE
31
+ @puppet_version = UNSET_VALUE
32
32
  end
33
33
 
34
34
  def finalize!
35
- if @version == UNSET_VALUE
36
- @version = nil
37
- elsif @version.to_s == 'latest'
35
+ if @puppet_version == UNSET_VALUE
36
+ @puppet_version = nil
37
+ elsif @puppet_version.to_s == 'latest'
38
38
  # resolve `latest` to a real version
39
- @version = retrieve_latest_puppet_version
39
+ @puppet_version = retrieve_latest_puppet_version
40
40
  end
41
41
  end
42
42
 
43
43
  def validate(machine)
44
44
  errors = []
45
45
 
46
- unless valid_chef_version?(chef_version)
47
- msg = "'#{chef_version}' is not a valid version of Chef."
48
- msg << "\n\n A list of valid versions can be found at: http://www.opscode.com/chef/install/"
46
+ unless valid_puppet_version?(puppet_version)
47
+ msg = "'#{puppet_version}' is not a valid version of Puppet."
48
+ msg << "\n\n A list of valid versions can be found at: http://docs.puppetlabs.com/release_notes/"
49
49
  errors << msg
50
50
  end
51
51
 
52
- { "Omnibus Plugin" => errors }
52
+ { "Puppet Install Plugin" => errors }
53
53
  end
54
54
 
55
55
  private
56
56
 
57
- # Query RubyGems.org's Ruby API and retrive the latest version of Chef.
58
- def retrieve_latest_chef_version
59
- available_gems = dependency_installer.find_gems_with_sources(chef_gem_dependency)
57
+ # Query RubyGems.org's Ruby API and retrive the latest version of Puppet.
58
+ def retrieve_latest_puppet_version
59
+ available_gems = dependency_installer.find_gems_with_sources(puppet_gem_dependency)
60
60
  spec, source = if available_gems.respond_to?(:last)
61
61
  # DependencyInstaller sorts the results such that the last one is
62
62
  # always the one it considers best.
@@ -73,12 +73,12 @@ module VagrantPlugins
73
73
  spec && spec.version.to_s
74
74
  end
75
75
 
76
- # Query RubyGems.org's Ruby API to see if the user-provided Chef version
77
- # is in fact a real Chef version!
78
- def valid_chef_version?(version)
76
+ # Query RubyGems.org's Ruby API to see if the user-provided Puppet version
77
+ # is in fact a real Puppet version!
78
+ def valid_puppet_version?(version)
79
79
  is_valid = false
80
80
  begin
81
- available = dependency_installer.find_gems_with_sources(chef_gem_dependency(version))
81
+ available = dependency_installer.find_gems_with_sources(puppet_gem_dependency(version))
82
82
  is_valid = true unless available.empty?
83
83
  rescue
84
84
  end
@@ -89,8 +89,8 @@ module VagrantPlugins
89
89
  @dependency_installer ||= Gem::DependencyInstaller.new
90
90
  end
91
91
 
92
- def chef_gem_dependency(version=nil)
93
- Gem::Dependency.new('chef', version)
92
+ def puppet_gem_dependency(version=nil)
93
+ Gem::Dependency.new('puppet', version)
94
94
  end
95
95
  end
96
96
  end
@@ -16,6 +16,6 @@
16
16
 
17
17
  module VagrantPlugins
18
18
  module PuppetInstall
19
- VERSION = "1.0.0"
19
+ VERSION = "2.0.0"
20
20
  end
21
21
  end
@@ -2,11 +2,11 @@
2
2
  # vi: set ft=ruby :
3
3
 
4
4
  # plugins don't seem to be auto-loaded from the bundle
5
- require 'vagrant-omnibus'
5
+ require 'vagrant-puppet-install'
6
6
  require 'vagrant-aws'
7
7
 
8
8
  Vagrant.configure("2") do |config|
9
- config.omnibus.chef_version = '11.4.0'
9
+ config.puppet_install.puppet_version = '3.4.2'
10
10
 
11
11
  config.vm.box = "dummy"
12
12
  config.vm.provider :aws do |aws, override|
@@ -22,8 +22,9 @@ Vagrant.configure("2") do |config|
22
22
  override.ssh.private_key_path = "~/.ssh/id_rsa"
23
23
  end
24
24
 
25
- config.vm.provision :chef_solo do |chef|
26
- chef.cookbooks_path = File.expand_path("../../../support/cookbooks", __FILE__)
27
- chef.add_recipe "chef-inator"
25
+ config.vm.provision :puppet do |puppet|
26
+ puppet.manifests_path = File.expand_path('../../../support/manifests', __FILE__)
27
+ puppet.manifest_file = "base.pp"
28
28
  end
29
+
29
30
  end
@@ -0,0 +1,23 @@
1
+ Vagrant.require_plugin('vagrant-puppet-install')
2
+ Vagrant.require_plugin('vagrant-digitalocean')
3
+
4
+ Vagrant.configure('2') do |config|
5
+ config.puppet_install.puppet_version = :latest
6
+
7
+ config.vm.box = 'digital_ocean'
8
+ config.vm.synced_folder '.', '/vagrant', disabled: true
9
+
10
+ config.vm.provider :digital_ocean do |provider, override|
11
+ provider.client_id = ENV['DO_CLIENT_ID']
12
+ provider.api_key = ENV['DO_API_KEY']
13
+ provider.region = 'Amsterdam 1'
14
+ provider.size = '512MB'
15
+ provider.image = 'Ubuntu 12.04.3 x32'
16
+ override.ssh.private_key_path = '~/.ssh/id_rsa'
17
+ end
18
+
19
+ config.vm.provision :puppet do |puppet|
20
+ puppet.manifests_path = File.expand_path('../../../support/manifests', __FILE__)
21
+ puppet.manifest_file = "base.pp"
22
+ end
23
+ end
@@ -2,11 +2,11 @@
2
2
  # vi: set ft=ruby :
3
3
 
4
4
  # plugins don't seem to be auto-loaded from the bundle
5
- require 'vagrant-omnibus'
5
+ require 'vagrant-puppet-install'
6
6
  require 'vagrant-rackspace'
7
7
 
8
8
  Vagrant.configure("2") do |config|
9
- config.omnibus.chef_version = '11.4.0'
9
+ config.puppet_install.puppet_version = '3.4.2'
10
10
 
11
11
  config.vm.box = "dummy"
12
12
  config.vm.provider :rackspace do |rackspace|
@@ -20,8 +20,9 @@ Vagrant.configure("2") do |config|
20
20
  config.ssh.private_key_path = "~/.ssh/id_rsa"
21
21
  end
22
22
 
23
- config.vm.provision :chef_solo do |chef|
24
- chef.cookbooks_path = File.expand_path("../../../support/cookbooks", __FILE__)
25
- chef.add_recipe "chef-inator"
23
+ config.vm.provision :puppet do |puppet|
24
+ puppet.manifests_path = File.expand_path('../../../support/manifests', __FILE__)
25
+ puppet.manifest_file = "base.pp"
26
26
  end
27
+
27
28
  end
@@ -2,16 +2,33 @@
2
2
  # vi: set ft=ruby :
3
3
 
4
4
  # plugins don't seem to be auto-loaded from the bundle
5
- require 'vagrant-omnibus'
5
+ require 'vagrant-puppet-install'
6
6
 
7
7
  Vagrant.configure("2") do |config|
8
- config.omnibus.chef_version = :latest
9
8
 
10
- config.vm.box = "canonical-ubuntu-12.04"
11
- config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
9
+ config.vm.define :ubuntu do |ubuntu|
10
+ ubuntu.puppet_install.puppet_version = :latest
11
+
12
+ ubuntu.vm.box = "precise64"
13
+ ubuntu.vm.box_url = "http://files.vagrantup.com/precise64.box"
14
+
15
+ ubuntu.vm.provision :puppet do |puppet|
16
+ puppet.manifests_path = File.expand_path('../../../support/manifests', __FILE__)
17
+ puppet.manifest_file = "base.pp"
18
+ end
19
+
20
+ end
21
+
22
+ config.vm.define :centos do |centos|
23
+ centos.puppet_install.puppet_version = :latest
24
+ centos.vm.box = 'centos-64-x64-vbox4210-nocm'
25
+ centos.vm.box_url = 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box'
26
+
27
+ config.vm.provision :puppet do |puppet|
28
+ puppet.manifests_path = File.expand_path('../../../support/manifests', __FILE__)
29
+ puppet.manifest_file = "base.pp"
30
+ end
12
31
 
13
- config.vm.provision :chef_solo do |chef|
14
- chef.cookbooks_path = File.expand_path("../../../support/cookbooks", __FILE__)
15
- chef.add_recipe "chef-inator"
16
32
  end
17
- end
33
+
34
+ end
@@ -0,0 +1 @@
1
+ notify {"Puppet Installed: $puppetversion":}
@@ -1,7 +1,7 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../../lib', __FILE__)
2
2
 
3
3
  require 'rspec/core'
4
- require 'vagrant-omnibus'
4
+ require 'vagrant-puppet-install'
5
5
 
6
6
  RSpec.configure do |config|
7
7
  config.formatter = :documentation
@@ -6,45 +6,45 @@
6
6
  #
7
7
  require_relative '../spec_helper'
8
8
 
9
- describe VagrantPlugins::Omnibus::Config do
9
+ describe VagrantPlugins::PuppetInstall::Config do
10
10
  let(:instance){ described_class.new }
11
11
 
12
12
  subject(:config) do
13
13
  instance.tap do |o|
14
- o.chef_version = chef_version if defined?(chef_version)
14
+ o.puppet_version = puppet_version if defined?(puppet_version)
15
15
  o.finalize!
16
16
  end
17
17
  end
18
18
 
19
19
  describe "defaults" do
20
- its(:chef_version){ should be_nil }
20
+ its(:puppet_version){ should be_nil }
21
21
  end
22
22
 
23
- describe "resolving `:latest` to a real Chef version" do
24
- let(:chef_version) { :latest }
25
- its(:chef_version){ should be_a(String) }
26
- its(:chef_version){ should match(/\d*\.\d*\.\d*/) }
23
+ describe "resolving `:latest` to a real Puppet version" do
24
+ let(:puppet_version) { :latest }
25
+ its(:puppet_version){ should be_a(String) }
26
+ its(:puppet_version){ should match(/\d*\.\d*\.\d*/) }
27
27
  end
28
28
 
29
29
  describe "#validate" do
30
30
  let(:machine) { double('machine') }
31
- let(:error_hash_key) { "Omnibus Plugin" }
31
+ let(:error_hash_key) { "Puppet Install Plugin" }
32
32
  let(:result) { subject.validate(machine) }
33
33
  let(:errors) { result[error_hash_key] }
34
34
 
35
- it "returns a Hash with an 'Omnibus Plugin' key" do
35
+ it "returns a Hash with an 'Puppet Install Plugin' key" do
36
36
  result.should be_a(Hash)
37
37
  result.should have_key(error_hash_key)
38
38
  end
39
39
 
40
- describe "chef_version validation" do
40
+ describe "puppet_version validation" do
41
41
  {
42
- "11.4.0" => {
43
- :description => "valid Chef version string",
42
+ "3.4.0" => {
43
+ :description => "valid Puppet version string",
44
44
  :valid => true
45
45
  },
46
46
  "10.99.99" => {
47
- :description => "invalid Chef version string",
47
+ :description => "invalid Puppet version string",
48
48
  :valid => false
49
49
  },
50
50
  "FUFUFU" => {
@@ -53,7 +53,7 @@ describe VagrantPlugins::Omnibus::Config do
53
53
  }
54
54
  }.each_pair do |version_string, opts|
55
55
  context "#{opts[:description]}: #{version_string}" do
56
- let(:chef_version) { version_string }
56
+ let(:puppet_version) { version_string }
57
57
  if opts[:valid]
58
58
  it "passes" do
59
59
  errors.should be_empty
@@ -65,7 +65,7 @@ describe VagrantPlugins::Omnibus::Config do
65
65
  end
66
66
  end
67
67
  end
68
- end # describe chef_version
68
+ end # describe puppet_version
69
69
  end # describe #validate
70
70
 
71
71
  end
@@ -6,8 +6,8 @@ require 'vagrant-puppet-install/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "vagrant-puppet-install"
8
8
  spec.version = VagrantPlugins::PuppetInstall::VERSION
9
- spec.authors = ["Seth Chisamore", "Patrick Connolly"]
10
- spec.email = ["schisamo@opscode.com", "patrick@myplanetdigital.com"]
9
+ spec.authors = ["Seth Chisamore", "Patrick Connolly", "Peter Souter"]
10
+ spec.email = ["schisamo@opscode.com", "patrick@myplanetdigital.com", "p.morsou@gmail.com"]
11
11
  spec.description = %q{A Vagrant plugin that ensures the desired version of Puppet is installed via the Puppet Labs package repos.}
12
12
  spec.summary = spec.description
13
13
  spec.homepage = "https://github.com/patcon/vagrant-puppet-install"
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
- spec.add_development_dependency "rake"
23
- spec.add_development_dependency "rspec"
22
+ spec.add_development_dependency "rake", "~> 10.1.1"
23
+ spec.add_development_dependency "rspec", "~> 2.14.1"
24
+ spec.add_development_dependency "rubocop", "~> 0.17.0"
24
25
  end
metadata CHANGED
@@ -1,21 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-puppet-install
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 2.0.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Seth Chisamore
9
8
  - Patrick Connolly
9
+ - Peter Souter
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-09-28 00:00:00.000000000 Z
13
+ date: 2014-02-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
17
17
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
18
  requirements:
20
19
  - - ~>
21
20
  - !ruby/object:Gem::Version
@@ -23,7 +22,6 @@ dependencies:
23
22
  type: :development
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
25
  requirements:
28
26
  - - ~>
29
27
  - !ruby/object:Gem::Version
@@ -31,46 +29,58 @@ dependencies:
31
29
  - !ruby/object:Gem::Dependency
32
30
  name: rake
33
31
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
32
  requirements:
36
- - - ! '>='
33
+ - - ~>
37
34
  - !ruby/object:Gem::Version
38
- version: '0'
35
+ version: 10.1.1
39
36
  type: :development
40
37
  prerelease: false
41
38
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
39
  requirements:
44
- - - ! '>='
40
+ - - ~>
45
41
  - !ruby/object:Gem::Version
46
- version: '0'
42
+ version: 10.1.1
47
43
  - !ruby/object:Gem::Dependency
48
44
  name: rspec
49
45
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
46
  requirements:
52
- - - ! '>='
47
+ - - ~>
53
48
  - !ruby/object:Gem::Version
54
- version: '0'
49
+ version: 2.14.1
55
50
  type: :development
56
51
  prerelease: false
57
52
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
53
  requirements:
60
- - - ! '>='
54
+ - - ~>
55
+ - !ruby/object:Gem::Version
56
+ version: 2.14.1
57
+ - !ruby/object:Gem::Dependency
58
+ name: rubocop
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ~>
62
+ - !ruby/object:Gem::Version
63
+ version: 0.17.0
64
+ type: :development
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ~>
61
69
  - !ruby/object:Gem::Version
62
- version: '0'
70
+ version: 0.17.0
63
71
  description: A Vagrant plugin that ensures the desired version of Puppet is installed
64
72
  via the Puppet Labs package repos.
65
73
  email:
66
74
  - schisamo@opscode.com
67
75
  - patrick@myplanetdigital.com
76
+ - p.morsou@gmail.com
68
77
  executables: []
69
78
  extensions: []
70
79
  extra_rdoc_files: []
71
80
  files:
72
81
  - .gitignore
73
82
  - .rspec
83
+ - .rubocop.yml
74
84
  - .travis.yml
75
85
  - .yardopts
76
86
  - CHANGELOG.md
@@ -87,53 +97,44 @@ files:
87
97
  - lib/vagrant-puppet-install/plugin.rb
88
98
  - lib/vagrant-puppet-install/version.rb
89
99
  - test/acceptance/aws/Vagrantfile
100
+ - test/acceptance/digital_ocean/Vagrantfile
90
101
  - test/acceptance/rackspace/Vagrantfile
91
102
  - test/acceptance/virtualbox/Vagrantfile
92
- - test/support/cookbooks/chef-inator/README.md
93
- - test/support/cookbooks/chef-inator/metadata.rb
94
- - test/support/cookbooks/chef-inator/recipes/default.rb
103
+ - test/support/manifests/base.pp
95
104
  - test/unit/spec_helper.rb
96
- - test/unit/vagrant-omnibus/config_spec.rb
105
+ - test/unit/vagrant-puppet-install/config_spec.rb
97
106
  - vagrant-puppet-install.gemspec
98
107
  homepage: https://github.com/patcon/vagrant-puppet-install
99
108
  licenses:
100
109
  - Apache 2.0
110
+ metadata: {}
101
111
  post_install_message:
102
112
  rdoc_options: []
103
113
  require_paths:
104
114
  - lib
105
115
  required_ruby_version: !ruby/object:Gem::Requirement
106
- none: false
107
116
  requirements:
108
- - - ! '>='
117
+ - - '>='
109
118
  - !ruby/object:Gem::Version
110
119
  version: '0'
111
- segments:
112
- - 0
113
- hash: 169783769753168333
114
120
  required_rubygems_version: !ruby/object:Gem::Requirement
115
- none: false
116
121
  requirements:
117
- - - ! '>='
122
+ - - '>='
118
123
  - !ruby/object:Gem::Version
119
124
  version: '0'
120
- segments:
121
- - 0
122
- hash: 169783769753168333
123
125
  requirements: []
124
126
  rubyforge_project:
125
- rubygems_version: 1.8.23
127
+ rubygems_version: 2.0.3
126
128
  signing_key:
127
- specification_version: 3
129
+ specification_version: 4
128
130
  summary: A Vagrant plugin that ensures the desired version of Puppet is installed
129
131
  via the Puppet Labs package repos.
130
132
  test_files:
131
133
  - test/acceptance/aws/Vagrantfile
134
+ - test/acceptance/digital_ocean/Vagrantfile
132
135
  - test/acceptance/rackspace/Vagrantfile
133
136
  - test/acceptance/virtualbox/Vagrantfile
134
- - test/support/cookbooks/chef-inator/README.md
135
- - test/support/cookbooks/chef-inator/metadata.rb
136
- - test/support/cookbooks/chef-inator/recipes/default.rb
137
+ - test/support/manifests/base.pp
137
138
  - test/unit/spec_helper.rb
138
- - test/unit/vagrant-omnibus/config_spec.rb
139
+ - test/unit/vagrant-puppet-install/config_spec.rb
139
140
  has_rdoc:
@@ -1,13 +0,0 @@
1
- # super-tester cookbook
2
-
3
- # Requirements
4
-
5
- # Usage
6
-
7
- # Attributes
8
-
9
- # Recipes
10
-
11
- # Author
12
-
13
- Author:: YOUR_NAME (<YOUR_EMAIL>)
@@ -1,7 +0,0 @@
1
- name "chef-inator"
2
- maintainer "Dr. Heinz Doofenshmirtz"
3
- maintainer_email "heinz@doofenshmirtz-evil-inc.com"
4
- license "All rights reserved"
5
- description "Uses Chef to take over the Tri-State Area!"
6
- long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7
- version "0.1.0"
@@ -1,2 +0,0 @@
1
-
2
- Chef::Log.info "CURSE YOU...Perry the Platypus!!!!"