Class: Nucleon::Action::Node::SSH
- Inherits:
-
Object
- Object
- Nucleon::Action::Node::SSH
- Defined in:
- lib/nucleon/action/node/SSH.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/SSH.rb', line 10 def self.describe super(:node, :ssh, 560) end |
Instance Method Details
#arguments ⇒ Object
48 49 50 |
# File 'lib/nucleon/action/node/SSH.rb', line 48 def arguments [ :ssh_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 |
# File 'lib/nucleon/action/node/SSH.rb', line 17 def configure super do register :ssh_nodes, :array, nil do |values| if values.nil? warn('corl.actions.bootstrap.errors.ssh_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('corl.actions.bootstrap.errors.ssh_nodes', { :value => value, :node_provider => info[:provider], :name => info[:name] }) success = false end end end success end end config[:node_provider].default = :rackspace end |
#execute ⇒ Object
Operations
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/nucleon/action/node/SSH.rb', line 55 def execute super do |local_node| ensure_network do batch_success = network.batch(settings[:ssh_nodes], settings[:node_provider], false) do |node| = { :id => node.id, :hostname => node.hostname } info('corl.actions.ssh.start', ) success = node.terminal(extended_config(:ssh, {})) if success info('corl.actions.ssh.success', ) else [:status] = node.status error('corl.actions.ssh.failure', ) end success end myself.status = code.batch_error unless batch_success end end end |
#ignore ⇒ Object
44 45 46 |
# File 'lib/nucleon/action/node/SSH.rb', line 44 def ignore node_ignore - [ :net_provider, :node_provider ] end |