Class: MintPress::OracleWeblogic::Installation

Inherits:
Object
  • Object
show all
Includes:
MintLogger, Mixins::Backgroundable, Mixins::Properties, Utils
Defined in:
src/oracle-weblogic/lib/oracle-weblogic/installation.rb

Overview

An oracle weblogic software installation

Since:

  • 0.1.0

Properties (Read/Write)

  • #name ⇒ String (Default Value: self.class.to_s.gsub('::',''))

    Property Attributes
    • defaultself.class.to_s.gsub('::','')
    
    
    73
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 73
    
    property :Name, type: String, default: self.class.to_s.gsub('::','')
  • #host ⇒ MintPress::Infrastructure::Host (Default Value: Proc.new { r = nil if self.get_property(:java) and self.java.host r = self.java.host elsif self.get_property(:weblogic) and self.weblogic.host r = self.weblogic.host elsif self.get_property(:parent) and self.get_property(:parent).respond_to?(:get_property) and self.get_property(:parent).get_property(:host) r = self.parent.host elsif self.get_property(:default_localhost) r = MintPress::Infrastructure::Localhost.new(final_user: self.default_localhost_user) end r })
    If the user specifies transport, default to a new host with it, otherwise try parent... we'll raise exception if none of this stuff ends up resolving... why get_property? because parent may not be defined... getproperty wont exception, but self.xxx will!

    Property Attributes
    • defaultProc.new { r = nil if self.get_property(:java) and self.java.host r = self.java.host elsif self.get_property(:weblogic) and self.weblogic.host r = self.weblogic.host elsif self.get_property(:parent) and self.get_property(:parent).respond_to?(:get_property) and self.get_property(:parent).get_property(:host) r = self.parent.host elsif self.get_property(:default_localhost) r = MintPress::Infrastructure::Localhost.new(final_user: self.default_localhost_user) end r }
    • no_backreftrue
    • paralleltrue
    • disposition:requires
    
    
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 79
    
    property :host, type: MintPress::Infrastructure::Host, default: Proc.new {
      r = nil
      if self.get_property(:java) and self.java.host
          r = self.java.host
      elsif self.get_property(:weblogic) and self.weblogic.host
          r = self.weblogic.host
      elsif self.get_property(:parent) and self.get_property(:parent).respond_to?(:get_property) and self.get_property(:parent).get_property(:host)
        r = self.parent.host
      elsif self.get_property(:default_localhost)
        r = MintPress::Infrastructure::Localhost.new(final_user: self.default_localhost_user)
      end
      r
    }, no_backref: true, parallel: true, disposition: :requires
  • #machine ⇒ MintPress::OracleWeblogic::Machine
    This exists entirely to deal with backrefs overwriting the host attribute - don't remove it yet plz ;) I promise it'll go away eventually ;). --jj

    Property Attributes
    
    
    104
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 104
    
    property :Machine, type: MintPress::OracleWeblogic::Machine
  • #hostname ⇒ String
    Local or remote host using LocalTransport or SSHTransport

    Property Attributes
    
    
    107
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 107
    
    property :hostname, type: String
  • #product ⇒ String (Default Value: 'wls')
    This is the product name generated by OUI within the status xml - it is used for idempotence

    Property Attributes
    • default'wls'
    • requiredtrue
    
    
    110
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 110
    
    property :product, type: String, default: 'wls', required: true
  • #java ⇒ MintPress::OracleJava::Installation
    The java installation to use for this installation

    Property Attributes
    • disposition:requires
    • no_backreftrue
    
    
    113
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 113
    
    property :java, type: MintPress::OracleJava::Installation, disposition: :requires, no_backref: true
  • #weblogic ⇒ MintPress::OracleWeblogic::Installation
    The weblogic or fmw infrastructure installation to augment with this installation - this is normally used when installing additional FMW components, for example if you are installing soa, you would set this to your fmwinfrastructure installation.

    Property Attributes
    • disposition:requires
    • no_backreftrue
    • alias:fmwinfra
    
    
    117
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 117
    
    property :weblogic, type: MintPress::OracleWeblogic::Installation, disposition: :requires, no_backref: true, alias: :fmwinfra
  • #java_home ⇒ Pathname (Default Value: Proc.new { r = nil if self.get_property(:java).is_a?(MintPress::OracleJava::Installation) r = self.java.java_home elsif self.get_property(:weblogic).is_a?(MintPress::OracleWeblogic::Installation) r = self.weblogic.java_home end r })
    Java Home location - this can come from either a "real" java home folder, from a java installation, or from another weblogic- the advantage of the latter two is, of course, dependency stuff Also, this is completley bollocksed for some reason.....

    Property Attributes
    • fromString
    • defaultProc.new { r = nil if self.get_property(:java).is_a?(MintPress::OracleJava::Installation) r = self.java.java_home elsif self.get_property(:weblogic).is_a?(MintPress::OracleWeblogic::Installation) r = self.weblogic.java_home end r }
    • requiredtrue
    
    
    123
    124
    125
    126
    127
    128
    129
    130
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 123
    
    property :java_home, type: Pathname, from: String, default: Proc.new {
    r = nil
    if self.get_property(:java).is_a?(MintPress::OracleJava::Installation)
      r = self.java.java_home
    elsif self.get_property(:weblogic).is_a?(MintPress::OracleWeblogic::Installation)
      r = self.weblogic.java_home
    end
    r }, required: true
  • #fmw_home ⇒ Pathname (Default Value: Proc.new { self.get_property(:weblogic, disable_proc: true).get_property(:fmw_home, disable_proc: true) })
    FMW Home location - this can come directly, or from a weblogic installation Note that the target weblogic is NOT allowed to be a proc!

    Property Attributes
    • fromString
    • defaultProc.new { self.get_property(:weblogic, disable_proc: true).get_property(:fmw_home, disable_proc: true) }
    • requiredtrue
    
    
    134
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 134
    
    property :fmw_home, type: Pathname, from: String, default: Proc.new { self.get_property(:weblogic, disable_proc: true).get_property(:fmw_home, disable_proc: true) }, required: true
  • #version ⇒ String (Default Value: Proc.new { r = nil if self.get_property(:weblogic, disable_proc: true) r = self.get_property(:weblogic, disable_proc: true).get_property(:version) elsif self.get_property(:domain) r = self.domain.version end r })
    The version of the software to install. If there is a parent installation, or a domain, the version can be taken from those instead.

    Property Attributes
    • requiredtrue
    • defaultProc.new { r = nil if self.get_property(:weblogic, disable_proc: true) r = self.get_property(:weblogic, disable_proc: true).get_property(:version) elsif self.get_property(:domain) r = self.domain.version end r }
    
    
    137
    138
    139
    140
    141
    142
    143
    144
    145
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 137
    
    property :version, type: String, required: true, default: Proc.new {
      r = nil
      if self.get_property(:weblogic, disable_proc: true)
        r = self.get_property(:weblogic, disable_proc: true).get_property(:version)
      elsif self.get_property(:domain)
        r = self.domain.version
      end
      r
    }
  • #inventory_location ⇒ Pathname (Default Value: Proc.new { self.weblogic.inventory_location })
    Location of oraInvetory. If there is a parent installation, this will be taken from there.

    Property Attributes
    • fromString
    • defaultProc.new { self.weblogic.inventory_location }
    
    
    148
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 148
    
    property :inventory_location, type: Pathname, from: String, default: Proc.new { self.weblogic.inventory_location }
  • #inventory_component ⇒ String (Default Value: 'oracle.wls.core.app.server')
    Component used by OUI for this product - this is used for idempotence, and should generally only be overridden by child classes which are installing differnet products

    Property Attributes
    • requiredtrue
    • default'oracle.wls.core.app.server'
    
    
    152
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 152
    
    property :inventory_component, type: String, required: true, default: 'oracle.wls.core.app.server'
  • #install_type ⇒ String (Default Value: 'WebLogic Server')
    The install type passed to OUI. This should generally only be overridden by child classes which are installing differnet products

    Property Attributes
    • requiredtrue
    • default'WebLogic Server'
    
    
    156
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 156
    
    property :install_type, type: String, required: true, default: 'WebLogic Server'
  • #owner ⇒ String
    The OS owner of these files. This will default to the current user

    Property Attributes
    • requiredfalse
    
    
    159
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 159
    
    property :owner, type: String, required: false
  • #group ⇒ String
    The OS group of these files. This will default to the primary group of the current user.

    Property Attributes
    • requiredfalse
    
    
    162
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 162
    
    property :group, type: String, required: false
  • #software_stage ⇒ Pathname
    Location of the installer binary

    Property Attributes
    • fromString
    • alias:stage
    
    
    165
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 165
    
    property :software_stage, type: Pathname, from: String, alias: :stage
  • #patches ⇒ Hash of ⇒ [ MintPress::OracleWeblogic::Patch ]
    An ordered list of patches to apply

    Property Attributes
    
    
    168
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 168
    
    property :patches, type: [ MintPress::OracleWeblogic::Patch ], hash: true
  • #opatch_autoupdate ⇒ [TrueClass, FalseClass] (Default Value: false)
    Automatically update OPatch

    Property Attributes
    • defaultfalse
    
    
    171
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 171
    
    property :opatch_autoupdate, type: [TrueClass, FalseClass], default: false
  • #opatch_autoupdate_file ⇒ Pathname
    Location of OPatch file to autoupdate

    Property Attributes
    • fromString
    
    
    174
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 174
    
    property :opatch_autoupdate_file, type: Pathname, from: String
  • #ignore_sysprereqs ⇒ [TrueClass, FalseClass] (Default Value: true)
    Should we ignore system prerequisite checks? This is particularly useful on modern systems which have a lot of ram, but no swap, a valid configuration in linux but does not match the old unix heritage of this software

    Property Attributes
    • defaulttrue
    
    
    179
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 179
    
    property :ignore_sysprereqs, type: [TrueClass, FalseClass], default: true
  • #optional_args ⇒ String (Default Value: "")
    Optional arguments to pass to the installer binary

    Property Attributes
    • default""
    
    
    182
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 182
    
    property :optional_args, type: String, default: ""
  • #target_tmp_dir ⇒ Pathname (Default Value: Proc.new { r = nil if self.fmw_home.nil? r = Pathname.new("/tmp") else r = Pathname.new(::File.join(self.fmw_home.to_s,'../tmp')) end r })
    Single quotes for late binding

    Property Attributes
    • defaultProc.new { r = nil if self.fmw_home.nil? r = Pathname.new("/tmp") else r = Pathname.new(::File.join(self.fmw_home.to_s,'../tmp')) end r }
    
    
    185
    186
    187
    188
    189
    190
    191
    192
    193
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 185
    
    property :target_tmp_dir, type: Pathname, default: Proc.new {
      r = nil
      if self.fmw_home.nil?
        r = Pathname.new("/tmp")
      else
        r = Pathname.new(::File.join(self.fmw_home.to_s,'../tmp'))
      end
      r
    }
  • #patchsets ⇒ Hash of ⇒ MintPress::OracleWeblogic::PatchSet
    The set of patchsets to apply to this product. THis is, again, ordered, however since patchsets have dependencies this order is not guarenteed

    Property Attributes
    
    
    197
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 197
    
    property :patchsets, type: MintPress::OracleWeblogic::PatchSet, hash: true
  • #execute_before ⇒ String (Default Value: nil)
    'Accepts commands or script that will be executed before installation.'

    Property Attributes
    • defaultnil
    
    
    211
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 211
    
    property :execute_before, type: String, default: nil, description: 'Accepts commands or script that will be executed before installation.'
  • #execute_after ⇒ String (Default Value: nil)
    'Accepts commands or script that will be executed after installation.'

    Property Attributes
    • defaultnil
    
    
    212
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 212
    
    property :execute_after, type: String, default: nil, description: 'Accepts commands or script that will be executed after installation.'
  • #save_response_file ⇒ String (Default Value: nil)
    'MintPress will save the response file specified by this path, e.g. /tmp/resp.rsp. Default value is nil. The file will always be saved on the target system'

    Property Attributes
    • defaultnil
    
    
    213
    # File 'src/oracle-weblogic/lib/oracle-weblogic/installation.rb', line 213
    
    property :save_response_file, type: String, default: nil, description: 'MintPress will save the response file specified by this path, e.g. /tmp/resp.rsp. Default value is nil. The file will always be saved on the target system'

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

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::Backgroundable

