Class: Caterer::Command::Provision
- Defined in:
- lib/caterer/command/provision.rb
Instance Method Summary collapse
Methods inherited from Server
#add_server_opts, #image_list, #init_server, #target_servers, #with_target_servers
Methods inherited from Base
Constructor Details
This class inherits a constructor from Caterer::Command::Base
Instance Method Details
#execute ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/caterer/command/provision.rb', line 5 def execute = {} parser = OptionParser.new do |opts| opts. = "Usage: cater provision HOST [options]" end add_server_opts(parser, ) # add provision specific options parser.on('-d JSON', '--data JSON', 'json data that the provisioner may use' ) do |d| [:data] = d end parser.on('--ghost', 'provision in ghost-mode (leave no trace)') do [:ghost] = true end parser.on('--dry', "sync provision configuration, but don't run the provisioner") do [:dry] = true end parser.separator "" # Parse the options argv = (parser, true) return if not argv with_target_servers(argv, ) do |server| server.provision(dry_run: [:dry], ghost_mode: [:ghost]) end 0 end |