Giter Club home page Giter Club logo

vagrant's Introduction

Vagrant Cookbook

Cookbook Version Build Status OpenCollective OpenCollective License

Installs Vagrant 1.6+ and manages Vagrant plugins via a vagrant_plugin resource.

This cookbook is not intended to be used for vagrant "1.0" (gem install) versions. A recipe is provided for removing the gem, see Recipes.

This cookbook is not supported for installing versions of Vagrant older than 1.6.

Maintainers

This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If youโ€™d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.

Requirements

This cookbook should not be used on platforms that Vagrant itself does not support.

Vagrant Supported Platforms

Vagrant does not specifically list supported platforms on the project web site. However, the only platforms with packages provided are:

  • Mac OS X
  • Windows
  • Linux (deb-package based platforms, e.g., Debian and Ubuntu)
  • Linux (rpm-packaged based platforms, e.g., RHEL and CentOS)

Other platforms are not supported. This cookbook attempts to exit gracefully in places where unsupported platforms may cause an issue, but it is strongly recommended that this cookbook not be used on an unsupported platform's node run list or used as a dependency for cookbooks used on unsupported platforms.

Tested with Test Kitchen

  • Ubuntu 18.04+
  • CentOS 7+
  • Windows 2016+

Tested manually

  • OS X 10.9

May work on other Debian/RHEL family distributions with or without modification.

This cookbook has test-kitchen support for Windows and Mac OS X, but requires custom Vagrant boxes.

Because Vagrant is installed as a native system package, Chef must run as a privileged user (e.g., root or Administrator).

Use of the AppImage version of Vagrant assumes you have set up support for FUSE filesystems. See FUSE for general explanation of FUSE. The vagrant installation resource does not install or set up FUSE.

Attributes

'default' recipe. Install the Vagrant Package

The attributes defined for this cookbook are organized under the node['vagrant'] namespace.

Attribute Description Type Default
['version'] Vagrant package version String '2.0.3'
['url'] Download Vagrant package from this URL String Calculated by vagrant_package_uri helper method.
['checksum'] Vagrant package checksum (SHA256) String Calculated by vagrant_sha256sum helper method.
['appimage'] Use the appimage version Binary nil
['appimage_file'] Install location String nil

'install_plugins' recipe

Attributes in the table below are under the node['vagrant'] namespace.

Attribute Description Type Default
['plugins'] An array of plugins, e.g. %w(vagrant-aws vagrant-ohai vagrant-omnibus) Array nil
['plugins'] If you want to install specific plugin versions, use the second form of the ['plugins'] array, e.g. [ {name: 'vagrant-ohai', version: '0.1.3'}, {name: 'vagrant-aws', version: '0.6.0'} ] Array of Hashes nil
  • node['vagrant']['plugins'] - A array of plugins. The elements in the array can be a string or a hash. String elements should be the names of plugins to install. Hash elements should have the name key for the plugin name. The options version and env keys may be used to specify the version and any needed environment settings for the plugin. This form is used by the vagrant_plugin resource in the install_plugins recipe.
  • node['vagrant']['user'] - A user that is used to automatically install plugins as for the node['vagrant']['plugins'] attribute.
  • node['vagrant']['password'] - The password for the user. Used for installing as another user on windows systems.

Resources

This cookbook includes the:

  • vagrant resource, for installing vagrant.
  • vagrant_plugin resource, for managing vagrant plugins.

vagrant

Actions

  • :install: installs vagrant. Platform specific details are here.

Properties

  • :checksum: Vagrant package checksum (SHA256)
  • :url: Download Vagrant package from this URL
  • :version: Vagrant package version
  • :appimage: Install the appimage version of vagrant flag
  • :appimage_file: Install the appimage vagrant file at this location, defaults to /usr/local/bin/vagrant

Examples

vagrant 'Vagrant' do
  version node['vagrant']['version']
end

vagrant 'Vagrant from url' do
  checksum node['vagrant']['checksum']
  url node['vagrant']['url']
  version node['vagrant']['checksum']
end

vagrant_plugin

Actions

  • :install: installs the specified plugin. Default.
  • :uninstall: uninstalls the specified plugin
  • :remove: uninstalls the specified plugin

Properties

  • :plugin_name: name attribute, the name of the plugin, e.g. "vagrant-omnibus".
  • :version: version of the plugin to installed, must be specified as a string, e.g., "1.0.2"
  • :env: plugin environment variable settings, some plugins require specific settings
  • :user: a user to run plugin installation as. Usually this is for single user systems (like workstations).
  • :sources: alternate locations to search for plugins. This would commonly be used if you are hosting your vagrant plugins in a custom gem repo

Examples

vagrant_plugin 'vagrant-omnibus'

vagrant_plugin 'vagrant-berkshelf' do
  version '1.2.0'
  sources ['http://src1.example.com', 'http://src2.example.com']
end
# Install the plugins as the `donuts` user, into ~/donuts/.vagrant.d
# .vagrant.d will be allocated if it does not exist.
# If a specific user, group or mode is desired use a directory resource to
# create the .vagrant.d directory.
vagrant_plugin 'vagrant-aws' do
  user 'donuts'
end

Install the 'vagrant-winrm' plugin for another user. Windows impersonation

requires a username and password.

vagrant_plugin 'vagrant-winrm' do
  user node['vagrant']['user']
  password node['vagrant']['password']
end

# Install a plugin in the /root directory
vagrant_plugin 'vagrant-aws' do
  vagrant_home: '/root/.vagrant.d'
end

ChefSpec Matchers

Matchers are automatically generated by current versions of ChefSpec.

Example:

RSpec.describe 'example::default' do
  let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }

  it 'installs the vagrant-omnibus plugin' do
    expect(chef_run).to install_vagrant_plugin('vagrant-omnibus').with(
      user: 'my_user'
    )
  end
end

Recipes

default

The default recipe uses the vagrant resource to install Vagrant. OS specific code is in the install custom resource. If the node['vagrant']['plugins'] attribute is not empty, it includes the install_plugins recipe to install any required vagrant plugins.

install_plugins

Iterates over the node['vagrant']['plugins'] attribute and installs the listed plugins. If that attribute is a hash, it installs the specified plugin version. If the node['vagrant']['user'] attribute is set, the plugins are installed for only that user.

uninstall_gem

This recipe will attempt to uninstall the vagrant gem with the gem_package and chef_gem resources. Meaning, it will use the gem binary in the PATH of the shell executing Chef to uninstall, and then use Chef's built-in RubyGems to uninstall. If you have a customized Ruby environment, such as with rbenv or rvm (or other), you may need to manually remove and clean up anything leftover, such as running rbenv rehash. Likewise, if you have multiple copies of the vagrant gem installed, you'll need to clean up all versions. This recipe won't support such craziness :-).

Notes about specific plugins

  • vagrant-libvirt. Installing this plugin has required setting environment variables on ubuntu system. Adding env CONFIGURE_ARGS: 'with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib' to the vagrant_plugin resource properties has worked.

Usage

Set the url and checksum attributes on the node. Do this in a role, or a "wrapper" cookbook. Or, just set the version and let the magic happen.

Then include the default recipe on the node's run list.

To specify plugins for installation in the default recipe, specify an array for the node['vagrant']['plugins'] attribute. For example, to install the vagrant-omnibus plugin (any version) and version "1.2.0" of the vagrant-berkshelf plugin:

