Skip to content

Instantly share code, notes, and snippets.

@shadoi
Created February 7, 2012 04:51
Show Gist options
  • Save shadoi/1757279 to your computer and use it in GitHub Desktop.
Save shadoi/1757279 to your computer and use it in GitHub Desktop.
config = {}
config[:security_groups] = ["default"]
config[:puppet_params] = {}
opt_parser = OptionParser.new do |opts|
opts.on("-c", "=CLASS", "") {|val| classes.push(val)}
opts.on("-p", /[a-zA-Z0-9_-]+=.*/,"=PARAMETER=VALUE",
"Set puppet variable PARAMETER to VALUE") do |val|
a = val.split('=',2)
config[:puppet_params][a[0]] = a[1]
end
opts.on("-g", "=SECURITY-GROUP", "Use SECURITY-GROUP (default default)") do |val|
config[:security_groups] << val
end
end
opt_parser.parse!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment