16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/vagrant-puppetconf/command/puppetconf.rb', line 16
def execute
@ui = Vagrant::UI::Colored.new('puppetconf')
options = {}
@opts = OptionParser.new do |opts|
opts.banner = "Usage: vagrant [vm-name] puppetconf -k config_key -v config_value"
opts.on('-k', '--key CONFIG_KEY', I18n.t('vagrant.plugins.puppetconf.command.options.key')) do |val|
options[:key] = val
end
opts.on('-v', '--value CONFIG_VALUE', I18n.t('vagrant.plugins.puppetconf.command.options.value')) do |val|
options[:value] = val
end
end
vms = parse_options @opts
validate options
with_target_vms(vms) do |vm|
Updater.update(vm, @ui, {options[:key] => options[:value]})
end
end
|