Sha256: 71098663885ae2464e5c24715af471b6987b4cc44f445f31cf23b5de9fff7ebe

Contents?: true

Size: 988 Bytes

Versions: 58

Compression:

Stored size: 988 Bytes

Contents

require 'optparse'

module VagrantPlugins
  module CommandProvision
    class Command < Vagrant.plugin("2", :command)
      def self.synopsis
        "provisions the vagrant machine"
      end

      def execute
        options = {}
        options[:provision_types] = nil

        opts = OptionParser.new do |o|
          o.banner = "Usage: vagrant provision [vm-name] [--provision-with x,y,z]"

          o.on("--provision-with x,y,z", Array,
                    "Enable only certain provisioners, by type or by name.") do |list|
            options[:provision_types] = list.map { |type| type.to_sym }
          end
        end

        # Parse the options
        argv = parse_options(opts)
        return if !argv

        # Go over each VM and provision!
        @logger.debug("'provision' each target VM...")
        with_target_vms(argv) do |machine|
          machine.action(:provision, options)
        end

        # Success, exit status 0
        0
      end
    end
  end
end

Version data entries

58 entries across 54 versions & 6 rubygems

Version Path
vagrant-unbundled-1.9.8.1 plugins/commands/provision/command.rb
vagrant-unbundled-1.9.7.1 plugins/commands/provision/command.rb
vagrant-aws-mkubenka-0.7.2.pre.14 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/commands/provision/command.rb
vagrant-aws-mkubenka-0.7.2.pre.11 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/commands/provision/command.rb
vagrant-aws-mkubenka-0.7.2.pre.10 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/commands/provision/command.rb
vagrant-aws-mkubenka-0.7.2.pre.9 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-5333e60e2d38/plugins/commands/provision/command.rb
vagrant-unbundled-1.9.5.1 plugins/commands/provision/command.rb
vagrant-unbundled-1.9.1.1 plugins/commands/provision/command.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/commands/provision/command.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/commands/provision/command.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/commands/provision/command.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/plugins/commands/provision/command.rb
vagrant-unbundled-1.8.5.2 plugins/commands/provision/command.rb
vagrant-unbundled-1.8.5.1 plugins/commands/provision/command.rb
vagrant-unbundled-1.8.4.2 plugins/commands/provision/command.rb
vagrant-unbundled-1.8.4.1 plugins/commands/provision/command.rb
vagrant-unbundled-1.8.1.2 plugins/commands/provision/command.rb
vagrant-unbundled-1.8.1.1 plugins/commands/provision/command.rb