#backgroundable, #wait_for_background_tasks

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 included from Utils

#activate_list, #already_traversed, #announce_self, #bean_type, #build_activate_list, #clear_property_sheet_cache, #create_generic, #create_mbean_components, #delete, #destroy_generic, #execute_script, #fast_ls_all, #fast_ls_folder, #fast_ls_object, #fast_ls_object_map, #find_cluster, #find_runtime_path_in_rest, #find_server, #full_url, #get, #get_all_self_names, #get_identity, #get_local_wlst_session, #get_matching_self_names, #get_property_from_target_rest, #get_property_from_target_wlst, #get_property_from_target_wlst_impl, #get_property_sheet, #get_rest_item, #get_rest_url_for_parent, #get_rest_url_for_self, #get_servers, #get_servers_rest, #get_servers_wlst, #get_wl_home, #globmatch?, #handle_create, #http_delete, #http_get, #http_post, #http_put, included, #invalidate_session, #is_meta_object?, #longclass, #massage_return, #mbean_components, #mbean_exists?, #mbean_lookup, #mbean_properties, #mbean_to_hash, #meta_list?, #my_short_name, #perform_method_generic, #perform_runtime_call_generic_rest, #perform_runtime_method_generic, #post, #raise_http_exception, #remove, #request_headers, #reset_activate_list, #rest_activate_change, #rest_create_generic, #rest_create_mbean_components, #rest_destroy_self, #rest_edit_url, #rest_has_changes, #rest_idempotent_create, #rest_locked, #rest_nonedit_url, #rest_start_change, #rest_undo_change, #runtime_introspection, #shortclass, #start_with_async, #state_with_net_ping, #stop_with_async, #to_nested, #wlst_cd_to, #wlst_create_generic, #wlst_destroy_self, #wlst_find_object, #wlst_find_parent_object, #wlst_generic_mbean_update_all, #wlst_idempotent_create, #wlst_update_mbean

