Class: Bcome::Node::Instance
Instance Attribute Summary
Attributes inherited from Base
#meta_data, #stack_peer
Instance Method Summary
collapse
#bastion_ip_address, #direct_ssh_command, #do_ssh, #execute_task, #is_direct_ssh?, #is_jump_ssh?, #is_ssh_jump_host?, #keys, #nat_user, #non_bootstrapped_ssh_command, #ssh, #ssh_jump_command_to_bastion, #ssh_jump_command_to_internal_node, #ssh_key_path, #ssh_user
#direct_rsync, #direct_rsync_bootstrap, #execute_command, #get, #jump_host_rsync, #jump_host_rsync_bootstrap, #put, #rsync_is_sudo, #run
Methods inherited from Base
#initialize, #interactive, #method_missing, #run, #set_parent_reference, #set_stack_peer
#run_local
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Bcome::Node::Base
Instance Method Details
#bootstrap_settings ⇒ Object
30
31
32
|
# File 'lib/nodes/instance.rb', line 30
def bootstrap_settings
environment.bootstrap_settings
end
|
#ec2_hostname ⇒ Object
46
47
48
|
# File 'lib/nodes/instance.rb', line 46
def ec2_hostname
return "#{hostname_map}.ec2.internal"
end
|
#environment ⇒ Object
7
8
9
10
|
# File 'lib/nodes/instance.rb', line 7
def environment
@environment = (@environment ? @environment : stack_peer.environment.node)
@environment
end
|
#hostname_map ⇒ Object
42
43
44
|
# File 'lib/nodes/instance.rb', line 42
def hostname_map
return "ip-#{ip_address.to_s.gsub(".","-")}"
end
|
#identifier ⇒ Object
16
17
18
|
# File 'lib/nodes/instance.rb', line 16
def identifier
stack_peer.override_instance_identifier_for_wbz_stacks? ? wbz_overriden_identifier : @identifier
end
|
#ip_address ⇒ Object
26
27
28
|
# File 'lib/nodes/instance.rb', line 26
def ip_address
environment.ssh_mode_type == ::SSH_DIRECT_MODE_IDENTIFIER ? public_ip_address : @external_network_interface_address
end
|
#local_download_path ⇒ Object
58
59
60
|
# File 'lib/nodes/instance.rb', line 58
def local_download_path
"#{Dir.pwd}#{environment.namespace}/#{identifier}"
end
|
12
13
14
|
# File 'lib/nodes/instance.rb', line 12
def machines
[self] end
|
#namespace ⇒ Object
54
55
56
|
# File 'lib/nodes/instance.rb', line 54
def namespace
"#{environment.namespace}/#{identifier}"
end
|
#proxy(bootstrap = false) ⇒ Object
34
35
36
|
# File 'lib/nodes/instance.rb', line 34
def proxy(bootstrap = false)
environment.proxy(bootstrap)
end
|
#public_ip_address ⇒ Object
38
39
40
|
# File 'lib/nodes/instance.rb', line 38
def public_ip_address
@public_ip_address
end
|
50
51
52
|
# File 'lib/nodes/instance.rb', line 50
def role
@role
end
|
#wbz_overriden_identifier ⇒ Object
20
21
22
23
24
|
# File 'lib/nodes/instance.rb', line 20
def wbz_overriden_identifier
prefix = stack_peer.overriden_identifier_prefix
@identifier =~ /#{prefix}(.+)/
return $1 ? $1 : @identifier
end
|