{"id":19249250,"url":"https://github.com/sous-chefs/vagrant","last_synced_at":"2025-04-21T12:31:24.060Z","repository":{"id":8155257,"uuid":"9575817","full_name":"sous-chefs/vagrant","owner":"sous-chefs","description":"Development repository for the vagrant cookbook","archived":false,"fork":false,"pushed_at":"2024-11-18T16:53:34.000Z","size":326,"stargazers_count":57,"open_issues_count":1,"forks_count":52,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-04-10T21:25:02.244Z","etag":null,"topics":["chef","chef-cookbook","chef-resource","hacktoberfest","managed-by-terraform","vagrant"],"latest_commit_sha":null,"homepage":"https://supermarket.chef.io/cookbooks/vagrant","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sous-chefs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"open_collective":"sous-chefs"}},"created_at":"2013-04-21T06:41:52.000Z","updated_at":"2024-11-18T16:53:38.000Z","dependencies_parsed_at":"2024-02-20T17:05:05.591Z","dependency_job_id":null,"html_url":"https://github.com/sous-chefs/vagrant","commit_stats":{"total_commits":244,"total_committers":34,"mean_commits":7.176470588235294,"dds":0.6926229508196722,"last_synced_commit":"0438b8b8895f6d4588bdaf512c890fecc83f240e"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fvagrant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fvagrant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fvagrant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sous-chefs%2Fvagrant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sous-chefs","download_url":"https://codeload.github.com/sous-chefs/vagrant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249017994,"owners_count":21199078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chef","chef-cookbook","chef-resource","hacktoberfest","managed-by-terraform","vagrant"],"created_at":"2024-11-09T18:13:25.569Z","updated_at":"2025-04-21T12:31:24.001Z","avatar_url":"https://github.com/sous-chefs.png","language":"Ruby","funding_links":["https://opencollective.com/sous-chefs"],"categories":[],"sub_categories":[],"readme":"# Vagrant Cookbook\n\n[![Cookbook Version](https://img.shields.io/cookbook/v/vagrant.svg)](https://supermarket.chef.io/cookbooks/vagrant)\n[![Build Status](https://img.shields.io/circleci/project/github/sous-chefs/vagrant/master.svg)](https://circleci.com/gh/sous-chefs/vagrant)\n[![OpenCollective](https://opencollective.com/sous-chefs/backers/badge.svg)](#backers)\n[![OpenCollective](https://opencollective.com/sous-chefs/sponsors/badge.svg)](#sponsors)\n[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)\n\nInstalls [Vagrant](https://www.vagrantup.com/) 1.6+ and manages Vagrant plugins via a `vagrant_plugin` resource.\n\nThis cookbook is not intended to be used for vagrant \"1.0\" (gem install) versions. A recipe is provided for removing the gem, see __Recipes__.\n\nThis cookbook is not supported for installing versions of Vagrant older than 1.6.\n\n## Maintainers\n\nThis 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](https://sous-chefs.org/) or come chat with us on the Chef Community Slack in [#sous-chefs](https://chefcommunity.slack.com/messages/C2V7B88SF).\n\n## Requirements\n\nThis cookbook should not be used on platforms that Vagrant itself does not support.\n\n## Vagrant Supported Platforms\n\nVagrant does not specifically list supported platforms on the project web site. However, the only platforms with [packages provided](https://www.vagrantup.com/downloads.html) are:\n\n- Mac OS X\n- Windows\n- Linux (deb-package based platforms, e.g., Debian and Ubuntu)\n- Linux (rpm-packaged based platforms, e.g., RHEL and CentOS)\n\nOther 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.\n\n## Tested with Test Kitchen\n\n- Ubuntu 18.04+\n- CentOS 7+\n- Windows 2016+\n\n## Tested manually\n\n- OS X 10.9\n\nMay work on other Debian/RHEL family distributions with or without modification.\n\nThis cookbook has [test-kitchen](http://kitchen.ci) support for Windows and Mac OS X, but requires custom Vagrant boxes.\n\nBecause Vagrant is installed as a native system package, Chef must run as a privileged user (e.g., root or Administrator).\n\nUse of the AppImage version of Vagrant assumes you have set up support for FUSE filesystems. See [FUSE](https://github.com/libfuse/libfuse)\nfor general explanation of FUSE. The vagrant installation resource does not install or set up FUSE.\n\n## Attributes\n\n### 'default' recipe. Install the Vagrant Package\n\nThe attributes defined for this cookbook are organized under the\n`node['vagrant']` namespace.\n\nAttribute | Description | Type   | Default\n----------|-------------|--------|--------\n['version'] | Vagrant package version | String | '2.0.3'\n['url'] | Download Vagrant package from this URL | String | Calculated by `vagrant_package_uri` helper method.\n['checksum'] | Vagrant package checksum (SHA256) | String | Calculated by `vagrant_sha256sum` helper method.\n['appimage'] | Use the appimage version | Binary | nil\n['appimage_file'] | Install location | String | nil\n\n### 'install_plugins' recipe\n\nAttributes in the table below are under the `node['vagrant']` namespace.\n\nAttribute | Description | Type   | Default\n----------|-------------|--------|--------\n['plugins'] | An array of plugins, e.g. `%w(vagrant-aws vagrant-ohai vagrant-omnibus)` | Array | nil\n['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\n\n- `node['vagrant']['plugins']` - A array of plugins. The elements in\n  the array can be a string or a hash. String elements should be the\n  names of plugins to install. Hash elements should have the name key\n  for the plugin name.  The options version and env keys may be used\n  to specify the version and any needed environment settings for the\n  plugin.  This form is used by the `vagrant_plugin` resource in the\n  `install_plugins` recipe.\n- `node['vagrant']['user']` - A user that is used to automatically install plugins as for the `node['vagrant']['plugins']` attribute.\n- `node['vagrant']['password']` - The password for the user. Used for installing as another user on windows systems.\n\n## Resources\n\nThis cookbook includes the:\n\n- `vagrant` resource, for installing vagrant.\n- `vagrant_plugin` resource, for managing vagrant plugins.\n\n### vagrant\n\n#### Actions\n\n- `:install`: installs vagrant. Platform specific details are here.\n\n#### Properties\n\n- `:checksum`: Vagrant package checksum (SHA256)\n- `:url`: Download Vagrant package from this URL\n- `:version`: Vagrant package version\n- `:appimage`: Install the appimage version of vagrant flag\n- `:appimage_file`: Install the appimage vagrant file at this location, defaults to /usr/local/bin/vagrant\n\n#### Examples\n\n```ruby\nvagrant 'Vagrant' do\n  version node['vagrant']['version']\nend\n\nvagrant 'Vagrant from url' do\n  checksum node['vagrant']['checksum']\n  url node['vagrant']['url']\n  version node['vagrant']['checksum']\nend\n```\n\n### vagrant_plugin\n\n#### Actions\n\n- `:install`: installs the specified plugin. Default.\n- `:uninstall`: uninstalls the specified plugin\n- `:remove`: uninstalls the specified plugin\n\n#### Properties\n\n- `:plugin_name`: name attribute, the name of the plugin, e.g.\n  \"vagrant-omnibus\".\n- `:version`: version of the plugin to installed, must be specified as a string, e.g., \"1.0.2\"\n- `:env`: plugin environment variable settings, some plugins require specific settings\n- `:user`: a user to run plugin installation as. Usually this is for single user systems (like workstations).\n- `:sources`: alternate locations to search for plugins. This would commonly\n  be used if you are hosting your vagrant plugins in a custom gem repo\n\n#### Examples\n\n```ruby\nvagrant_plugin 'vagrant-omnibus'\n\nvagrant_plugin 'vagrant-berkshelf' do\n  version '1.2.0'\n  sources ['http://src1.example.com', 'http://src2.example.com']\nend\n```\n\n```ruby\n# Install the plugins as the `donuts` user, into ~/donuts/.vagrant.d\n# .vagrant.d will be allocated if it does not exist.\n# If a specific user, group or mode is desired use a directory resource to\n# create the .vagrant.d directory.\nvagrant_plugin 'vagrant-aws' do\n  user 'donuts'\nend\n```\n\n#### Install the 'vagrant-winrm' plugin for another user. Windows impersonation\n\nrequires a username and password.\n\n```ruby\nvagrant_plugin 'vagrant-winrm' do\n  user node['vagrant']['user']\n  password node['vagrant']['password']\nend\n\n# Install a plugin in the /root directory\nvagrant_plugin 'vagrant-aws' do\n  vagrant_home: '/root/.vagrant.d'\nend\n```\n\n#### ChefSpec Matchers\n\nMatchers are automatically generated by current versions of ChefSpec.\n\nExample:\n\n```ruby\nRSpec.describe 'example::default' do\n  let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }\n\n  it 'installs the vagrant-omnibus plugin' do\n    expect(chef_run).to install_vagrant_plugin('vagrant-omnibus').with(\n      user: 'my_user'\n    )\n  end\nend\n```\n\n## Recipes\n\n### default\n\nThe 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.\n\n### install_plugins\n\nIterates 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.\n\n### uninstall_gem\n\nThis recipe will attempt to uninstall the `vagrant` gem with the\n`gem_package` and `chef_gem` resources. Meaning, it will use the `gem`\nbinary in the `PATH` of the shell executing Chef to uninstall, and\nthen use Chef's built-in RubyGems to uninstall. If you have a\ncustomized Ruby environment, such as with rbenv or rvm (or other), you\nmay need to manually remove and clean up anything leftover, such as\nrunning `rbenv rehash`. Likewise, if you have multiple copies of the\nvagrant gem installed, you'll need to clean up all versions. This\nrecipe won't support such craziness :-).\n\n### Notes about specific plugins\n\n- 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.\n\n### Usage\n\nSet the url and checksum attributes on the node. Do this in a role, or\na \"wrapper\" cookbook. Or, just set the version and let the magic happen.\n\nThen include the default recipe on the node's run list.\n\nTo specify plugins for installation in the default recipe, specify an\narray for the `node['vagrant']['plugins']` attribute. For example, to\ninstall the `vagrant-omnibus` plugin (any version) and version \"1.2.0\"\nof the `vagrant-berkshelf` plugin:\n\n```ruby\nnode.set['vagrant']['plugins'] = [\n  'vagrant-omnibus',\n  {name: 'vagrant-berkshelf', version: '1.2.0'}\n]\n```\n\nSee the attribute tables above.\n\n## Contributors\n\nThis project exists thanks to all the people who [contribute.](https://opencollective.com/sous-chefs/contributors.svg?width=890\u0026button=false)\n\n### Backers\n\nThank you to all our backers!\n\n![https://opencollective.com/sous-chefs#backers](https://opencollective.com/sous-chefs/backers.svg?width=600\u0026avatarHeight=40)\n\n### Sponsors\n\nSupport this project by becoming a sponsor. Your logo will show up here with a link to your website.\n\n![https://opencollective.com/sous-chefs/sponsor/0/website](https://opencollective.com/sous-chefs/sponsor/0/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/1/website](https://opencollective.com/sous-chefs/sponsor/1/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/2/website](https://opencollective.com/sous-chefs/sponsor/2/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/3/website](https://opencollective.com/sous-chefs/sponsor/3/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/4/website](https://opencollective.com/sous-chefs/sponsor/4/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/5/website](https://opencollective.com/sous-chefs/sponsor/5/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/6/website](https://opencollective.com/sous-chefs/sponsor/6/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/7/website](https://opencollective.com/sous-chefs/sponsor/7/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/8/website](https://opencollective.com/sous-chefs/sponsor/8/avatar.svg?avatarHeight=100)\n![https://opencollective.com/sous-chefs/sponsor/9/website](https://opencollective.com/sous-chefs/sponsor/9/avatar.svg?avatarHeight=100)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsous-chefs%2Fvagrant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsous-chefs%2Fvagrant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsous-chefs%2Fvagrant/lists"}