Class: MintPress::InfrastructureOci::OCIHost

Inherits:
MintPress::Infrastructure::VMHost show all
Includes:
MintLogger, Mixins::Properties
Defined in:
src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb

Direct Known Subclasses

UsingOCIHost

Properties (Read/Write)

  • #instance_id ⇒ String
    'Instance ID of the host'

    Property Attributes
    
    
    34
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 34
    
    property :instance_id, type: String, description: 'Instance ID of the host'
  • #instance_state ⇒ String
    'State of the Instance. Indicates whether the instance is running, shutdown, terminated etc, details here https://docs.cloud.oracle.com/iaas/tools/ruby/latest/OCI/Core/Models/Instance.html'

    Property Attributes
    
    
    35
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 35
    
    property :instance_state, type: String, description: 'State of the Instance. Indicates whether the instance is running, shutdown, terminated etc, details here https://docs.cloud.oracle.com/iaas/tools/ruby/latest/OCI/Core/Models/Instance.html'
  • #image ⇒ String
    'Image ID of the instance. If this is not specified, it will be calculated.'

    Property Attributes
    
    
    37
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 37
    
    property :image, type: String, description: 'Image ID of the instance. If this is not specified, it will be calculated.'
  • #display_name ⇒ String
    'Name of the image, e.g. Oracle-Linux-7.7-2019.09.25-0. If you specify this value, we ignore everything else.'

    Property Attributes
    
    
    38
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 38
    
    property :display_name, type: String, description: 'Name of the image, e.g. Oracle-Linux-7.7-2019.09.25-0. If you specify this value, we ignore everything else.'
  • #native_instance_type ⇒ String
    'The Oracle supplied or custom name of the image, e.g. VM.Standard2.1'

    Property Attributes
    
    
    39
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 39
    
    property :native_instance_type, type: String, description: 'The Oracle supplied or custom name of the image, e.g. VM.Standard2.1'
  • #operating_system ⇒ String (Default Value: 'Oracle Linux')
    'The name of the operating system.'

    Property Attributes
    • default'Oracle Linux'
    
    
    40
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 40
    
    property :operating_system, type: String, description: 'The name of the operating system.', default: 'Oracle Linux'
  • #operating_system_version (Default Value: 7)
    'The version of the operating system.'

    Property Attributes
    • default7
    
    
    41
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 41
    
    property :operating_system_version, description: 'The version of the operating system.', default: 7
  • #subnet_id ⇒ String (Default Value: Proc.new { platform.subnet_id })
    'The subnet ID that will be used for all the VMs built using this provider.'

    Property Attributes
    • defaultProc.new { platform.subnet_id }
    
    
    42
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 42
    
    property :subnet_id, type: String, description: 'The subnet ID that will be used for all the VMs built using this provider.', default: Proc.new { platform.subnet_id }
  • #availability_domain ⇒ String
    'The availability domain ID that will be used for all the VMs built using this provider.'

    Property Attributes
    
    
    43
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 43
    
    property :availability_domain, type: String, description: 'The availability domain ID that will be used for all the VMs built using this provider.'
  • #compartment ⇒ String
    'The compartment ID that will be used for all the VMs built using this provider.'

    Property Attributes
    
    
    44
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 44
    
    property :compartment, type: String, description: 'The compartment ID that will be used for all the VMs built using this provider.'
  • #assign_public_ip ⇒ [TrueClass, FalseClass] (Default Value: false)
    'Property to control whether this instance gets a Public IP. This assumes that the subnet id passed in the provider has access to create Public IPs'

    Property Attributes
    • defaultfalse
    
    
    45
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 45
    
    property :assign_public_ip, type: [TrueClass, FalseClass], default: false, description: 'Property to control whether this instance gets a Public IP. This assumes that the subnet id passed in the provider has access to create Public IPs'
  • #public_key ⇒ String
    'The public key to be put on the host on creation. Note that this key must have a corresponding private key passed in the keys property.'

    Property Attributes
    
    
    46
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 46
    
    property :public_key, type: String, description: 'The public key to be put on the host on creation. Note that this key must have a corresponding private key passed in the keys property.'
  • #preserve_hostinfo ⇒ Integer (Default Value: 2)
    'This applies only to Oracle Linux OS.'

    Property Attributes
    • default2
    • allowed_values[0, 1, 2, 3]
    
    
    59
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 59
    
    property :preserve_hostinfo, type: Integer, default: 2, allowed_values: [0, 1, 2, 3], description: 'This applies only to Oracle Linux OS.'
  • #platform ⇒ MintPress::InfrastructureOci::OciPlatform (Default Value: MintPress::InfrastructureOci::OciPlatform.new)
    'This incapsulates all properties required for the OCI provider.'

    Property Attributes
    • defaultMintPress::InfrastructureOci::OciPlatform.new
    
    
    60
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 60
    
    property :platform, type: MintPress::InfrastructureOci::OciPlatform, default: MintPress::InfrastructureOci::OciPlatform.new, description: 'This incapsulates all properties required for the OCI provider.'
  • #network_security_groups ⇒ Array of ⇒ [String,MintPress::InfrastructureOci::OCINetworkSecurityGroup]
    Network security groups by OCID

    Property Attributes
    
    
    64
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 64
    
    property :network_security_groups, type: [String,MintPress::InfrastructureOci::OCINetworkSecurityGroup], array: true
  • #connect_address (Default Value: Proc.new { self.get_connect_address })

    Property Attributes
    • defaultProc.new { self.get_connect_address }
    
    
    65
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 65
    
    property :connect_address, default: Proc.new { self.get_connect_address }
  • #connect_user (Default Value: 'opc')

    Property Attributes
    • default'opc'
    
    
    66
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 66
    
    property :connect_user, default: 'opc'
  • #admin_connect_user (Default Value: 'opc')

    Property Attributes
    • default'opc'
    
    
    67
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 67
    
    property :admin_connect_user, default: 'opc'
  • #protocol (Default Value: 'ssh')

    Property Attributes
    • default'ssh'
    
    
    68
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 68
    
    property :protocol, default: 'ssh'
  • #use_flex ⇒ [TrueClass, FalseClass] (Default Value: false)
    Should we use flexable shapes rather than try and guess a shape?

    Property Attributes
    • defaultfalse
    
    
    70
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 70
    
    property :use_flex, type: [TrueClass, FalseClass], default: false
  • #flex_shape ⇒ String (Default Value: 'VM.Standard.E4.Flex')
    Flexable shape type - currently one of VM.Standard.E3.Flex, VM.Standard.E4.Flex, and VM.Optimized3.Flex - see https://docs.oracle.com/en-us/iaas/Content/Compute/References/computeshapes.htm#vmshapes__vm-standard for the differences between these

    Property Attributes
    • default'VM.Standard.E4.Flex'
    
    
    73
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 73
    
    property :flex_shape, type: String, default: 'VM.Standard.E4.Flex'
  • #admin_final_user (Default Value: 'root')

    Property Attributes
    • default'root'
    
    
    74
    # File 'src/mintpress-infrastructure-oci/lib/mintpress-infrastructure-oci/oci_host.rb', line 74
    
    property :admin_final_user, default: 'root'
  • #specs ⇒ MintPress::Infrastructure::InstanceType (Default Value: MintPress::Infrastructure::InstanceType.new)
    VMs obviously have CPU and RAM. Note you can set instance_type on this object, and it will make that named native instance type instead. We don't encourage that, though, because that's fundamentally incompatible with multi cloud!

    Property Attributes
    • defaultMintPress::Infrastructure::InstanceType.new
    • no_backreftrue
    
    
    704
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 704
    
    property :specs, type: MintPress::Infrastructure::InstanceType, default: MintPress::Infrastructure::InstanceType.new, no_backref: true
  • #native_instance_type ⇒ String (Default Value: Proc.new { self.find_closest_instance })
    If you would prefer, you can use this property to specify directly which instance type to use on your cloud platform - the default is to call a function which matches cpu/ram as closely as possible via the `specs` property

    Property Attributes
    • defaultProc.new { self.find_closest_instance }
    
    
    714
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 714
    
    property :native_instance_type, type: String, default: Proc.new { self.find_closest_instance }
  • #name ⇒ String
    The name of this resource

    Property Attributes
    
    
    37
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 37
    
    property :name, type: String
  • #hostname ⇒ String (Default Value: Proc.new { r = self.name.split('.')[0] ; r = nil if r == ''; r })
    The hostname of the box _without_ the DNS domain name - note that individual network interfaces can have different hostnames!

    Property Attributes
    • defaultProc.new { r = self.name.split('.')[0] ; r = nil if r == ''; r }
    
    
    40
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 40
    
    property :hostname, type: String, default: Proc.new { r = self.name.split('.')[0] ; r = nil if r == ''; r }
  • #dns_domain ⇒ String (Default Value: Proc.new { r = self.name.split('.')[1..-1].join('.') ; r = nil if r == '.' ; r })
    Just the DNS domain name of the box - again, individual network interfaces _can_ override this!

    Property Attributes
    • defaultProc.new { r = self.name.split('.')[1..-1].join('.') ; r = nil if r == '.' ; r }
    
    
    42
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 42
    
    property :dns_domain, type: String, default: Proc.new { r = self.name.split('.')[1..-1].join('.') ; r = nil if r == '.' ; r }
  • #max_connections ⇒ Integer
    How many connections, at most, do we allow to this host?

    Property Attributes
    
    
    49
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 49
    
    property :max_connections, type: Integer
  • #max_connections_per_second ⇒ Float
    How many connections per second, at most, do we allow to this host? This internally defaults to 1.0

    Property Attributes
    
    
    52
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 52
    
    property :max_connections_per_second, type: Float
  • #affinity_group ⇒ String (Default Value: Proc.new{self.hostname.gsub(/[0-9]/,'').split('.')[0].split('-')[0]})
    Create, by default, an affinity group with no number - note that some infra types don't support named affinity groups, and so this won't work in those cases, and it will always use the node ID in that case

    Property Attributes
    • defaultProc.new{self.hostname.gsub(/[0-9]/,'').split('.')[0].split('-')[0]}
    
    
    56
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 56
    
    property :affinity_group, type: String, default: Proc.new{self.hostname.gsub(/[0-9]/,'').split('.')[0].split('-')[0]}
  • #strict_anti_affinity ⇒ [TrueClass, FalseClass] (Default Value: false)
    Do we strictly enforce anti-affinity, or is it just advisory. Note that if you don't have enough nodes or availability zones to seperate all of your resources, setting this to true _will_ result in failures!

    Property Attributes
    • defaultfalse
    
    
    60
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 60
    
    property :strict_anti_affinity, type: [TrueClass, FalseClass], default: false
  • #host_number ⇒ Integer (Default Value: Proc.new { self.hostname.split('.')[0].split('-')[0].tr("^0-9",'').to_i })
    The numeric ID of this host within an affinity group - this is derived, by default, from the host number. Implementations that have "full" access to the system should convert this back to their own set, so things can be enforced...

    Property Attributes
    • defaultProc.new { self.hostname.split('.')[0].split('-')[0].tr("^0-9",'').to_i }
    
    
    63
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 63
    
    property :host_number, type: Integer, default: Proc.new { self.hostname.split('.')[0].split('-')[0].tr("^0-9",'').to_i }
  • #connect_address ⇒ String (Default Value: Proc.new { self.fqdn })
    This one should be overridden by children - usually we'll get a useful IP from our provider. Failing that, potentially it should come from network_interfaces if they exist! This might be replaced by an action function at some point, though it'll always be through a prop so that it's overridable

    Property Attributes
    • defaultProc.new { self.fqdn }
    
    
    68
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 68
    
    property :connect_address, type: String, default: Proc.new { self.fqdn }
  • #mounts ⇒ Hash of ⇒ MintPress::Infrastructure::MountPoint
    Shares such as NasShare/CifsShare are children of this, so we don't have to repeat ourselves!

    Property Attributes
    
    
    71
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 71
    
    property :mounts, type: MintPress::Infrastructure::MountPoint, hash: true
  • #network_interfaces ⇒ Hash of ⇒ MintPress::Infrastructure::NetworkInterface
    Network interfaces to be attached to this host

    Property Attributes
    
    
    74
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 74
    
    property :network_interfaces, type: MintPress::Infrastructure::NetworkInterface, hash: true
  • #interfaces ⇒ Hash of ⇒ MintPress::Infrastructure::HostInterface
    "The list of interfaces on the host."

    Property Attributes
    
    
    77
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 77
    
    property :interfaces, type: MintPress::Infrastructure::HostInterface, hash: true, description: "The list of interfaces on the host."
  • #block_devices ⇒ Hash of ⇒ MintPress::Infrastructure::BlockDevice
    Which block devcies should be attached to this virtual machine. Block devices are generally either attached disks, FC luns, or iscsi

    Property Attributes
    • canonicaltrue
    
    
    80
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 80
    
    property :block_devices, type: MintPress::Infrastructure::BlockDevice, hash: true, canonical: true
  • #nas_shares ⇒ Hash of ⇒ MintPress::Infrastructure::NasShare
    Which NAS shares should be attached to this system? NAS shares can be either NFS or CIFS shares

    Property Attributes
    • canonicaltrue
    
    
    82
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 82
    
    property :nas_shares, type: MintPress::Infrastructure::NasShare, hash: true, canonical: true
  • #admin_connect_user ⇒ String
    Which user should be used to connect as an administrive user. Different providers will default this differnetly - for example, ec2-user for AWS.

    Property Attributes
    
    
    85
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 85
    
    property :admin_connect_user, type: String
  • #admin_final_user ⇒ String
    The final user for admin will almost always be root, but you _could_ change it for a particularly weird environment

    Property Attributes
    
    
    87
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 87
    
    property :admin_final_user, type: String
  • #admin_keys ⇒ Array of ⇒ String (Default Value: Proc.new { self.keys })
    SSH keys for connecting as an administrative user (these have an in-code default of [ "~/.ssh/id_rsa","~/.ssh/id_dsa" ])

    Property Attributes
    • defaultProc.new { self.keys }
    
    
    90
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 90
    
    property :admin_keys, type: String, array: true, default: Proc.new { self.keys }
  • #admin_password ⇒ String
    Password for connecting as an administrtive user

    Property Attributes
    
    
    92
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 92
    
    property :admin_password, type: String
  • #admin_key_data ⇒ String (Default Value: Proc.new { self.key_data })
    SSH key data (ie the actual contents of the key file) as an administrative user

    Property Attributes
    • defaultProc.new { self.key_data }
    
    
    94
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 94
    
    property :admin_key_data, type: String, default: Proc.new { self.key_data }
  • #environment_variables ⇒ Hash of ⇒ String
    Environment variables to set on the unprivleged transport

    Property Attributes
    
    
    97
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 97
    
    property :environment_variables, type: String, hash: true
  • #admin_environment_variables ⇒ Hash of ⇒ String
    Environment variables to set on the privleged transport

    Property Attributes
    
    
    100
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 100
    
    property :admin_environment_variables, type: String, hash: true
  • #never_transform ⇒ [TrueClass, FalseClass] (Default Value: false)
    Disable using the connection proxy server? This can be required on certain systems that don't support our ruby, such as EL5 systems, but generally should be avoided

    Property Attributes
    • defaultfalse
    
    
    104
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 104
    
    property :never_transform, type: [TrueClass, FalseClass], default: false
  • #os_family ⇒ String (Default Value: Proc.new { self.detect_os_family })
    Some details about the OS

    Property Attributes
    • defaultProc.new { self.detect_os_family }
    
    
    107
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 107
    
    property :os_family, type: String, default: Proc.new { self.detect_os_family }
  • #os_release ⇒ Hash (Default Value: Proc.new { self.detect_os_release })
    Some details about the OS Release

    Property Attributes
    • defaultProc.new { self.detect_os_release }
    
    
    110
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 110
    
    property :os_release, type: Hash, default: Proc.new { self.detect_os_release }
  • #os_arch ⇒ String (Default Value: Proc.new { self.detect_os_arch })
    Some details about the OS Architecture

    Property Attributes
    • defaultProc.new { self.detect_os_arch }
    
    
    113
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 113
    
    property :os_arch, type: String, default: Proc.new { self.detect_os_arch }
  • #os_cpu_count ⇒ Integer (Default Value: Proc.new { self.detect_os_cpu_count })
    Some details about the OS CPU Count

    Property Attributes
    • defaultProc.new { self.detect_os_cpu_count }
    
    
    116
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 116
    
    property :os_cpu_count, type: Integer, default: Proc.new { self.detect_os_cpu_count }
  • #os_memory_total ⇒ Integer (Default Value: Proc.new { self.detect_os_memory_total })
    Some details about the OS Memory Total

    Property Attributes
    • defaultProc.new { self.detect_os_memory_total }
    
    
    119
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 119
    
    property :os_memory_total, type: Integer, default: Proc.new { self.detect_os_memory_total }
  • #os_swap_total ⇒ Integer (Default Value: Proc.new { self.detect_os_swap_total })
    Some details about the OS Swap Total

    Property Attributes
    • defaultProc.new { self.detect_os_swap_total }
    
    
    122
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 122
    
    property :os_swap_total, type: Integer, default: Proc.new { self.detect_os_swap_total }
  • #connect_user ⇒ String
    Which user should be used to connect as an ordinary user. Different providers will default this differnetly - for example, ec2-user for AWS.

    Property Attributes
    
    
    125
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 125
    
    property :connect_user, type: String
  • #final_user ⇒ String
    Which user should we finally end up as, either by being the same as connect_user, or via sudo/su. It is possible to leave both this and connect user black, in which case you will have a host which is not contactable via SSH, but can still be contacted via an external means (docker transport, for example, does not require a user)

    Property Attributes
    
    
    129
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 129
    
    property :final_user, type: String
  • #keys ⇒ Array of ⇒ String
    SSH keys to connect (these have an in-code default of [ "~/.ssh/id_rsa","~/.ssh/id_dsa" ])

    Property Attributes
    
    
    131
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 131
    
    property :keys, type: String, array: true
  • #password ⇒ String
    Password to use to authenticate the user

    Property Attributes
    
    
    133
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 133
    
    property :password, type: String
  • #key_data ⇒ String
    SSH key data (ie the actual contents of the key file)

    Property Attributes
    
    
    135
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 135
    
    property :key_data, type: String
  • #protocol ⇒ String (Default Value: Proc.new { r=nil if self.name.to_s == 'local' r='local' else r='ssh' end r })
    These would generally be overriden by children as well - sensible options are 'ssh','winrm','httprpc','docker', and 'local'.

    Property Attributes
    • defaultProc.new { r=nil if self.name.to_s == 'local' r='local' else r='ssh' end r }
    
    
    139
    140
    141
    142
    143
    144
    145
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 139
    
    property :protocol, type: String, default: Proc.new { r=nil 
    if self.name.to_s == 'local' 
      r='local' 
    else 
      r='ssh'
    end
    r }
  • #user_switch_type ⇒ String
    Which user switch type should be used - the options for this depend on your protocol, however usually "sudo", "su", and "direct" are the sensible options. Generally this will default to something sane.

    Property Attributes
    
    
    148
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 148
    
    property :user_switch_type, type: String
  • #connect_port ⇒ Integer
    The port on which to connect - default is 22 for ssh, and 443 for HTTP/RPC, and nil for local

    Property Attributes
    
    
    150
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 150
    
    property :connect_port, type: Integer
  • #jump_host ⇒ MintPress::Infrastructure::Host
    What jump box is required to access this? This will be used via add_hop in las-rpc-utils

    Property Attributes
    
    
    153
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 153
    
    property :jump_host, type: MintPress::Infrastructure::Host
  • #temp_folder ⇒ String (Default Value: Proc.new { self.guess_tmp_folder })
    a temporary folder on the remote system. If this is nil, it'll try and work one out

    Property Attributes
    • defaultProc.new { self.guess_tmp_folder }
    • cached_proctrue
    
    
    156
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 156
    
    property :temp_folder, type: String, default: Proc.new { self.guess_tmp_folder }, cached_proc: true
  • #factory ⇒ MintPress::Infrastructure::TransportFactory (Default Value: Proc.new { $mintpress_transport_factory = MintPress::Infrastructure::TransportFactory.new if $mintpress_transport_factory.nil? $mintpress_transport_factory })
    Use a non-default transport factory (See the TransportFactory resource for details)

    Property Attributes
    • defaultProc.new { $mintpress_transport_factory = MintPress::Infrastructure::TransportFactory.new if $mintpress_transport_factory.nil? $mintpress_transport_factory }
    
    
    159
    160
    161
    162
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 159
    
    property :factory, type: MintPress::Infrastructure::TransportFactory, default: Proc.new {
      $mintpress_transport_factory = MintPress::Infrastructure::TransportFactory.new if $mintpress_transport_factory.nil?
      $mintpress_transport_factory
    }
  • #bootstrapper ⇒ Array of ⇒ MintPress::Infrastructure::Bootstrapper (Default Value: MintPress::Infrastructure::Bootstrapper.new(host: self))
    Which bootstrap provider to use for creating new hosts

    Property Attributes
    • defaultMintPress::Infrastructure::Bootstrapper.new(host: self)
    • canonicaltrue
    
    
    165
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 165
    
    property :bootstrapper, type: MintPress::Infrastructure::Bootstrapper, default: MintPress::Infrastructure::Bootstrapper.new(host: self), canonical: true, array: true
  • #always_use_mintpress_bootstrap ⇒ [TrueClass, FalseClass] (Default Value: true)
    Should we always use the mintpress internal bootstrap provider, even when anotehr is seperately specified? This defaults to 'true', since usually you need things like disks formatted and so forth before calling out to a chef, puppet, ansible, or salt - but if your provider does handle everything you need, you are free to disable this.

    Property Attributes
    • defaulttrue
    
    
    169
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 169
    
    property :always_use_mintpress_bootstrap, type: [TrueClass, FalseClass], default: true
  • #bootstrap_with_dns ⇒ [TrueClass, FalseClass] (Default Value: false)
    Should we create DNS entries?

    Property Attributes
    • defaultfalse
    
    
    171
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 171
    
    property :bootstrap_with_dns, type: [TrueClass, FalseClass], default: false
  • #bootstrap_dns_provider ⇒ String
    Which DNS provider should we use for creating DNS entries?

    Property Attributes
    
    
    173
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 173
    
    property :bootstrap_dns_provider, type: String
  • #public_postfix ⇒ String
    Public postfix if no network interfaces are defined.

    Property Attributes
    
    
    183
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 183
    
    property :public_postfix, type: String
  • #private_postfix ⇒ String
    Private postfix if no network interfaces are defined.

    Property Attributes
    
    
    185
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 185
    
    property :private_postfix, type: String

