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-2.2.0.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.1.4.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.1.2.0 plugins/commands/provision/command.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/plugins/commands/provision/command.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/plugins/commands/provision/command.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/plugins/commands/provision/command.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/plugins/commands/provision/command.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/plugins/commands/provision/command.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/plugins/commands/provision/command.rb
vagrant-unbundled-2.1.1.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.0.4.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.0.3.0 plugins/commands/provision/command.rb
vagrant-aws-detiber-0.7.2.pre.4 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/commands/provision/command.rb
vagrant-aws-detiber-0.7.2.pre.3 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/commands/provision/command.rb
vagrant-aws-detiber-0.7.2.pre.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/commands/provision/command.rb
vagrant-unbundled-2.0.2.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.0.1.0 plugins/commands/provision/command.rb
vagrant-aws-mkubenka-0.7.2.pre.22 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-f3fdbf414272/plugins/commands/provision/command.rb
vagrant-aws-mkubenka-0.7.2.pre.16 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-1ee58c40e3f5/plugins/commands/provision/command.rb
vagrant-unbundled-2.0.0.1 plugins/commands/provision/command.rb