Class: Nucleon::Action::Node::Bootstrap
- Inherits:
-
Object
- Object
- Nucleon::Action::Node::Bootstrap
- Defined in:
- lib/nucleon/action/node/bootstrap.rb
Class Method Summary collapse
-
.describe ⇒ Object
—————————————————————————– Info.
Instance Method Summary collapse
- #arguments ⇒ Object
-
#configure ⇒ Object
—————————————————————————– Settings.
-
#execute ⇒ Object
—————————————————————————– Operations.
-
#ignore ⇒ Object
—.
Class Method Details
.describe ⇒ Object
Info
10 11 12 |
# File 'lib/nucleon/action/node/bootstrap.rb', line 10 def self.describe super(:node, :bootstrap, 630) end |
Instance Method Details
#arguments ⇒ Object
63 64 65 |
# File 'lib/nucleon/action/node/bootstrap.rb', line 63 def arguments [ :bootstrap_nodes ] end |
#configure ⇒ Object
Settings
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/nucleon/action/node/bootstrap.rb', line 17 def configure super do register_directory :bootstrap_path, File.join(CORL.lib_path, '..', 'bootstrap') register_files :auth_files register_bool :reboot, true register_bool :dev_build, false register_str :home_env_var, 'HOME' register_str :home, nil register_str :ruby_version, nil register_str :bootstrap_glob, '**/*.sh' register_str :bootstrap_init, 'bootstrap.sh' register_array :bootstrap_scripts register_array :bootstrap_nodes, nil do |values| if values.nil? warn('bootstrap_nodes_empty') next false end node_plugins = CORL.loaded_plugins(:CORL, :node) success = true values.each do |value| if info = CORL.plugin_class(:CORL, :node).translate_reference(value) if ! node_plugins.keys.include?(info[:provider].to_sym) || info[:name].empty? warn('bootstrap_nodes', { :value => value, :node_provider => info[:provider], :name => info[:name] }) success = false end end end success end end end |
#execute ⇒ Object
Operations
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/nucleon/action/node/bootstrap.rb', line 70 def execute super do |local_node| ensure_network do batch_success = network.batch(settings[:bootstrap_nodes], settings[:node_provider], settings[:parallel]) do |node| = { :id => node.id, :hostname => node.hostname } info('start', ) success = node.bootstrap(network.home, extended_config(:bootstrap, Util::Data.clone(settings))) if success success('complete', ) else [:status] = node.status error('failure', ) end success end myself.status = code.batch_error unless batch_success end end end |
#ignore ⇒ Object
59 60 61 |
# File 'lib/nucleon/action/node/bootstrap.rb', line 59 def ignore [ :nodes ] end |