Constructor Details

#initialize(opts = {}) ⇒ MintPress::OracleWeblogic::Installation

The constructor

Examples:

Install Weblogic

host1=MintPress::Infrastructure::Host.new('appserver1.mintpress.io', connect_user: 'mintpress', final_user: 'oracle')

java_opts={
  version: '1.8.0_172',
  java_home: "/oracle/app/java",
  owner: 'oracle',
  group: 'oinstall',
  software_stage: '/oracle/stage/jdk/jdk-8u172-linux-x64.tar.gz'
}

java_installation=MintPress::OracleJava::Installation.new(java_opts)
java_installation.install

wls_install_opts={
   version: '12.2.1.3',
   java: java_installation,
   java_home: java_opts[:java_home],
   fmw_home: "/oracle/app/#{product}/fmw",
   inventory_location: "/oracle/app/#{product}/oraInventory",
   software_stage: '/oracle/stage/wls/12.2.1.3/fmw_12.2.1.3.0_wls.jar',
   opatch_autoupdate_file: '/oracle/stage/OPatch/p28186730_139400_Generic.zip'
}

wls_installation=MintPress::OracleWeblogic::Installation.new(wls_install_opts)

Raises:

  • (ArgumentError)
    invalid argument passed into constructor

Since:

  • 0.1.0