Properties (Read Only)

  • #fqdn ⇒ String (Default Value: Proc.new { r = [self.hostname, self.dns_domain].join('.').gsub(/\.$/,'') ; r = nil if r=='.' or r=='' ; r })
    The FQDN of the box. This is set to read_only since it should be formed by hostname/dns_domain, which also defaults from a FQDN name variable.

    Property Attributes
    • defaultProc.new { r = [self.hostname, self.dns_domain].join('.').gsub(/\.$/,'') ; r = nil if r=='.' or r=='' ; r }
    • read_onlytrue
    
    
    46
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 46
    
    property :fqdn, type: String, default: Proc.new { r = [self.hostname, self.dns_domain].join('.').gsub(/\.$/,'') ; r = nil if r=='.' or r=='' ; r }, read_only: true
  • #implemented_providers ⇒ Array of ⇒ String
    'List of infrastructure providers that this class can work with'

    Property Attributes
    • read_onlytrue
    
    
    176
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/host.rb', line 176
    
    property :implemented_providers, type: String, array: true, read_only: true, description: 'List of infrastructure providers that this class can work with'

Constant Summary

Constants included from MintLogger

MintLogger::DEBUG, MintLogger::ERROR, MintLogger::FATAL, MintLogger::INFO, MintLogger::UNKNOWN, MintLogger::VERBOSE, MintLogger::WARN