node.set['vagrant']['plugins'] = [
  'vagrant-omnibus',
  {name: 'vagrant-berkshelf', version: '1.2.0'}
]

See the attribute tables above.

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website https://opencollective.com/sous-chefs/sponsor/8/website https://opencollective.com/sous-chefs/sponsor/9/website

vagrant's People

Contributors

annih avatar axelrtgs avatar axl89 avatar damacus avatar davidpetzel-disney avatar dougireton avatar dpetzel avatar hartmantis avatar jeffb4 avatar jlosito avatar johnroesler avatar josephholsten avatar jtimberman avatar kitchen-porter avatar markgibbons avatar mcalexvrn avatar miguelaferreira avatar noahgibbs avatar powerschill avatar ramereth avatar renovate[bot] avatar richmurrayois avatar rjhornsby avatar tas50 avatar xorima avatar xorimabot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vagrant's Issues

Use `converge_by` blocks in provider actions

This allows us to get rid of the updated by last action nonsense ๐Ÿ˜บ

Alternatively, we can switch to execute blocks and use_inline_resources. That has the added benefit of addressing #9, and we can remove the shell out code, has converge_by built in, and gives us more clear implementation of things like the user to run as, or any environment variables to pass in.

Installing vagrant returns non-zero and indicates failure on the first try.

