Class: MintPress::OracleEBS::Host

Inherits:
Object
  • Object
show all
Includes:
MintLogger, EbsUtils
Defined in:
src/oracle-ebs/lib/oracle-ebs/host.rb

Overview

Host: Class to define a unix host along with various methods to connect to it and derive values from it.

Properties (Read/Write)

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

Instance Method Summary collapse

Methods included from MintLogger::Utils::Common

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

Methods included from EbsUtils

#build_path, #check_base, #copy_direct, #copy_indirect, #create_tarball, #set_ebs_init, #translate_sff, #untar_tarball

Constructor Details

#initialize(attributes) ⇒ Host

Returns a new instance of Host.

Raises:

  • (ArgumentError)

Instance Attribute Details

#bin_env_fileObject (readonly)

Returns the value of attribute bin_env_file.

#bin_scriptObject (readonly)

Returns the value of attribute bin_script.

#connect_userObject (readonly)

Returns the value of attribute connect_user.

#ctx_scriptObject (readonly)

Returns the value of attribute ctx_script.

#env_fileObject (readonly)

Returns the value of attribute env_file.

#hostnameObject (readonly)

Returns the value of attribute hostname.

#require_env_fileObject (readonly)

Returns the value of attribute require_env_file.

#ssh_portObject (readonly)

Returns the value of attribute ssh_port.

#transfer_optionsObject (readonly)

Returns the value of attribute transfer_options.

#transportObject (readonly)

Returns the value of attribute transport.

#variablesObject

Returns the value of attribute variables.

Instance Method Details

#build_bin_env_file(sudo_user:) ⇒ Object

build_bin_env_file: Creates a file containing the settings for the various environment variables needed by sqlplus, rman and the various e-business utilities

#build_bin_script(sudo_user:) ⇒ Object

build_bin_script: Creates a shell script to run commands from ORACLE_HOME/bin - allows us to get around environments before the clone is finished where the environment files aren't there yet.

#build_context_script(sudo_user:) ⇒ Object

build_context_script: Creates a shell script to derive values from the run or patch context file.

#build_default_init(include_init: true, base_path: nil) ⇒ Object

#call_bin_script(sudo_user:, command:, script:, endpoint:, user_pass: :IGNORE, timeout: 1800, ignore_missing_run_file: false) ⇒ Object

call_bin_script: runs a script in $ORACLE_HOME/bin on the target. Must call db_host.build_bin_script and have derived ORACLE_HOME and ORACLE_SID prior to calling

#check_nfs_export(export_path:) ⇒ Object

#check_tarball_dirs(endpoint:) ⇒ Object

check_tarball_dirs: Verify the directories required to create the tarball(s) exist on the host.

#create_dir_from_path(path:, var_name: "DUMMY") ⇒ Object

create_dir_from_path: Create a directory on the target host if it doesn't already exist.

#create_transport(sudo_user:, include_init: true, base_path: nil) ⇒ Object

create_transport: Create a transport object to the host and include a default_init to source an environment file if it exists.

#exist?(filename) ⇒ Boolean

exist?: Wrapper for the standard transport exist? method to simplify coding requirements

Returns:

  • (Boolean)

#get_context_value(base:, variable:, must_exist:) ⇒ Object

get_context_value: Derives the value of a variables in the patch base or run base context file.

#get_domain_internalObject

get_domain_internal: Returns the result of running "hostname -d" on the host. (ie domain name without host)

#get_fullname_internalObject

get_fullname_internal: Returns the result of running "hostname" on the host. (ie host name with domain)

#get_host_internalObject

get_host_internal: Returns the result of running "hostname -s" on the host. (ie host name without domain)

#get_hostname(host_option:) ⇒ Object

get_hostname: Returns the result of running "hostname -s" on the host. (ie host name without domain)

#get_tmpdirObject

get_tmpdir: Returns the temporary directory on the host

#get_value(variable:) ⇒ Object

get_value: Derives the environment variables value by running the variables get_value method.

#inspect(indent = 0) ⇒ Object

#process_running(owner:, search:) ⇒ Object

#rm(file_dir_name:, remove_children: false) ⇒ Object

rm: Removes the specified file / directory from the host.

#rm_contents(dir_name:) ⇒ Object

#to_s(indent = 0) ⇒ Object