class Nucleon::Action::Node::Bootstrap

Public Class Methods

describe() click to toggle source
Calls superclass method
   # File lib/nucleon/action/node/bootstrap.rb
10 def self.describe
11   super(:node, :bootstrap, 630)
12 end

Public Instance Methods

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