Instance Method Details

#background_installObject

Perform install in the background

Since:

  • 0.1.0

#check_hostObject

Since:

  • 0.1.0

#clobbervoid

This method returns an undefined value.

Clobber or delete/remove an installation of the software on the target version if exists

Since:

  • 0.1.0

#clobber_inventoryvoid

This method returns an undefined value.

Clobber or delete/remove the Oracle Inventory of the software on the target version if exists

Since:

  • 0.1.0

#do_install(install_command:, basedir: __dir__, response_file_erb: nil, inventory_file_erb: nil, upgrade: false) ⇒ void

This method returns an undefined value.

Private method to perform the install of the software on the target version if it does not already exists

Since:

  • 0.1.0

#empty_mbean?(empty_stack: []) ⇒ Boolean

Always return true for empty_mbean for installations - it absoutely has no mbeans!

Returns:

  • (Boolean)

Since:

  • 0.1.0

#exists?TrueClass, FalseClass

Determines whether the software has already been installed and exists on the target

Returns:

  • (TrueClass, FalseClass)
    whether the software exists on the target

Since:

  • 0.1.0

#get_instance_variablesHash

Obtain a Hash for all class instance variables that are passed into the installation templates (ERBs)

Returns:

Since:

  • 0.1.0

#get_property_from_target(name) ⇒ Object

Grab properties from the remote - thinking specifically version/java_home/fmw_home

Since:

  • 0.1.0

#harvestvoid

This method returns an undefined value.

Harvest the Installation configuration from the target

Since:

  • 0.1.0

#harvest_patchesvoid

This method returns an undefined value.

Harvest the patches from the Installation configuration from the target

Since:

  • 0.1.0

#installvoid

This method returns an undefined value.

Perform the install of the software on the target version if it does not already exist

Since:

  • 0.1.0

#installed?Boolean

Synonym ot make rspec happy

Returns:

  • (Boolean)

Since:

  • 0.1.0

#installed_fmw_homeObject

returns the fmw_home from #fmw_home/inventory/Components/#inventory_component/##remote_version/context.xml using the VAL of PROD_HOME attribute

Since:

  • 0.1.0

#installed_java_homeObject

returns the java_home from #fmw_home/inventory/Components/#inventory_component/##remote_version/context.xml using the VAL of JAVA_HOME_LOCATION attribute

Since:

  • 0.1.0

#installed_versionInteger

Determines the version installed on the target system based on the inventory component ID specified in :inventory_component The file [ #fmw_home/inventory/ContentsXML/comps.xml ] if exists, will be searched for the :inventory_component and version value returned

Returns:

  • (Integer)
    the numeric version of the software installed on the target

Since:

  • 0.1.0

#remote_versionObject

returns the remote_version as-is: 12.2.1.4.0

Since:

  • 0.1.0

#uninstallvoid

TODO:
Add support for uninstallation or removal of Oracle Java software. Method not implemented

This method returns an undefined value.

Perform an uninstall of the software on the target version if exists

Since:

  • 0.1.0

#update_opatchObject

Since:

  • 0.1.0

#version_numericInteger

Left justified numeric version of the software in order to perform numeric equivalence comparisons

Examples:

wls_installation.version_numeric => 1221300

Returns:

  • (Integer)
    The left justified numeric version

Since:

  • 0.1.0