Instance Attribute Summary

Attributes included from Mixins::Properties

#autopush_set_cache, #dynamic_create, #harvest_on_access, #harvest_undefined_only, #harvested, #tree_root

Instance Method Summary collapse

Methods included from Mixins::Properties

#[], #[]=, #add_validate_report_result, #armour_set_property, #array_contains?, #array_is_a?, #check_autopush, #check_stack_overflow, #clone_property_object, #cloner_handle_single_property, #coerce_single, #contains_as_string?, #display_validate_report_result, #double_initialize?, #dump_to_hash, #find_parent, #find_parent_by_identity, #generate_accessor_functions, #get_canonical_renamed, #get_from_opts, #get_my_name, #get_property, #get_property_item, #has?, included, #initialize_validate_report, #inspect, #is_cloned_object?, #is_mintpress_object?, #is_probably_canonical?, #is_set?, #local_debug, #local_info, #local_verbose, #mintpress_property_definitions, #place_object_by_identity, #process_properties, #prop_set?, #property, #property_definitions, #property_details, #property_is_simple_object?, #push_root!, #require_property, #require_update, #retrieve_docstring, #sanitize, #set_map_dirty, #set_property, #set_property_item, #show_short_array, #strip_defaults!, #synchronize, #uncloned_property_definitions, #update_map, #validate, #validate_generic, #validate_properties, #validate_property, #validate_required, #version_allowed?, #weakref

