diff --git a/lib/vagrant.rb b/lib/vagrant.rb index 2fcb880dd..884c198ff 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -30,6 +30,7 @@ module Vagrant autoload :Errors, 'vagrant/errors' autoload :Hosts, 'vagrant/hosts' autoload :Plugin, 'vagrant/plugin' + autoload :Provisioners, 'vagrant/provisioners' autoload :Registry, 'vagrant/registry' autoload :SSH, 'vagrant/ssh' autoload :TestHelpers, 'vagrant/test_helpers' @@ -100,7 +101,6 @@ Vagrant.provisioners.register(:shell) { Vagrant::Provisioners::Shell } # Load the things which must be loaded before anything else. require 'vagrant/command' -require 'vagrant/provisioners' require 'vagrant/systems' require 'vagrant/version' Vagrant::Plugin.load! diff --git a/lib/vagrant/provisioners.rb b/lib/vagrant/provisioners.rb index 6393a889e..65046d07b 100644 --- a/lib/vagrant/provisioners.rb +++ b/lib/vagrant/provisioners.rb @@ -1,9 +1,12 @@ # These aren't autoloaded because they have to register things such # as configuration classes right away with Vagrant. -require 'vagrant/provisioners/base' -require 'vagrant/provisioners/chef' -require 'vagrant/provisioners/chef_client' -require 'vagrant/provisioners/chef_solo' -require 'vagrant/provisioners/puppet' -require 'vagrant/provisioners/puppet_server' -require 'vagrant/provisioners/shell' +module Vagrant + module Provisioners + autoload :Base, 'vagrant/provisioners/base' + autoload :ChefSolo, 'vagrant/provisioners/chef_solo' + autoload :ChefClient, 'vagrant/provisioners/chef_client' + autoload :Puppet, 'vagrant/provisioners/puppet' + autoload :PuppetServer, 'vagrant/provisioners/puppet_server' + autoload :Shell, 'vagrant/provisioners/shell' + end +end diff --git a/lib/vagrant/provisioners/chef_client.rb b/lib/vagrant/provisioners/chef_client.rb index 3c2630f95..a2f9da3c7 100644 --- a/lib/vagrant/provisioners/chef_client.rb +++ b/lib/vagrant/provisioners/chef_client.rb @@ -1,5 +1,7 @@ require 'pathname' +require 'vagrant/provisioners/chef' + module Vagrant module Provisioners # This class implements provisioning via chef-client, allowing provisioning diff --git a/lib/vagrant/provisioners/chef_solo.rb b/lib/vagrant/provisioners/chef_solo.rb index 54ec7241e..13ce79bde 100644 --- a/lib/vagrant/provisioners/chef_solo.rb +++ b/lib/vagrant/provisioners/chef_solo.rb @@ -1,3 +1,5 @@ +require 'vagrant/provisioners/chef' + module Vagrant module Provisioners # This class implements provisioning via chef-solo.