Sha256: fd282a79320ea9f575dd3e5dc5be51f08dacf2b022612420dbb5d6219ceb9bfe

Contents?: true

Size: 714 Bytes

Versions: 2

Compression:

Stored size: 714 Bytes

Contents

module Vagrant
  class Commands
    #run the provisioner on a running vm
    class Provision < Base
      Base.subcommand "provision", self
      description "Run the provisioner"

      def execute(args=[])
        all_or_single(args, :provision)
      end

      def provision_single(name)
        vm = env.vms[name.to_sym]
        if vm.nil?
          error_and_exit(:unknown_vm, :vm => name)
          return # for tests
        end

        if vm.vm.running?
          vm.provision
        else
          vm.env.logger.info "VM '#{name}' not running. Ignoring provision request."
        end
      end

      def options_spec(opts)
        opts.banner = "Usage: vagrant provision"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
vagrantup-0.4.0 lib/vagrant/commands/provision.rb
vagrant-0.4.0 lib/vagrant/commands/provision.rb