Class: Chef::Knife::Cloud::OraclecloudServerCreate
Instance Method Summary
collapse
#check_for_missing_config_values!, #create_service_instance, #verify_ssl?
included
Instance Method Details
#before_bootstrap ⇒ Object
96
97
98
99
100
101
|
# File 'lib/chef/knife/oraclecloud_server_create.rb', line 96
def before_bootstrap
super
config[:chef_node_name] = locate_config_value(:chef_node_name) ? locate_config_value(:chef_node_name) : server.name
config[:bootstrap_ip_address] = ip_address
end
|
#before_exec_command ⇒ Object
79
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/chef/knife/oraclecloud_server_create.rb', line 79
def before_exec_command
super
@create_options = {
name: locate_config_value(:hostname),
shape: locate_config_value(:shape),
image: locate_config_value(:image),
label: label,
public_ip: public_ip,
sshkeys: sshkeys
}
end
|
#ip_address ⇒ Object
92
93
94
|
# File 'lib/chef/knife/oraclecloud_server_create.rb', line 92
def ip_address
locate_config_value(:public_ip) ? server.public_ip_addresses.first : server.ip_address
end
|
#label ⇒ Object
75
76
77
|
# File 'lib/chef/knife/oraclecloud_server_create.rb', line 75
def label
locate_config_value(:label) ? locate_config_value(:label) : locate_config_value(:hostname)
end
|
#public_ip ⇒ Object
63
64
65
66
67
|
# File 'lib/chef/knife/oraclecloud_server_create.rb', line 63
def public_ip
return nil unless locate_config_value(:public_ip)
(locate_config_value(:public_ip) == 'pool') ? :pool : "ipreservation:#{locate_config_value(:public_ip)}"
end
|
#sshkeys ⇒ Object
69
70
71
72
73
|
# File 'lib/chef/knife/oraclecloud_server_create.rb', line 69
def sshkeys
return [] unless locate_config_value(:sshkeys)
locate_config_value(:sshkeys).split(',').map { |key| service.prepend_identity_domain(key) }
end
|
#validate_params! ⇒ Object
58
59
60
61
|
# File 'lib/chef/knife/oraclecloud_server_create.rb', line 58
def validate_params!
super
check_for_missing_config_values!(:image, :shape, :hostname)
end
|