kitchen-vagrant
kitchen-vagrant driver for Kitchen generates a single Vagrantfile
for each instance of Kitchen in a sandboxed directory. The
kitchen-vagrant driver supports VirtualBox and VMware Fusion, requires
Vagrant 1.1.0 (or higher), and is the default driver for Test Kitchen.The following attributes are used to configure kitchen-vagrant for
Chef:
boxThe box on which Vagrant will run.
Default value: computed from the platform name of the instance.
Required
box_check_updateWhether to check for box updates.
Default value:
false.box_urlThe URL at which the configured box is located.
Default value: computed from the platform name of the instance, but only when the Vagrant provider is VirtualBox- or VMware-based.
communicatorUse to override the
config.vm.communicatorsetting in Vagrant. For example, when a base box is a Windows operating system that does not have SSH installed and enabled, Vagrant will not be able to boot without a custom Vagrant file.Default value:
nil(assumes SSH is available).customizeA hash of key-value pairs that define customizations that should be made to the Vagrant virtual machine.
Example:
customize: memory: 1024 cpuexecutioncap: 50.guestThe
config.vm.guestsetting in the default Vagrantfile.guiThe graphical user interface for the defined platform. This is passed to the
config.vm.providersetting in Vagrant, but only when the Vagrant provider is VirtualBox- or VMware-based.networkAn array of network customizations to be applied to the virtual machine.
Example:
network: - ["forwarded_port", {guest: 80, host: 8080}] - ["private_network", {ip: "192.168.33.33"}].Default value:
[].pre_create_commandA command to run immediately before
vagrant up --no-provisioner.providerThe Vagrant provider. This value must match a provider name in Vagrant.
provisionWhether to provision Vagrant when the instance is created. This is useful if the operating system needs customization during provisioning.
Default value:
false.ssh_keyThe private key file used for SSH authentication.
synced_foldersThe collection of synchronized folders on each Vagrant instance. Source paths are relative to the Kitchen root path.
Example:
synced_folders: - ["data/%{instance_name}", "/opt/instance_data"] - ["/host_path", "/vm_path", "create: true, type: :nfs"].Default value:
[].vagrantfile_erbThe alternate Vagrant Embedded Ruby (ERB) template to be used by this driver.
vagrantfilesAn array of paths to one (or more) Vagrant files to be merged with the default Vagrant file. The paths may be absolute or relative to the kitchen.yml file.
vm_hostnameThe internal hostname for the instance. This is not required when connecting to a Vagrant virtual machine. Set this to
falseto prevent this value from being rendered in the default Vagrantfile.Default value: computed from the platform name of the instance.
The kitchen-vagrant driver can predict the box name for Vagrant and
the download URL that have been published by Chef. For example:
platforms:
- name: ubuntu-18.04
- name: ubuntu-20.04
- name: centos-7
- name: centos-8
- name: debian-10
which will generate a configuration file similar to:
platforms:
- name: ubuntu-18.04
driver:
box: bento/ubuntu-18.04
- name: ubuntu-20.04
driver:
box: bento/ubuntu-20.04
# ...