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-10-30 19:32:15 +00:00
|
|
|
Chef via `chef-solo`, `chef-client`, 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
|
|
|
|
|
|
|
guest_capability(:linux, :chef_installed) do
|
|
|
|
require_relative "cap/linux/chef_installed"
|
|
|
|
Cap::Linux::ChefInstalled
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:debian, :chef_install) do
|
|
|
|
require_relative "cap/debian/chef_install"
|
|
|
|
Cap::Debian::ChefInstall
|
|
|
|
end
|
|
|
|
|
|
|
|
guest_capability(:redhat, :chef_install) do
|
|
|
|
require_relative "cap/redhat/chef_install"
|
|
|
|
Cap::Redhat::ChefInstall
|
|
|
|
end
|
2012-04-19 04:53:19 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|