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.3.6.0 plugins/commands/provision/command.rb
tamtam-vagrant-reload-1.2.1 vendor/cache/vagrant-2092df529ae7/plugins/commands/provision/command.rb
vagrant-unbundled-2.3.3.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.3.2.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.19.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.18.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.16.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.14.0 plugins/commands/provision/command.rb
vagrant-aws-mkubenka-0.7.2.pre.24 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-22795b161bf6/plugins/commands/provision/command.rb
vagrant-unbundled-2.2.10.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.9.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.8.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.7.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.6.2 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.6.1 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.6.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.5.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.4.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.3.0 plugins/commands/provision/command.rb
vagrant-unbundled-2.2.2.0 plugins/commands/provision/command.rb