Methods included from MintLogger::Utils::Common

#boolean_val, #has_value?, #no_value?, #nvl, #path_as_symbol, #ruby_level_to_send

Methods inherited from MintPress::Infrastructure::VMHost

#allocate_block_device, #check_procness, #is_valid?

Methods included from Mixins::GenericProvider

included, #register_provider, #register_sub_provider

Methods included from Mixins::Backgroundable

#backgroundable, #wait_for_background_tasks

Methods inherited from MintPress::Infrastructure::Host

#admin_transport, #background_bootstrap, #background_create, #background_destroy, #background_force_bootstrap, #background_unbootstrap, #bootstrap, #create_admin_transport, #create_default_network_interface, #create_transport, #detect_os_arch, #detect_os_cpu_count, #detect_os_family, #detect_os_memory_total, #detect_os_release, #detect_os_swap_total, #dns_propagated?, #force_bootstrap, #get_local_ip, #guess_primary_ip, #guess_tmp_folder, #transport, #transport_options, #unbootstrap, #uncreatable?, #wait_for_connectable, #wait_for_dns, #wait_for_transport

Constructor Details

#initialize(opts = {}) ⇒ OCIHost

Returns a new instance of OCIHost.

Instance Method Details

#add_network_security_group_by_display_name(name) ⇒ Object