Discovered in release testing.
On a windows server without vagrant the cookbook reports that the install fails on the first run.
Ran vagrant plugin list returned -1073741515
[2018-04-02T05:21:28+00:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: vagrant_plugin[vagrant-ohai] (vagrant::install_plugins line 29) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '-1073741515'
---- Begin output of vagrant plugin list ----
Even though vagrant is actually installed.

Default to Vagrant 1.8.1

Vagrant 1.7.4 came out July 17, 2015. Vagrant 1.8.1 came out December 21, 2015. Let's use 1.8.1 now.

Chef 13 requirement should be a major change not minor

Cookbook version

0.9.1

Chef-client version

ChefDK 1.6.11

Platform Details

RHEL 7.x

Scenario:

Cookbook bombs out because the version requirement was changed to >= 13. We are almost moved off of the EOL version, but I had a cookbook still testing on ChefDK 1.x and noticed this with the latest build.

Steps to Reproduce:

Use Chef <= 12

Expected Result:

Expected result is more of a philosophical one. I would expect a new minimum Chef client version to be a major breaking change rather than minor. Maybe that's up for debate since this is still major version 0 ?

Actual Result:

Cookbook bombs out because the version requirement was changed to >= 13

Figure out reasonable behavior for plugin installation on linux for userid and group id

Cookbook version

10

Chef-client version

14

Platform Details

Ubuntu or any linux

Scenario:

The chef client runs install the plugins in user directories with owner:group of root:root.
I think vagrant picks up an environment variable to decide where to install.

Steps to Reproduce:

Run the current ubuntu tests

Expected Result:

??? Figure this out
location, owner, group should be defined based on specifying the user and group vagrant_plugin resource settings.

Actual Result:

Fetching checksums at compile time breaks the cookbook in complicated environments

We have a situation in which we have a cookbook that sets up SSL certificates as well as installing common dev software, including Vagrant.

We use remote_directory to put certs in a folder, notifying a block that runs either update-ca-certificates (if Ubuntu) or update-ca-trust (if RHEL). This is pretty straightforward stuff.

The problem is that happens at runtime, and if I want to also install Vagrant, the cookbook fails at compile time because, without the SSL certificates, it can't go get the checksums here: https://github.com/jtimberman/vagrant-cookbook/blob/master/libraries/helpers.rb#L60-L63

install plugins for users

I am trying to install plugins for a specific user (backstory, deploying this to a box to run CI on vagrant setups). So I noticed this isn't possible currently, but I was more interested if you'd like a PR for that.

Sort of related โ€” was wondering why you shellout vs. using an execute resource for most of the things. Any thoughts on that? These would probably allow me to easily run something as a user and I wouldn't have to rely on sudo or su hacks which may not work on Windows anyway.

NoMethodError for vagrant::debian recipe

Seeing a NoMethodError for the vagrant::debian recipe (latest vagrant cookbook version 0.2.0):

Recipe: vagrant::debian
  * remote_file[/var/chef/cache/vagrant.deb] action create
    - update content in file /var/chef/cache/vagrant.deb from 277480 to 0fc325
    (file sizes exceed 10000000 bytes, diff output suppressed)
  * dpkg_package[vagrant] action install

    ================================================================================
    Error executing action `install` on resource 'dpkg_package[vagrant]'
    ================================================================================

    NoMethodError
    -------------
    No resource or method named `shell_out!' for `Chef::Provider::Package::Dpkg ""'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/vagrant/recipes/debian.rb

      7: dpkg_package "vagrant" do
      8:   source "#{Chef::Config[:file_cache_path]}/vagrant.deb"
      9: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/vagrant/recipes/debian.rb:7:in `from_file'

    dpkg_package("vagrant") do
      provider Chef::Provider::Package::Dpkg
      action :install
      retries 0
      retry_delay 2
      guard_interpreter :default
      package_name "vagrant"
      source "/var/chef/cache/vagrant.deb"
      version "1:1.6.3"
      timeout 900
      cookbook_name "vagrant"
      recipe_name "debian"
    end


Running handlers:
[2014-08-28T15:08:26-06:00] ERROR: Running exception handlers
Running handlers complete
[2014-08-28T15:08:26-06:00] ERROR: Exception handlers complete
[2014-08-28T15:08:26-06:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 3 resources updated in 115.064977159 seconds
[2014-08-28T15:08:27-06:00] ERROR: dpkg_package[vagrant] (vagrant::debian line 7) had an error: NoMethodError: No resource or method named `shell_out!' for `Chef::Provider::Package::Dpkg ""'
[2014-08-28T15:08:27-06:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

I'm using Chef version 11.6.0:

cat /opt/chef/version-manifest.txt
chef 11.6.0-89-g02e3bb7

Component          Installed Version                          Version GUID
-------------------------------------------------------------------------------------------------------------
bundler            1.1.5
cacerts            2012.12.19-1                               md5:349ba2d6964db9ca558c9e1daf38e428
chef               f0439992a4e12dc7a6ee163ce8cb61e51d1485e2   git:f0439992a4e12dc7a6ee163ce8cb61e51d1485e2
libedit            20120601-3.0                               md5:e50f6a7afb4de00c81650f7b1a0f5aea
libgcc             11.8.2
libiconv           1.14                                       md5:e34509b1623cec449dfeb73d7ce9c6c6
libyaml            0.1.4                                      md5:36c852831d02cf90508c29852361d01b
ncurses            5.9                                        md5:8cb9c412e5f2d96bc6f459aa8c6282a1
openssl            1.0.1e                                     md5:66bf6f10f060d561929de96f9dfe5b8c
preparation        11.8.2
ruby               1.9.3-p484                                 md5:8ac0dee72fe12d75c8b2d0ef5d0c2968
rubygems           1.8.24                                     md5:3a555b9d579f6a1a1e110628f5110c6b
version-manifest   11.8.2
yajl               1.1.0
zlib               1.2.6                                      md5:618e944d7c7cd6521551e30b32322f4a

0.7.1 install problem

Hi,

Trying to use vagrant cookbook 0.7.1 and I get this error.

  • Windows 7 SP1 with latest updates
  • chefdk 2.0.28
  • PowerShell 5.1
  • Microsoft Visual C++ 2010 x64 and x86
Generated at 2017-08-04 20:13:47 +0300
NoMethodError: undefined method `split' for nil:NilClass
c:/tmp/local-mode-cache/cache/cookbooks/vagrant/libraries/helpers.rb:66:in `extract_checksum'
c:/tmp/local-mode-cache/cache/cookbooks/vagrant/libraries/helpers.rb:31:in `vagrant_sha256sum'
c:/tmp/local-mode-cache/cache/cookbooks/vagrant/recipes/windows.rb:19:in `from_file'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `instance_eval'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `from_file'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/cookbook_version.rb:205:in `load_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:343:in `load_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:299:in `block in include_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:298:in `each'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:298:in `include_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/dsl/include_recipe.rb:26:in `include_recipe'
c:/tmp/local-mode-cache/cache/cookbooks/vagrant/recipes/default.rb:18:in `from_file'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `instance_eval'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `from_file'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/cookbook_version.rb:205:in `load_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:343:in `load_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:299:in `block in include_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:298:in `each'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:298:in `include_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/dsl/include_recipe.rb:26:in `include_recipe'
c:/tmp/local-mode-cache/cache/cookbooks/tmp/recipes/vagrant.rb:1:in `from_file'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `instance_eval'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `from_file'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/cookbook_version.rb:205:in `load_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:343:in `load_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:299:in `block in include_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:298:in `each'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:298:in `include_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/dsl/include_recipe.rb:26:in `include_recipe'
c:/tmp/local-mode-cache/cache/cookbooks/tmp/recipes/windows.rb:12:in `block in from_file'
c:/tmp/local-mode-cache/cache/cookbooks/tmp/recipes/windows.rb:11:in `each'
c:/tmp/local-mode-cache/cache/cookbooks/tmp/recipes/windows.rb:11:in `from_file'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `instance_eval'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `from_file'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/cookbook_version.rb:205:in `load_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:343:in `load_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:299:in `block in include_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:298:in `each'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:298:in `include_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/dsl/include_recipe.rb:26:in `include_recipe'
c:/tmp/local-mode-cache/cache/cookbooks/tmp/recipes/default.rb:7:in `from_file'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `instance_eval'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/mixin/from_file.rb:30:in `from_file'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/cookbook_version.rb:205:in `load_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:343:in `load_recipe'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context/cookbook_compiler.rb:163:in `block in compile_recipes'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context/cookbook_compiler.rb:160:in `each'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context/cookbook_compiler.rb:160:in `compile_recipes'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context/cookbook_compiler.rb:77:in `compile'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/run_context.rb:192:in `load'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/policy_builder/expand_node_object.rb:97:in `setup_run_context'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/client.rb:513:in `setup_run_context'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/client.rb:281:in `run'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/application.rb:273:in `run_with_graceful_exit_option'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/application.rb:249:in `block in run_chef_client'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/local_mode.rb:44:in `with_server_connectivity'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/application.rb:232:in `run_chef_client'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/application/client.rb:469:in `sleep_then_run_chef_client'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/application/client.rb:458:in `block in interval_run_chef_client'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/application/client.rb:457:in `loop'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/application/client.rb:457:in `interval_run_chef_client'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/application/client.rb:441:in `run_application'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/lib/chef/application.rb:59:in `run'
C:/opscode/chefdk/embedded/lib/ruby/gems/2.4.0/gems/chef-13.2.20-universal-mingw32/bin/chef-client:26:in `<top (required)>'
C:/opscode/chefdk/bin/chef-client:275:in `load'
C:/opscode/chefdk/bin/chef-client:275:in `<main>'

Remove .rubocop.yml with Dangerfile

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

If the only thing in the .rubocop/yml is Dangerfile
Run the latest cookstyle
Remove .rubpopo.yml

Issue sprouted from sous-chefs/meta/issues/108. If not applicable then issue should be closed.

Installing Vagrant > v1.9.2 Fails in macOS

The Error

I received this error when I set default['vagrant']['version'] = '2.0.1' in my attributes file.

================================================================================
Recipe Compile Error in /tmp/kitchen/cache/cookbooks/office_mac_dev_env/recipes/vagrant.rb
================================================================================

NoMethodError
-------------
undefined method `split' for nil:NilClass

Cookbook Trace:
---------------
    /tmp/kitchen/cache/cookbooks/vagrant/libraries/helpers.rb:66:in `extract_checksum'
    /tmp/kitchen/cache/cookbooks/vagrant/libraries/helpers.rb:31:in `vagrant_sha256sum'
    /tmp/kitchen/cache/cookbooks/vagrant/recipes/mac_os_x.rb:18:in `from_file'
    /tmp/kitchen/cache/cookbooks/vagrant/recipes/default.rb:18:in `from_file'
    /tmp/kitchen/cache/cookbooks/office_mac_dev_env/recipes/vagrant.rb:1:in `from_file'

Relevant File Content:
----------------------
/tmp/kitchen/cache/cookbooks/vagrant/libraries/helpers.rb:

59:
60:      def fetch_platform_checksums_for_version
61:        checksums_url = "#{vagrant_base_uri}#{package_version}/vagrant_#{package_version}_SHA256SUMS?direct"
62:        open(checksums_url).readlines
63:      end
64:
65:      def extract_checksum(sha256sums)
66>>       sha256sums.grep(/#{package_name}/)[0].split.first
67:      end
68:    end
69:  end
70:
71:  Chef::Recipe.send(:include, Vagrant::Helpers)
72:

System Info:
------------
chef_version=13.3.42
platform=mac_os_x
platform_version=10.12.6
ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin14]
program_name=chef-client worker: ppid=607;start=12:23:28;
executable=/opt/chef/bin/chef-client

Analysis

I did a short dig into this and it seems it's because the naming convention of the package has changed to include x86_64 in the package name since version 1.9.3, and the helpers for determining the package name on macOS don't include that bit.

2.4.1 (main):0 > def dmg_checksum(version)
2.4.1 (main):0 *   checksums = open("https://releases.hashicorp.com/vagrant/#{version}/vagrant_#{version}_SHA256SUMS?direct").readlines
2.4.1 (main):0 *   checksums.find { |l| l.match? /dmg/ }
2.4.1 (main):0 * end
=> :dmg_checksum
2.4.1 (main):0 > dmg_checksum '1.6.0'
=> "6d6a77a9180f79a1ac69053c28a7cb601b60fe033344881281bab80cde04bf71  vagrant_1.6.0.dmg\n"
2.4.1 (main):0 > dmg_checksum '1.7.0'
=> "1b228d79066938f879335ddb4dce69eb8954e7337a117104004854dc39c135b0  vagrant_1.7.0.dmg\n"
2.4.1 (main):0 > dmg_checksum '1.8.0'
=> "cfc63e433c9aef61384175b263dea081f8b570b6a3e69edd0b77c47c96dce84d  vagrant_1.8.0.dmg\n"
2.4.1 (main):0 > dmg_checksum '1.9.0'
=> "896eb09fdd4b35ecb4d7cb02394b0a7b57cda1cb218a4b0d6e0d9340265f8590  vagrant_1.9.0.dmg\n"
2.4.1 (main):0 > dmg_checksum '1.9.1'
=> "17191ff7a1d796aa89c558b45c706288275dade6a65e2b219c2efa0e54c02ef7  vagrant_1.9.1.dmg\n"
2.4.1 (main):0 > dmg_checksum '1.9.2'
=> "ee0549a16859042d39c08ae153895da6cdfbad7c587b3438349cdf01efe10703  vagrant_1.9.2.dmg\n"
2.4.1 (main):0 > dmg_checksum '1.9.3'
=> "7e08c3d204420027142d6623d2b02c5ec00f635a74b4ca7fb742e91894b942b8  vagrant_1.9.3_x86_64.dmg\n"
2.4.1 (main):0 > dmg_checksum '1.9.4'
=> "2ae186e762498c8e018efbf3452a3d368627cb7d518b26f3f445f0a3686e5a07  vagrant_1.9.4_x86_64.dmg\n"
2.4.1 (main):0 > dmg_checksum '1.9.5'
=> "ac16217b114d8816264700e41114b62acd0c071d2699ae13954086ae3fcb151c  vagrant_1.9.5_x86_64.dmg\n"
2.4.1 (main):0 > dmg_checksum '2.0.0'
=> "596fba741f99a083eed9751973b4a3016c99de611165ca561922008d23008494  vagrant_2.0.0_x86_64.dmg\n"

Relevant Code in helpers.rb

def package_name
    "vagrant_#{package_version}#{package_extension}"
end

def package_extension
    extension = value_for_platform_family(
    'mac_os_x' => '.dmg',
    'windows' => '.msi',
    'debian' => '_x86_64.deb',
    %w(rhel suse fedora) => '_x86_64.rpm'
    )
    raise ArgumentError "HashiCorp doesn't provide a Vagrant package for the #{node['platform']} platform." if extension.nil?

    extension
end

def fetch_platform_checksums_for_version
    checksums_url = "#{vagrant_base_uri}#{package_version}/vagrant_#{package_version}_SHA256SUMS?direct"
    open(checksums_url).readlines
end

def extract_checksum(sha256sums)
    sha256sums.grep(/#{package_name}/)[0].split.first
end

In extract_checksums, sha256sums.grep(/#{package_name}/)[0] will be nilsince thegrepdoesn't find thepackage_name` anymore.

Workaround

Until this is addressed, the issue can be worked around by explicitly setting the node['vagrant']['url'] and node['vagrant']['checksum']

'vagrant_plugin[vagrant-aws]' Bundler ERROR: Failed to build gem native extension.

I am installing a total of 4 vagrant plugins but only the aws one fails. Installing it with "vagrant plugin install aws" works fine.

Here is the error:

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of vagrant plugin install vagrant-aws ----
STDOUT: Installing the 'vagrant-aws' plugin. This can take a few minutes...
Building native extensions.  This could take a while...
STDERR: Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

ERROR: Failed to build gem native extension.

    current directory: /root/.vagrant.d/gems/2.4.2/gems/nokogiri-1.8.1/ext/nokogiri
/opt/vagrant/embedded/bin/ruby -r ./siteconf20171219-4367-17p0qz8.rb extconf.rb
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/opt/vagrant/embedded/bin/$(RUBY_BASE_NAME)
    --help
    --clean
/opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:457:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:572:in `block in try_compile'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:523:in `with_werror'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:572:in `try_compile'
    from extconf.rb:138:in `nokogiri_try_compile'
    from extconf.rb:162:in `block in add_cflags'
    from /opt/vagrant/embedded/lib/ruby/2.4.0/mkmf.rb:630:in `with_cflags'
    from extconf.rb:161:in `add_cflags'
    from extconf.rb:407:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /root/.vagrant.d/gems/2.4.2/extensions/x86_64-linux/2.4.0/nokogiri-1.8.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /root/.vagrant.d/gems/2.4.2/gems/nokogiri-1.8.1 for inspection.
Results logged to /root/.vagrant.d/gems/2.4.2/extensions/x86_64-linux/2.4.0/nokogiri-1.8.1/gem_make.out
---- End output of vagrant plugin install vagrant-aws ----
Ran vagrant plugin install vagrant-aws returned 1

Cookbook Trace:
---------------
/var/chef/cache/cookbooks/vagrant/libraries/plugin.rb:73:in `execute_cli'
/var/chef/cache/cookbooks/vagrant/libraries/plugin.rb:46:in `install'
/var/chef/cache/cookbooks/vagrant/providers/plugin.rb:40:in `block (2 levels) in class_from_file'
/var/chef/cache/cookbooks/vagrant/providers/plugin.rb:39:in `block in class_from_file'

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/vagrant/recipes/install_plugins.rb

 26:     vagrant_plugin plugin do
 27:       user node['vagrant']['user'] if node['vagrant']['user']
 28:       password node['vagrant']['password'] if node['vagrant']['password']
 29:     end
 30:

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/vagrant/recipes/install_plugins.rb:26:in `block in from_file'

vagrant_plugin("vagrant-aws") do
  action [:install]
  default_guard_interpreter :default
  declared_type :vagrant_plugin
  cookbook_name "vagrant"
  recipe_name "install_plugins"
end

System Info:
------------
chef_version=13.6.4
platform=amazon
platform_version=2017.09
ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
program_name=chef-client worker: ppid=3785;start=10:41:57;
executable=/opt/chef/bin/chef-client

Why did you add find user in resource collection code?

@jtimberman I'm refactoring the code to find a user's home directory to add Windows support.

I see you specifically added support for looking up a user in the resource collection in the commits below. Can you explain the purpose of these additions? It seems like if the user and their home directory were created earlier during the Chef run, then they would already be available when vagrant_plugin needed them, or if new_resource.user is nil then it would never be found anyway.

I'm really wondering if we can cut out the support for finding the user in the Chef run resource_collection. It would make the code easier to maintain.

d018000#diff-38a4aeddb4e620724d3b85362cb8b939R66

d018000#diff-9dd581ae1baaef6ddac9d068f84b6639R65

helpers.rb - missing windows arch

Trying to run 0.7.1 (because of #84), but am running into this issue on Windows2012r2 ([1])-

NoMethodError: undefined method `split' for nil:NilClass
.../vagrant/libraries/helpers.rb:66:in `extract_checksum'

It looks like this is because the vagrant packages include the architecture*, but the helpers.rb/package_extension()[2] method leaves the architecture off when dealing with Windows.

[1] https://github.com/sous-chefs/vagrant-cookbook/blob/v0.7.1/libraries/helpers.rb#L66
[2] https://github.com/sous-chefs/vagrant-cookbook/blob/v0.7.1/libraries/helpers.rb#L51

  • At least, as of vagrant 1.9.7 (the default version installed by the cookbook) or later

providers/plugin.rb deprecated `use_inline_resources`

PR #86 is failing its CI build because of:

FC113: Resource declares deprecated use_inline_resources: ./providers/plugin.rb:17[1]

The FC documentation says:

FC113: Resource declares deprecated use_inline_resources

This warning is shown if a cookbook contains a resource using the deprecated use_inline_resources method. use_inline_resources is the default with Chef 13 and this call can be removed from all resources unless Chef 12 compatibility is needed.

Since the .kitchen.yml indicates cookbook support for Chef 12, maybe best to override FC in this case?

[1] http://www.foodcritic.io/#FC113

installing plugin leads to wrong file ownership

Cookbook version

0.9.1

Chef-client version

14.10.9

Platform Details

ubuntu 18.04.2

Scenario etc:

Running the default recipe with the attribute node['vagrant']['plugins'] = ['vagrant-libvirt'] and node['vagrant']['user'] = <user> leads to a ~/.vagrant.d directory with the ownership of <user>:root. This is caused by the shell_out call which has no group set in its options. Would be good if the permissions would be set to <user>:<user_group>. I could create a PR to fix this.

Broken with 0.7.2

Description

Installing 0.7.2 fails

ChefDK Version

2.5.3

Platform Version

OSX sierra

Replication Case

Somehow i cannot reproduce it this way:

Berksfile

source 'https://supermarket.chef.io'

cookbook 'vagrant'
chef exec berks vendor cookbooks

while this will work

Berkfile

source 'https://supermarket.chef.io'
cookbook 'vagrant',  '<= 0.7.1'

Stacktrace

/opt/chefdk/embedded/lib/ruby/site_ruby/2.4.0/rubygems/package/tar_header.rb:128:in `strict_oct': "\x80\x00\x00\x00d\x9E\xD3\xD9" is not an octal string (ArgumentError)
        from /opt/chefdk/embedded/lib/ruby/site_ruby/2.4.0/rubygems/package/tar_header.rb:108:in `from'
        from /opt/chefdk/embedded/lib/ruby/site_ruby/2.4.0/rubygems/package/tar_reader.rb:59:in `each'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/mixlib-archive-0.4.1/lib/mixlib/archive/tar.rb:27:in `block in extract'
        from /opt/chefdk/embedded/lib/ruby/site_ruby/2.4.0/rubygems/package/tar_reader.rb:29:in `new'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/mixlib-archive-0.4.1/lib/mixlib/archive/tar.rb:118:in `reader'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/mixlib-archive-0.4.1/lib/mixlib/archive/tar.rb:25:in `extract'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/mixlib-archive-0.4.1/lib/mixlib/archive.rb:33:in `extract'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/community_rest.rb:16:in `unpack'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/community_rest.rb:102:in `download'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/downloader.rb:70:in `try_download'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/downloader.rb:40:in `block in download'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/downloader.rb:39:in `each'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/downloader.rb:39:in `download'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/installer.rb:108:in `install'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/berkshelf-6.3.1/lib/berkshelf/installer.rb:181:in `block (2 levels) in install_from_universe'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `block in synchronize'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
        from /opt/chefdk/embedded/lib/ruby/gems/2.4.0/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'

Table under install_plugins recipe is not formatted

๐Ÿ‘ป Brief Description

The table under the install_plugins section on the README is not formatted.

๐Ÿฅž Cookbook version

2.0.0

Steps To Reproduce

Steps to reproduce the behavior:

View the following page.

๐Ÿš“ Expected behavior

The table to render correctly.

NoMethodError: undefined method `installed_version=' for LWRP resource vagrant_plugin from cookbook vagrant

Hi,

I get the error
NoMethodError: undefined methodinstalled_version=' for LWRP resource vagrant_plugin from cookbook vagrant`
after updating the cookbook.
Offending line is this:
https://github.com/jtimberman/vagrant-cookbook/blob/master/providers/plugin.rb#L16

If I comment it out, it works. Unfortunately, I don't understand what the line was meant to do in the first place. In previous versions, it appears to be a variable that isn't used anywhere, and in the current version it looks like it gets overwritten in the next line.

Problem appears to be from this commit: cbecfaa

Compile error when bintray is unavailable.

If chef is not able to retrieve the vagrant checksum from bintray, it results in a compile error for any node that has the vagrant cookbook in its dependencies (when the helper method tries to fetch the checksum in the attributes file). I expect this would happen even if the URL and checksum attributes were set elsewhere (I haven't tested that). Today's bintray issue manifested this behavior on my nodes.

Would it be acceptable to rescue these errors and set the default attributes to nil in that case? This should only make nodes that actually need to perform an install be broken if bintray is not working, and none at all if the attributes are set elsewhere.

I was about to start working on that when bintray came back. I could still do it - or maybe someone else has a better idea?

Unable to specify vagrant version when using a wrapper cookbook

Hi I'm having trouble specifying the Vagrant version (and plugin's to install) when using a wrapper cookbook. The vagrant version is always defaulting to 1.9.7.

In my wrapper cookbook I include the the vagrant recipe as follows:
include_recipe 'vagrant'

I'm using Berkshelf so have a dependency on the vagrant cookbook in a Berksfile.

In my wrapper cookbook I've tried setting the following attributes (in the file attributes/default.rb)

default['vagrant']['version'] = '2.0.1'
default['vagrant']['url'] = 'http://{mylocalserver}/vagrant_2.0.1_x86_64.deb'
default['vagrant']['checksum'] = '2f9498a83b3d650fcfcfe0ec7971070fcd3803fad6470cf7da871caf2564d84f'
default['vagrant']['user'] = node['bpm']['user']
default['vagrant']['plugins'] = [
   {
     'name' => 'vagrant-berkshelf',
     'version' => '5.1.2'
   }, {
     'name' => 'vagrant-omnibus',
     'version' => '1.5.0'
   }, {
     'name' => 'vagrant-cachier',
     'version' => '1.2.1'
   }]

When I run Chef solo (13.6.4.) it installs Vagrant version 1.9.7 rather than the one I've specified and none of the vagrant plugins are installed. I can only get the settings above to work if I set them in a JSON file (and use a -j flag) when running chef solo. I'm not an expert on Chef so I'm not sure if I'm doing something wrong in my wrapper cookbook or if the Vagrant cookbook has been written in such a way that I can't do this.

Here's the output from running Chef solo with my wrapper cookbook (using a Vagrant VM)

==> default: - ohai (5.2.0)
==> default: Installing Cookbook Gems:
==> default: Compiling Cookbooks...
==> default: Converging 2 resources
==> default: Recipe: vagrant::debian
==> default:   
==> default: * remote_file[/var/chef/cache/vagrant.deb] action create
==> default: [2017-11-20T16:24:32+00:00] INFO: remote_file[/var/chef/cache/vagrant.deb] created file /var/chef/cache/vagrant.deb
==> default:     
==> default: - create new file /var/chef/cache/vagrant.deb
==> default: [2017-11-20T16:24:32+00:00] INFO: remote_file[/var/chef/cache/vagrant.deb] updated file contents /var/chef/cache/vagrant.deb
==> default:     
==> default: - update content in file /var/chef/cache/vagrant.deb from none to d55798
==> default:     
==> default: (file sizes exceed 10000000 bytes, diff output suppressed)
==> default: 
==> default: 
==> default: [2017-11-20T16:24:33+00:00] INFO: remote_file[/var/chef/cache/vagrant.deb] sending install action to dpkg_package[vagrant] (immediate)
==> default:   
==> default: * dpkg_package[vagrant] action install
==> default: [2017-11-20T16:24:33+00:00] INFO: dpkg_package[vagrant] installing package(s): vagrant
==> default: [2017-11-20T16:24:36+00:00] INFO: dpkg_package[vagrant] installed vagrant at 1.9.7
==> default: 
==> default:     - install version 1.9.7 of package vagrant
==> default:   * dpkg_package[vagrant] action install
==> default: [2017-11-20T16:24:36+00:00] INFO: dpkg_package[vagrant] installing package(s): vagrant
==> default: [2017-11-20T16:24:40+00:00] INFO: dpkg_package[vagrant] installed vagrant at 1.9.7
==> default: 
==> default:     - install version 1.9.7 of package vagrant
==> default: 
==> default: [2017-11-20T16:24:40+00:00] INFO: Chef Run complete in 22.944263477 seconds
==> default: 
==> default: Running handlers:
==> default: [2017-11-20T16:24:40+00:00] INFO: Running report handlers
==> default: Running handlers complete
==> default: 
==> default: [2017-11-20T16:24:40+00:00] INFO: Report handlers complete
==> default: Chef Client finished, 3/3 resources updated in 24 seconds

Can you advise If I'm doing something wrong or if this is a bug.
Thanks.
Rich.

Trying to install vagrant plugins fails during testing.

Found during release testing.
The vagrant_plugin resource tests to see if the plugin is already installed. The vagrant plugin list command returns a nonzero status and installing the plugin fails.
================================================================================
Error executing action install on resource 'vagrant_plugin[vagrant-ohai]'
================================================================================

       Mixlib::ShellOut::ShellCommandFailed
       ------------------------------------
       Expected process to exit with [0], but received '-1073741515'
       ---- Begin output of vagrant plugin list ----
       STDOUT:
       STDERR:
       ---- End output of vagrant plugin list ----
       Ran vagrant plugin list returned -1073741515

Incorrect plugin version match

Currently the cookbook returns the same version for all plugins installed. This means that if you specify plugin versions for several different plugins, they get repeatedly reinstalled because the version doesn't match the very first plugin for all of them.

That's because of this code, from providers/plugin.rb:

def load_current_resource
  @current_resource = Chef::Resource::VagrantPlugin.new(new_resource)
  vp = shell_out("vagrant plugin list")
  if vp.stdout.include?(new_resource.plugin_name)
    @current_resource.installed(true)
    @current_resource.installed_version(vp.stdout.split[1].gsub(/[\(\)]/, ''))
  end
  @current_resource
end

See how the installed_version line with the regexp doesn't depend on which plugin name is being queried? The cookbook will probably need to actually parse the output. Here's example output with constraints, as sample input:

Athanor:madscience_gem noah$ vagrant plugin list
vagrant-aws (0.6.0)
vagrant-digitalocean (0.7.3)
  - Version Constraint: 0.7.3
vagrant-host-shell (0.0.4)
  - Version Constraint: 0.0.4
vagrant-librarian-chef (0.2.1)
  - Version Constraint: 0.2.1
vagrant-linode (0.1.1)
  - Version Constraint: 0.1.1
vagrant-omnibus (1.4.1)
  - Version Constraint: 1.4.1
vagrant-share (1.1.4, system)

This is annoying me right now, so maybe I'll make a pull request happen for this.

Installing plugin vagrant-libvirt fails on ubuntu 18.04

Cookbook version

0.9.1

Chef-client version

14.10.9

Platform Details

ubuntu 18.04.2

Scenario:

Installation of the vagrant-libvirt plugin like described in #100 fails (see output below). Installing it as the actual user running the same command as used by the shell_out works as expected.

[2019-03-22T11:20:22+00:00] ERROR: Mixlib::ShellOut::ShellCommandFailed: vagrant_plugin[vagrant-libvirt] (vagrant::install_plugins line 26) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of vagrant plugin install vagrant-libvirt ----
STDOUT: Installing the 'vagrant-libvirt' plugin. This can take a few minutes...
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
STDERR: Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

ERROR: Failed to build gem native extension.

    current directory: /home/ingo/.vagrant.d/gems/2.4.4/gems/ruby-libvirt-0.7.1/ext/libvirt
/opt/vagrant/embedded/bin/ruby -r ./siteconf20190322-24410-h69yh1.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/opt/vagrant/embedded/bin/$(RUBY_BASE_NAME)
        --with-libvirt-include
        --without-libvirt-include
        --with-libvirt-lib
        --without-libvirt-lib
        --with-libvirt-config
        --without-libvirt-config
        --with-pkg-config
        --without-pkg-config
extconf.rb:73:in `<main>': libvirt library not found in default locations (RuntimeError)

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/ingo/.vagrant.d/gems/2.4.4/extensions/x86_64-linux/2.4.0/ruby-libvirt-0.7.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/ingo/.vagrant.d/gems/2.4.4/gems/ruby-libvirt-0.7.1 for inspection.
Results logged to /home/ingo/.vagrant.d/gems/2.4.4/extensions/x86_64-linux/2.4.0/ruby-libvirt-0.7.1/gem_make.out
---- End output of vagrant plugin install vagrant-libvirt ----
Ran vagrant plugin install vagrant-libvirt returned 1

Can't upgrade Mac or Windows if Vagrant version too low?

I don't find a way to check against a minimum Vagrant version or (probably unreasonable) to say "install this file only if it's not the current version".

I can do that myself from another cookbook, but it would be really convenient to have, say, an optional "minimum_version" field to indicate that Vagrant should be uninstalled and reinstalled if the version is lower than that version.

In my specific case I want "vagrant push", which requires Vagrant 1.7.1, and I've just realized I have a very small installed base of users I can't automatically upgrade :-)

By the way, thanks! I'm really happy this cookbook exists. It saved me writing it :-)

Maybe I'll put together a quick pull request for this.

vagrant_plugin :install fails on Windows in `vagrant_get_home` w/ undefined method `dir' for nil:NilClass

Using the vagrant_plugin resource fails on Windows because the vagrant_get_home helper relies on Ruby's Unix-only Etc module:

https://github.com/jtimberman/vagrant-cookbook/blob/master/libraries/helpers.rb#L62

Repro

A Windows test-kitchen run fails with this stacktrace:

       Recipe: vagrant::install_plugins
         * vagrant_plugin[vagrant-winrm] action install[2015-10-18T16:12:56-07:00] INFO: Processing vagrant_plugin[vagrant-winrm] action install (vagrant::install_plugins line 28)
       [2015-10-18T16:12:59-07:00] DEBUG: Providers for generic vagrant_plugin resource enabled on node include: [LWRP provider vagrant_plugin from cookbook vagrant]
       [2015-10-18T16:12:59-07:00] DEBUG: Provider for action install on resource vagrant_plugin[vagrant-winrm] is LWRP provider vagrant_plugin from cookbook va
grant
       [2015-10-18T16:13:00-07:00] DEBUG: I found a string for `vagrant`
       [2015-10-18T16:13:01-07:00] DEBUG: I found a string for `vagrant`
       [2015-10-18T16:13:02-07:00] DEBUG: Attempting to get $HOME of vagrant


           ================================================================================
           Error executing action `install` on resource 'vagrant_plugin[vagrant-winrm]'
           ================================================================================

           NoMethodError
           -------------
           undefined method `dir' for nil:NilClass

           Resource Declaration:
           ---------------------
           # In C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/vagrant/recipes/install_plugins.rb

            28:     vagrant_plugin plugin do
            29:       user node['vagrant']['user']
            30:     end
            31:

           Compiled Resource:
           ------------------
           # Declared in C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/vagrant/recipes/install_plugins.rb:28:in `block in from_file'

           vagrant_plugin("vagrant-winrm") do
             action [:install]
             retries 0
             retry_delay 2
             default_guard_interpreter :default
             declared_type :vagrant_plugin
             cookbook_name "vagrant"
             recipe_name "install_plugins"
             user "vagrant"
           end

       [2015-10-18T16:13:25-07:00] INFO: Running queued delayed notifications before re-raising exception
       [2015-10-18T16:13:27-07:00] DEBUG: Re-raising exception: NoMethodError - vagrant_plugin[vagrant-winrm] (vagrant::install_plugins line 28) had an error: N
oMethodError: undefined method `dir' for nil:NilClass
       C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/vagrant/libraries/helpers.rb:77:in `vagrant_get_home'
         C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/vagrant/providers/plugin.rb:91:in `vagrant_home'
         C:/Users/vagrant/AppData/Local/Temp/kitchen/cache/cookbooks/vagrant/providers/plugin.rb:28:in `load_current_resource'
         C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1-universal-mingw32/lib/chef/provider.rb:127:in `run_action'
         C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1-universal-mingw32/lib/chef/resource.rb:585:in `run_action'
         C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1-universal-mingw32/lib/chef/runner.rb:49:in `run_action'
       rb:81:in `block (2 levels) in converge'
         C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1-universal-mingw32/lib/chef/runner.rb:81:in `each'
         C:/opscode/chefdk/embedded/lib/ruby/gems/2.1.0/gems/chef-12.5.1-universal-mingw32/lib/chef/runner.rb:81:in `block in converge'

Plugins install on wrong PATH when VAGRANT_HOME is set to another location than homedir

Hi,

I've set a different VAGRANT_HOME to "D:\WORK\.vagrant.d" (for example), but, when I am using the vagrant_plugin resource, everything is still installed on C:\Users#{username}\.vagrant.d

Please modify the following code to not overwrite the PATH if VAGRANT_HOME is already set and is different than homedir/.vagrant.d

    def vagrant_home
      user_home_dir = home_dir
      ::File.join(user_home_dir, '.vagrant.d') unless user_home_dir.nil?
    end

    def home_dir
      return Dir.home unless username

      # Dir.home(user) raises ArgumentError: user `user` doesn't exist
      # on Windows so we must workaround for now.
      if windows?
        "C:/Users/#{username}" if Dir.exist?("C:/Users/#{username}")
      else
        begin
          Dir.home(username)
        rescue ArgumentError
          raise UserNotFoundError
        end
      end
    end

Debian box seems not to work for Test Kitchen

My dev box can't seem to find the debian-7.6 box it says it needs. It can find debian-ubuntu-1404, so I don't think it's just "doesn't work." OS X also doesn't work, but TESTING.md mentions that it needs a custom box, so that's expected.

(And yeah, I installed everything mentioned in TESTING.md.)

Thanks!

Remote or adjust for user dependency

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

The tests for the cookbook have a user component. It assumed that the "default" user was vagrant however on the dokken images the default user is root. In order to get docker builds to succeed the user in the tests had to switched to root.

๐Ÿฅž Cookbook version

Master Branch

๐Ÿ‘ฉโ€๐Ÿณ Chef-Infra Version

N/A

๐ŸŽฉ Platform details

N/A

Steps To Reproduce

N/A

๐Ÿš“ Expected behavior

The tests should either create any users that need to be created or not dependent on whatever the default user that runs the cookbook is.

โž• Additional context

N/A

undefined method `user' for LWRP resource vagrant_plugin from cookbook vagrant

I am trying to install some plugins with the following recipe.

include_recipe 'vagrant'

%w(vagrant-omnibus vagrant-berkshelf).each do |vagrant_plugin|
  vagrant_plugin vagrant_plugin do
    user 'myuser'
  end
end

but it fails with the following output

chef-client fails Recipe Compile Error in /var/chef/cache/cookbooks/mycookbook/recipes/my-vagrant.rb
================================================================================

NoMethodError
-------------
undefined method `user' for LWRP resource vagrant_plugin from cookbook vagrant

Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/mycookbook/recipes/my-vagrant.rb:14:in `block (2 levels) in from_file'
  /var/chef/cache/cookbooks/mycookbook/recipes/my-vagrant.rb:13:in `block in from_file'
  /var/chef/cache/cookbooks/mycookbook/recipes/my-vagrant.rb:12:in `each'
  /var/chef/cache/cookbooks/mycookbook/recipes/my-vagrant.rb:12:in `from_file'

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/mycookbook/recipes/my-vagrant.rb:

  7:  # All rights reserved - Do Not Redistribute
  8:  #
  9:  
 10:  include_recipe 'vagrant'
 11:  
 12:  %w(vagrant-omnibus vagrant-berkshelf).each do |vagrant_plugin|
 13:    vagrant_plugin vagrant_plugin do
 14>>       user 'myuser'
 15:    end
 16:  end 17:  


Running handlers:
[2015-07-16T06:36:37-04:00] ERROR: Running exception handlers
Running handlers complete
[2015-07-16T06:36:37-04:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 7.279798544 seconds
[2015-07-16T06:36:37-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2015-07-16T06:36:37-04:00] ERROR: undefined method `user' for LWRP resource vagrant_plugin from cookbook vagrant
[2015-07-16T06:36:37-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

vagrant version used is 1.7.3

Dependency on windows ~> 1.38 preventing use with later windows versions

Hi guys

I was trying to use this community cookbook to install vagrant on windows, but some other cookbooks we are writing are using a later windows cookbook version (2.1.1)

This vagrant cookbook is pessimistically locked to windows 1.38.x and thus the dependencies cant be satisfied.

Im still getting up to speed with chef concepts, so am not sure of the reasons why or why not to pessimistically lock the versions like this, but it seems unless there is some hard dependency where this cookbook wont work with windows above 1.38 that using the pessimistic verisoning like this is really just preventing potential consumers from succesfully pulling it in?

Would "the fix" in this case be to just change this cookbook to use >= 1.38 rather than ~> 1.38 ?

The dokken environment tests are failing.

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

The tests running under circleci are failing. The vagrant home directory and environment settings are not the same as in local testing.

๐Ÿฅž Cookbook version

Current

๐Ÿ‘ฉโ€๐Ÿณ Chef-Infra Version

15

๐ŸŽฉ Platform details

Dokken.

Steps To Reproduce

Steps to reproduce the behavior:

Any PR

๐Ÿš“ Expected behavior

Successful tests

โž• Additional context

Run latest cookstyle

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

Chef have released updated cookstyle rules, we should therefore run the auto fix against the cookbook

  1. Ensure you are on the latest stable chef-workstation
  2. Run cookstyle -a

Issue sprouted from sous-chefs/meta/issues/111. If not applicable then issue should be closed.

Weird occasional plugin failure mode - installed but not visible

There's an odd failure case that has happened once to me and one of my users on Mac OS.

Specifically, a plugin can be installed (vagrant-host-shell for me, vagrant-omnibus for my user) so that the Vagrant cookbook thinks it's there, and later runs claim it's present and don't install it. But it doesn't show up on "vagrant plugin list" and it can't be used. When a Vagrantfile using it is run, and error occurs saying it can't use provider '' (empty string).

I'm still hunting this problem down. It seems to be rare and flaky rather than a consistent problem with a specific code snippet.

Update builds to be parallel

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

As part of our build process we should build each possible operating system separately

  1. Ensure you have dokken setup and working:
  2. dokken: aliased to KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen
  3. run dokken list, you should see a list of builds with dokken as the provider
  4. download: https://github.com/sous-chefs/repo-management/blob/master/scripts/circleci_maker.rb and make this executable
  5. run: dokken list -j | ./circleci_maker.rb > .circleci/config.yml

Issue sprouted from sous-chefs/meta/issues/112. If not applicable then issue should be closed.

Only install deb package if remote_file re-downloaded

If the vagrant.deb file was never downloaded, then it should already be installed, so not need to notify package resource to run. Or is that too presumptuous? It probably is

package "vagrant" do
  // ...
  action :nothing
end

remote_file "#{Chef::Config['file_cache_path']}/vagrant.deb" do
  // ...
   notifies :install, "package[vagrant]", :immediately
end

Install on macOS doesn't work if any version of Vagrant is already installed

Cookbook version

0.9.1

Chef-client version

14.4.56

Platform Details

macOS 10.13.6

Scenario

I'm attempting to upgrade the version of Vagrant installed on the nodes. I was surprised to see that bumping the version number of default['vagrant']['version'] did nothing.

Steps to Reproduce

My attributes file:

default['vagrant']['version'] = '2.1.4'
default['vagrant']['checksum'] = 'aa097c786bbda33bfe39999a8c353715afe591b593d9a9e5ae422160d3689ae9'
default['vagrant']['url'] = 'https://releases.hashicorp.com/vagrant/2.1.4/vagrant_2.1.4_x86_64.dmg'

My default recipe:

include_recipe 'vagrant::default'

The node I'm running this on is currently running vagrant 2.1.1

Expected Result

I expect vagrant 2.1.4 to be installed

Actual Result

Recipe: vagrant::default
  * vagrant[Vagrant] action install[2018-09-12T15:14:03-07:00] INFO: Processing vagrant[Vagrant] action install (vagrant::default line 18)
[2018-09-12T15:14:03-07:00] INFO: Processing vagrant[Vagrant] action install (vagrant::default line 18)

    * dmg_package[Vagrant] action install[2018-09-12T15:14:03-07:00] INFO: Processing dmg_package[Vagrant] action install (/var/chef/cache/cookbooks/vagrant/resources/default.rb line 41)
[2018-09-12T15:14:03-07:00] INFO: Processing dmg_package[Vagrant] action install (/var/chef/cache/cookbooks/vagrant/resources/default.rb line 41)
[2018-09-12T15:14:03-07:00] INFO: Already installed; to upgrade, try "sudo pkgutil --forget 'com.vagrant.vagrant'"
[2018-09-12T15:14:03-07:00] INFO: Already installed; to upgrade, try "sudo pkgutil --forget 'com.vagrant.vagrant'"
 (up to date)
     (up to date)

And the version is not updated

$ โฏโฏโฏ vagrant --version
Vagrant 2.1.1

Analysis

It looks like the underlying implementation for macOS does not utilize the mechanism for comparing the current running version of vagrant to the requested version.

Compile Error on Chef 11

When attempting to converge a node on Chef 11, on version 0.4.2 of this cookbook I get the following error:

      ================================================================================
       Recipe Compile Error in /tmp/kitchen/cache/cookbooks/vagrant/libraries/plugin.rb
       ================================================================================

       SyntaxError
       -----------
       /tmp/kitchen/cache/cookbooks/vagrant/libraries/plugin.rb:16: syntax error, unexpected tLABEL
       ...gin_name, is_windows, username: nil, password: nil)
       ...                               ^
       /tmp/kitchen/cache/cookbooks/vagrant/libraries/plugin.rb:16: Can't assign to nil
       ...ame, is_windows, username: nil, password: nil)
       ...                               ^
       /tmp/kitchen/cache/cookbooks/vagrant/libraries/plugin.rb:102: syntax error, unexpected keyword_end, expecting $end

       Cookbook Trace:
       ---------------
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:191:in `load'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:191:in `block in load_libraries_from_cookbook'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:188:in `each'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:188:in `load_libraries_from_cookbook'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:99:in `block in compile_libraries'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:98:in `each'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:98:in `compile_libraries'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:71:in `compile'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context.rb:88:in `load'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/policy_builder/expand_node_object.rb:73:in `setup_run_context'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:265:in `setup_run_context'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:429:in `do_run'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:213:in `block in run'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in `fork'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/client.rb:207:in `run'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:217:in `run_chef_client'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/client.rb:328:in `block in run_application'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/client.rb:317:in `loop'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application/client.rb:317:in `run_application'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/application.rb:67:in `run'
         /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/bin/chef-client:26:in `<top (required)>'
         /opt/chef/bin/chef-client:23:in `load'
         /opt/chef/bin/chef-client:23:in `<main>'

       Relevant File Content:
       ----------------------
       /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.8/lib/chef/run_context/cookbook_compiler.rb:

       184:          raise
       185:        end
       186:  
       187:        def load_libraries_from_cookbook(cookbook_name)
       188:          files_in_cookbook_by_segment(cookbook_name, :libraries).each do |filename|
       189:            begin
       190:              Chef::Log.debug("Loading cookbook #{cookbook_name}'s library file: #{filename}")
       191>>             Kernel.load(filename)
       192:              @events.library_file_loaded(filename)
       193:            rescue Exception => e
       194:              @events.library_file_load_failed(filename, e)
       195:              raise
       196:            end
       197:          end
       198:        end
       199:  
       200:        def load_lwrps_from_cookbook(cookbook_name)


       Running handlers:
       [2016-02-13T06:51:37-08:00] ERROR: Running exception handlers
       Running handlers complete
       [2016-02-13T06:51:37-08:00] ERROR: Exception handlers complete
       [2016-02-13T06:51:37-08:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       Chef Client failed. 0 resources updated in 37.158194007 seconds
       [2016-02-13T06:51:37-08:00] ERROR: /tmp/kitchen/cache/cookbooks/vagrant/libraries/plugin.rb:16: syntax error, unexpected tLABEL
       ...gin_name, is_windows, username: nil, password: nil)
       ...                               ^
       /tmp/kitchen/cache/cookbooks/vagrant/libraries/plugin.rb:16: Can't assign to nil
       ...ame, is_windows, username: nil, password: nil)
       ...                               ^
       /tmp/kitchen/cache/cookbooks/vagrant/libraries/plugin.rb:102: syntax error, unexpected keyword_end, expecting $end
       [2016-02-13T06:51:37-08:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Add support for AppImage distribution

:person_frowning: Problem Statement

The AppImage-based distribution of Vagrant (i.e. the generic Linux download available on the official downloads page) is more reliable and robust than the .rpm/.deb/etc. distribution, since it's an OS-agnostic, self-contained distribution bundled with all its dependencies and won't conflict with the OS's Ruby/gems/etc. However, this cookbook doesn't support installing the AppImage distribution.

โ” Possible Solution

Add support to this cookbook for installing the AppImage distribution on any Linux OS.

โคด๏ธ Describe alternatives you've considered

Not using this cookbook.

โž• Additional context

Think that's about it for this feature request :)

Mac OS X: Silent failure when pkgutil setting isn't removed

When somebody has simply removed the Vagrant directory themselves but left the pkgutil setting in place, Vagrant won't be installed but there will be no error. It'd be nice if the cookbook checked for this condition in its most basic form (no /opt/vagrant directory or local equivalent.)

This has happened to me and at least one of my users, so it's not a pure theoretical concern :-)

Update Changelog

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

Update all CHANGELOGs to follow standard defined at https://keepachangelog.com/

Issue sprouted from sous-chefs/meta/issues/101. If not applicable then issue should be closed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.