2014-04-12 22:00:28 +00:00
|
|
|
require "pathname"
|
|
|
|
|
2012-04-19 04:53:19 +00:00
|
|
|
require "vagrant"
|
|
|
|
|
2014-10-30 15:21:56 +00:00
|
|
|
require_relative "command_builder"
|
|
|
|
|
2012-04-19 04:53:19 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module Chef
|
2012-11-07 05:21:36 +00:00
|
|
|
class Plugin < Vagrant.plugin("2")
|
2012-04-19 04:53:19 +00:00
|
|
|
name "chef"
|
|
|
|
description <<-DESC
|
|
|
|
Provides support for provisioning your virtual machines with
|
2014-12-24 00:53:29 +00:00
|
|
|
Chef via `chef-solo`, `chef-client`, `chef-zero` or `chef-apply`.
|
2012-04-19 04:53:19 +00:00
|
|
|
DESC
|
|
|
|
|
2014-10-30 19:32:15 +00:00
|
|
|
config(:chef_apply, :provisioner) do
|
|
|
|
require_relative "config/chef_apply"
|
|
|
|
Config::ChefApply
|
2013-01-14 00:41:32 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
config(:chef_client, :provisioner) do
|
2014-10-30 15:21:56 +00:00
|
|
|
require_relative "config/chef_client"
|
2013-01-14 00:41:32 +00:00
|
|
|
Config::ChefClient
|
|
|
|
end
|
|
|
|
|
2014-10-30 19:32:15 +00:00
|
|
|
config(:chef_solo, :provisioner) do
|
|
|
|
require_relative "config/chef_solo"
|
|
|
|
Config::ChefSolo
|
|
|
|
end
|
|
|
|
|
2014-05-19 21:05:46 +00:00
|
|
|
config(:chef_zero, :provisioner) do
|
2014-10-30 15:21:56 +00:00
|
|
|
require_relative "config/chef_zero"
|
2014-05-19 21:05:46 +00:00
|
|
|
Config::ChefZero
|
|
|
|
end
|
|
|
|
|
2014-10-30 19:32:15 +00:00
|
|
|
provisioner(:chef_apply) do
|
|
|
|
require_relative "provisioner/chef_apply"
|
|
|
|
Provisioner::ChefApply
|
2012-05-23 23:07:08 +00:00
|
|
|
end
|
|
|
|
|
2013-01-14 00:41:32 +00:00
|
|
|
provisioner(:chef_client) do
|
2014-10-30 15:21:56 +00:00
|
|
|
require_relative "provisioner/chef_client"
|
2012-05-23 23:07:08 +00:00
|
|
|
Provisioner::ChefClient
|
|
|
|
end
|
2014-05-19 21:05:46 +00:00
|
|
|
|
2014-10-30 19:32:15 +00:00
|
|
|
provisioner(:chef_solo) do
|
|
|
|
require_relative "provisioner/chef_solo"
|
|
|
|
Provisioner::ChefSolo
|
|
|
|
end
|
|
|
|
|
2014-05-19 21:05:46 +00:00
|
|
|
provisioner(:chef_zero) do
|
2014-10-30 15:21:56 +00:00
|
|
|
require_relative "provisioner/chef_zero"
|
2014-05-19 21:05:46 +00:00
|
|
|
Provisioner::ChefZero
|
|
|
|
end
|
2014-10-31 20:06:05 +00:00
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
guest_capability(:debian, :chef_install) do
|
|
|
|
require_relative "cap/debian/chef_install"
|
|
|
|
Cap::Debian::ChefInstall
|
|
|
|
end
|
|
|
|
|
2017-04-05 05:10:02 +00:00
|
|
|
guest_capability(:freebsd, :chef_install) do
|
|
|
|
require_relative "cap/freebsd/chef_install"
|
|
|
|
Cap::FreeBSD::ChefInstall
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:freebsd, :chef_installed) do
|
|
|
|
require_relative "cap/freebsd/chef_installed"
|
|
|
|
Cap::FreeBSD::ChefInstalled
|
|
|
|
end
|
|
|
|
|
2014-10-31 20:06:05 +00:00
|
|
|
guest_capability(:linux, :chef_installed) do
|
|
|
|
require_relative "cap/linux/chef_installed"
|
|
|
|
Cap::Linux::ChefInstalled
|
|
|
|
end
|
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
guest_capability(:omnios, :chef_install) do
|
|
|
|
require_relative "cap/omnios/chef_install"
|
|
|
|
Cap::OmniOS::ChefInstall
|
2015-05-02 14:47:11 +00:00
|
|
|
end
|
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
guest_capability(:omnios, :chef_installed) do
|
|
|
|
require_relative "cap/omnios/chef_installed"
|
|
|
|
Cap::OmniOS::ChefInstalled
|
2014-10-31 20:06:05 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:redhat, :chef_install) do
|
|
|
|
require_relative "cap/redhat/chef_install"
|
|
|
|
Cap::Redhat::ChefInstall
|
|
|
|
end
|
2015-01-13 22:45:01 +00:00
|
|
|
|
2016-01-05 14:30:05 +00:00
|
|
|
guest_capability(:suse, :chef_install) do
|
|
|
|
require_relative "cap/suse/chef_install"
|
|
|
|
Cap::Suse::ChefInstall
|
|
|
|
end
|
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
guest_capability(:windows, :chef_install) do
|
|
|
|
require_relative "cap/windows/chef_install"
|
|
|
|
Cap::Windows::ChefInstall
|
2015-01-13 22:45:01 +00:00
|
|
|
end
|
|
|
|
|
2015-11-19 23:01:09 +00:00
|
|
|
guest_capability(:windows, :chef_installed) do
|
|
|
|
require_relative "cap/windows/chef_installed"
|
|
|
|
Cap::Windows::ChefInstalled
|
2015-01-13 22:45:01 +00:00
|
|
|
end
|
2012-04-19 04:53:19 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|