Helper function to add by name

#attach_storageObject

Method to add a storage volume to a host.

#createObject

Method to create an Instance on OCI

#destroyObject

Delete the instance and storage

#exists?Boolean

Method to search if the OCI Instance exists

Returns:

  • (Boolean)

#find_closest_instanceObject

#get_connect_addressObject

#get_image_idObject

This function fetches the image ID required to build the VM. In OCI, you must pass the ID of the image and the shape of image to build. The image_id can be directly set in the initializer of this object, if it is not we try to find it. We find the image based on the following order: 1. If the user specified the name of the image, e.g. Oracle-Linux-7.7-2019.09.25-0 we search directly against that image, if the image is not found, we raise error 2. If image name is not specified, and instead the user specified a shape instead, e.g. VM.Standard.E2.4; we search based on the shape+operating_system+operating_system_version, an error is raised if the image is not found 3. if neither of (#1) or (#2) are specified, we then search the image based on cpu+memory+operating_system+operating_system+operating_system_version There could be multiple images that could be returned from each of the above because Oracle patches the images frequently, e.g. Oracle-Linux-7.6-2019.08.02-0 and Oracle-Linux-7.6-2019.07.15-0 are both Oracle Linux images for 7.6 version but have different patchsets on them. In such cases, we always return the latest one, i.e. the image that has the latest timestamp In each of the cases above (except #1), if the user did not specify an exact version of operating_system, e.g. if the user specified only 7 instead of 7.7, we will return the latest one, e.g 7.7

#get_nsgsObject

This function normalizes the network security groups into IDs We need to make a copy in here, or else we have a bad time....

#get_transportObject

Method to get a transport

#harvestObject

#remove_network_security_group_by_display_name(name) ⇒ Object

Helper function to remove by name

#restart(graceful: true) ⇒ Object

Restart an OCI Instance

#running?Boolean

Returns:

  • (Boolean)

#search_by_osObject

This method searches the OCI images based on OS and OS version

#startObject

Start an OCI Instance

#stop(graceful: true) ⇒ Object

Stop an OCI Instance

#updateObject

This will update the vnic specifically

#update_oci_confObject

Method to update the OCI Conf, This applies to Linux instances