Sha256: fc48b173a17691ca060434b162aa51a441a5755fc609b36cf41497d09747af42

Contents?: true

Size: 1.47 KB

Versions: 10

Compression:

Stored size: 1.47 KB

Contents

module Vagrant
  module Provisioners
    # The base class for a "provisioner." A provisioner is responsible for
    # provisioning a Vagrant system. This has been abstracted out to provide
    # support for multiple solutions such as Chef Solo, Chef Client, and
    # Puppet.
    class Base
      include Vagrant::Util

      # The environment which provisioner is running in. This is a
      # {Vagrant::Action::Environment}
      attr_reader :action_env

      def initialize(env)
        @action_env = env
      end

      # Returns the actual {Vagrant::Environment} which this provisioner
      # represents.
      #
      # @return [Vagrant::Environment]
      def env
        action_env.env
      end

      # Returns the VM which this provisioner is working on.
      #
      # @return [Vagrant::VM]
      def vm
        env.vm
      end

      # This method returns the environment's logger as a convenience
      # method.
      def logger
        env.logger
      end

      # This is the method called to "prepare" the provisioner. This is called
      # before any actions are run by the action runner (see {Vagrant::Actions::Runner}).
      # This can be used to setup shared folders, forward ports, etc. Whatever is
      # necessary on a "meta" level.
      def prepare; end

      # This is the method called to provision the system. This method
      # is expected to do whatever necessary to provision the system (create files,
      # SSH, etc.)
      def provision!; end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
vagrantup-0.5.4 lib/vagrant/provisioners/base.rb
vagrantup-0.5.3 lib/vagrant/provisioners/base.rb
vagrantup-0.5.2 lib/vagrant/provisioners/base.rb
vagrantup-0.5.1 lib/vagrant/provisioners/base.rb
vagrantup-0.5.0 lib/vagrant/provisioners/base.rb
vagrant-0.5.4 lib/vagrant/provisioners/base.rb
vagrant-0.5.3 lib/vagrant/provisioners/base.rb
vagrant-0.5.2 lib/vagrant/provisioners/base.rb
vagrant-0.5.1 lib/vagrant/provisioners/base.rb
vagrant-0.5.0 lib/vagrant/provisioners/base.rb