lib/pe_build/plugin.rb in vagrant-pe_build-0.2.0 vs lib/pe_build/plugin.rb in vagrant-pe_build-0.3.0
- old
+ new
@@ -4,35 +4,71 @@
if Vagrant::VERSION < "1.1.0"
raise "vagrant-pe_build version #{PEBuild::VERSION} requires Vagrant 1.1 or later"
end
module PEBuild
-class Plugin < Vagrant.plugin('2')
+ class Plugin < Vagrant.plugin('2')
- name 'pe_build'
+ name 'pe_build'
- description <<-DESC
- This plugin adds commands and provisioners to automatically install Puppet
- Enterprise on Vagrant guests.
- DESC
+ description <<-DESC
+ This plugin adds commands and provisioners to automatically install Puppet
+ Enterprise on Vagrant guests.
+ DESC
- config(:pe_bootstrap, :provisioner) do
- require_relative 'config/pe_bootstrap'
- PEBuild::Config::PEBootstrap
- end
+ # User facing plugin configuration
- config(:pe_build) do
- require_relative 'config/global'
- PEBuild::Config::Global
- end
+ config(:pe_bootstrap, :provisioner) do
+ require_relative 'config/pe_bootstrap'
+ PEBuild::Config::PEBootstrap
+ end
- provisioner(:pe_bootstrap) do
- require_relative 'provisioner/pe_bootstrap'
- PEBuild::Provisioner::PEBootstrap
- end
+ config(:pe_build) do
+ require_relative 'config/global'
+ PEBuild::Config::Global
+ end
- command(:'pe-build') do
- require_relative 'command'
- PEBuild::Command
+ provisioner(:pe_bootstrap) do
+ require_relative 'provisioner/pe_bootstrap'
+ PEBuild::Provisioner::PEBootstrap
+ end
+
+ command(:'pe-build') do
+ require_relative 'command'
+ PEBuild::Command::Base
+ end
+
+ # Guest capabilities for installing PE
+
+ guest_capability('debian', 'detect_installer') do
+ require_relative 'cap'
+ PEBuild::Cap::DetectInstaller::Debian
+ end
+
+ guest_capability('redhat', 'detect_installer') do
+ require_relative 'cap'
+ PEBuild::Cap::DetectInstaller::Redhat
+ end
+
+ guest_capability('ubuntu', 'detect_installer') do
+ require_relative 'cap'
+ PEBuild::Cap::DetectInstaller::Ubuntu
+ end
+
+ guest_capability('linux', 'run_install') do
+ require_relative 'cap'
+ PEBuild::Cap::RunInstall::POSIX
+ end
+
+ guest_capability('solaris', 'run_install') do
+ require_relative 'cap'
+ PEBuild::Cap::RunInstall::POSIX
+ end
+
+ # internal action hooks
+
+ action_hook('PE Build: initialize build dir') do |hook|
+ require 'pe_build/action'
+ hook.prepend PEBuild::Action::PEBuildDir
+ end
end
-end
end