`vagrant provision` accepts `--provision-with` [GH-1167]

This commit is contained in:
Mitchell Hashimoto 2013-01-30 22:54:28 -08:00
parent 9d2f26604e
commit d19194d95b
2 changed files with 11 additions and 2 deletions

View File

@ -33,6 +33,7 @@ FEATURES:
- Add a VirtualBox provider config `auto_nat_dns_proxy` which when set to
false will not attempt to automatically manage NAT DNS proxy settings
with VirtualBox. [GH-1313]
- `vagrant provision` accepts the `--provision-with` flag [GH-1167]
IMPROVEMENTS / BUG FIXES:

View File

@ -4,8 +4,16 @@ module VagrantPlugins
module CommandProvision
class Command < Vagrant.plugin("2", :command)
def execute
options = {}
options[:provision_types] = nil
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant provision [vm-name]"
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.") do |list|
options[:provision_types] = list.map { |type| type.to_sym }
end
end
# Parse the options
@ -15,7 +23,7 @@ module VagrantPlugins
# Go over each VM and provision!
@logger.debug("'provision' each target VM...")
with_target_vms(argv) do |machine|
machine.action(:provision)
machine.action(:provision, options)
end
# Success, exit status 0