Class: MintPress::Infrastructure::TransportFactory

Inherits:
Object
  • Object
show all
Includes:
MintLogger, Mixins::Properties
Defined in:
src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb

Overview

The transport_factory resource allows you to specify a standardised way to connect to remote resources - once this has been instaniated, all host resources will use this as their default connection method. This allows you to define many hosts, without having to define many connection methods. Note that hosts can specify which factory to use by name.

Properties (Read/Write)

  • #admin_connect_user ⇒ String (Default Value: Proc.new { self.admin_final_user })
    User to connect with when attempting to make an administritive (i.e. root) connection. This defaults to be the same as admin_final_user

    Property Attributes
    • defaultProc.new { self.admin_final_user }
    
    
    22
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 22
    
    property :admin_connect_user, type: String, default: Proc.new { self.admin_final_user }
  • #admin_final_user ⇒ String (Default Value: 'root')
    User to switch to when making an administritive connection - this is usually 'root' on unix, and 'Administrator' on windows

    Property Attributes
    • default'root'
    
    
    24
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 24
    
    property :admin_final_user, type: String, default: 'root'
  • #admin_keys ⇒ Array of ⇒ String (Default Value: [ "~/.ssh/id_rsa","~/.ssh/id_dsa" ])
    Keys to use for authenticating when connecting as an administrative user

    Property Attributes
    • default[ "~/.ssh/id_rsa","~/.ssh/id_dsa" ]
    
    
    26
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 26
    
    property :admin_keys, type: String, array: true, default: [ "~/.ssh/id_rsa","~/.ssh/id_dsa" ]
  • #admin_password ⇒ String
    Password to use for authenticating when connecting as an administritive user

    Property Attributes
    
    
    28
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 28
    
    property :admin_password, type: String
  • #max_connections ⇒ Integer
    How many connections, at most, do we allow to a host?

    Property Attributes
    
    
    31
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 31
    
    property :max_connections, type: Integer
  • #connections_per_second ⇒ Float (Default Value: 1.0)
    How many connections per second, at most, do we allow to a host?

    Property Attributes
    • default1.0
    
    
    33
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 33
    
    property :connections_per_second, type: Float, default: 1.0
  • #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 }
    
    
    35
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 35
    
    property :admin_key_data, type: String, default: Proc.new { self.key_data }
  • #connect_user ⇒ String (Default Value: Proc.new { self.final_user })
    User to connect as when connecting as an ordinary user - this defaults to be the same as final_user

    Property Attributes
    • defaultProc.new { self.final_user }
    
    
    38
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 38
    
    property :connect_user, type: String, default: Proc.new { self.final_user }
  • #final_user ⇒ String
    User to switch to when connecting as an ordinary user

    Property Attributes
    
    
    40
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 40
    
    property :final_user, type: String
  • #keys ⇒ Array of ⇒ String (Default Value: [ "~/.ssh/id_rsa","~/.ssh/id_dsa" ])
    Keys to use for authenticating when connecting as an ordinary user

    Property Attributes
    • default[ "~/.ssh/id_rsa","~/.ssh/id_dsa" ]
    
    
    42
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 42
    
    property :keys, type: String, array: true, default: [ "~/.ssh/id_rsa","~/.ssh/id_dsa" ]
  • #password ⇒ String
    Password to use for authenticating when connecting as an ordinary user

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

    Property Attributes
    
    
    46
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 46
    
    property :key_data, type: String
  • #temp_folder ⇒ String
    a temporary folder on the remote system. If this is nil, it'll try and work one out

    Property Attributes
    
    
    49
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 49
    
    property :temp_folder, type: String
  • #never_transform ⇒ [TrueClass, FalseClass]
    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
    
    
    53
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 53
    
    property :never_transform, type: [TrueClass, FalseClass]
  • #protocol ⇒ String
    These would generally be overriden by children as well - sensible options are 'ssh','winrm','httprpc','docker, and 'local'

    Property Attributes
    
    
    58
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 58
    
    property :protocol, type: String
  • #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
    
    
    61
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 61
    
    property :user_switch_type, type: String
  • #connect_port ⇒ Integer
    Which port to connect on?

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

    Property Attributes
    
    
    66
    # File 'src/mintpress-infrastructure/lib/mintpress-infrastructure/transport_factory.rb', line 66
    
    property :jump_host, type: Host

Properties (Read Only)

Constant Summary

Constants included from MintLogger

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

Instance Attribute Summary collapse

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

Constructor Details

#initialize(opts = {}) ⇒ TransportFactory

Returns a new instance of TransportFactory.

Instance Attribute Details

#admin_factoryObject

Returns the value of attribute admin_factory.

#factoryObject

Returns the value of attribute factory.

#sequence_idObject

Returns the value of attribute sequence_id.

Instance Method Details

#admin_transport(*args, **kwargs) ⇒ Object

#transport(*args, **kwargs) ⇒ Object

#transport_options(connect_user, final_user, keys, password, key_data, is_admin: false) ⇒ Object

#updateObject