class Chef::Knife::Cloud::OraclecloudServerCreate

Public Instance Methods

before_bootstrap() click to toggle source
Calls superclass method
# File lib/chef/knife/oraclecloud_server_create.rb, line 98
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() click to toggle source
Calls superclass method
# File lib/chef/knife/oraclecloud_server_create.rb, line 81
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() click to toggle source
# File lib/chef/knife/oraclecloud_server_create.rb, line 94
def ip_address
  locate_config_value(:public_ip) ? server.public_ip_addresses.first : server.ip_address
end
label() click to toggle source
# File lib/chef/knife/oraclecloud_server_create.rb, line 77
def label
  locate_config_value(:label) ? locate_config_value(:label) : locate_config_value(:hostname)
end
public_ip() click to toggle source
# File lib/chef/knife/oraclecloud_server_create.rb, line 65
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() click to toggle source
# File lib/chef/knife/oraclecloud_server_create.rb, line 71
def sshkeys
  return [] unless locate_config_value(:sshkeys)

  locate_config_value(:sshkeys).split(',').map { |key| service.prepend_identity_domain(key) }
end
validate_params!() click to toggle source
Calls superclass method
# File lib/chef/knife/oraclecloud_server_create.rb, line 60
def validate_params!
  super
  check_for_missing_config_values!(:image, :shape, :hostname)
end