Defined Type: orawls::utils::forms11gpatch

Defined in:
manifests/utils/forms11gpatch.pp

Overview

utils::forms11gpatch define

installs FMW 11g forms patch

Parameters:

  • version (Integer) (defaults to: $::orawls::weblogic::version)

    used weblogic software like 1036

  • middleware_home_dir (String) (defaults to: $::orawls::weblogic::middleware_home_dir)

    directory of the Oracle software inside the oracle base directory

  • weblogic_home_dir (String) (defaults to: $::orawls::weblogic::weblogic_home_dir)

    directory of the WebLogic software inside the middleware directory

  • jdk_home_dir (String) (defaults to: $::orawls::weblogic::jdk_home_dir)

    full path to the java home directory like /usr/java/default

  • os_user (String) (defaults to: $::orawls::weblogic::os_user)

    the user name with oracle as default

  • os_group (String) (defaults to: $::orawls::weblogic::os_group)

    the group name with dba as default

  • log_output (Boolean) (defaults to: $::orawls::weblogic::log_output)

    show all the output of the the exec actions

  • download_dir (String) (defaults to: $::orawls::weblogic::download_dir)

    the directory for temporary created files by this class

  • temp_dir (String) (defaults to: lookup('orawls::tmp_dir'))

    override the default temp directory /tmp

  • oracle_base_home_dir (String) (defaults to: undef)

    base directory of the oracle installation, it will contain the default Oracle inventory and the middleware home

  • oracle_home_dir (Optional[String]) (defaults to: undef)

    on what Oracle home to patch should be applied

  • fmw_file1 (String) (defaults to: undef)

    the fmw install file 1

  • puppet_download_mnt_point (String) (defaults to: $::orawls::weblogic::puppet_download_mnt_point)

    the location of the filename like puppet:///modules/orawls/ or /software

  • remote_file (Boolean) (defaults to: $::orawls::weblogic::remote_file)

    to control if the filename is already accessiable on the VM



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'manifests/utils/forms11gpatch.pp', line 21

define orawls::utils::forms11gpatch (
  Integer $version                                        = $::orawls::weblogic::version,
  String $weblogic_home_dir                               = $::orawls::weblogic::weblogic_home_dir,
  String $middleware_home_dir                             = $::orawls::weblogic::middleware_home_dir,
  String $jdk_home_dir                                    = $::orawls::weblogic::jdk_home_dir,
  String $oracle_base_home_dir                            = undef,
  Optional[String] $oracle_home_dir                       = undef, # /opt/oracle/middleware/Oracle_FRM1
  String $fmw_file1                                       = undef,
  String $puppet_download_mnt_point                       = $::orawls::weblogic::puppet_download_mnt_point,
  Boolean $remote_file                                    = $::orawls::weblogic::remote_file,
  String $temp_dir                                        = lookup('orawls::tmp_dir'),
  String $os_user                                         = $::orawls::weblogic::os_user,
  String $os_group                                        = $::orawls::weblogic::os_group,
  String $download_dir                                    = $::orawls::weblogic::download_dir,
  Boolean $log_output                                     = $::orawls::weblogic::log_output,
)
{
  $fmw_product  = 'forms_patch'
  $exec_path = "${jdk_home_dir}/bin:${lookup('orawls::exec_path')}"
  $oraInventory = "${oracle_base_home_dir}/oraInventory"

  case $facts['kernel'] {
    'Linux': {
      $oraInstPath = '/etc'
      case $facts['architecture'] {
        'i386': {
          $installDir = 'linux'
        }
        default: {
          $installDir = 'linux64'
        }
      }
    }
    'SunOS': {
      $oraInstPath = '/var/opt/oracle'
      case $facts['architecture'] {
        'i86pc': {
          $installDir = 'intelsolaris'
        }
        default: {
          $installDir = 'solaris'
        }
      }
    }
    default: {
      fail("Unrecognized operating system ${facts['kernel']}, please use it on a Linux host")
    }

  }

  $fmw_silent_response_file = 'orawls/fmw_silent_forms_patch.rsp.erb'
  if ($oracle_home_dir == undef) {
    $oracleHome = "${middleware_home_dir}/Oracle_FRM1"
  }
  else {
    $oracleHome = $oracle_home_dir
  }

  $createFile1 = "${download_dir}/${fmw_product}/Disk1"
  $total_files = 1


  if (1 == 1 ) {

    file { "${download_dir}/${title}_silent_${fmw_product}.rsp":
      ensure  => present,
      content => template($fmw_silent_response_file),
      mode    => '0775',
      owner   => $os_user,
      group   => $os_group,
      backup  => false,
    }

    # for performance reasons, download and extract or just extract it
    if $remote_file == true {
      file { "${download_dir}/${fmw_file1}":
        ensure => file,
        source => "${puppet_download_mnt_point}/${fmw_file1}",
        mode   => '0775',
        owner  => $os_user,
        group  => $os_group,
        backup => false,
        before => Exec["extract ${fmw_file1}"],
      }
      $disk1_file = "${download_dir}/${fmw_file1}"
    } else {
      $disk1_file = "${puppet_download_mnt_point}/${fmw_file1}"
    }

    exec { "extract ${fmw_file1}":
      command   => "unzip -o ${disk1_file} -d ${download_dir}/${fmw_product}",
      creates   => $createFile1,
      path      => $exec_path,
      user      => $os_user,
      group     => $os_group,
      logoutput => false,
    }

    $command = "-silent -response ${download_dir}/${title}_silent_${fmw_product}.rsp -waitforcompletion"

    exec { "install ${fmw_product} ${title}":
      command     => "/bin/sh -c 'unset DISPLAY;${download_dir}/${fmw_product}/Disk1/install/${installDir}/runInstaller ${command} -invPtrLoc ${oraInstPath}/oraInst.loc -ignoreSysPrereqs -jreLoc ${jdk_home_dir} -Djava.io.tmpdir=${temp_dir}'",
      environment => "TEMP=${temp_dir}",
      timeout     => 0,
      # creates     => "${oracleHome}/OPatch",
      path        => $exec_path,
      user        => $os_user,
      group       => $os_group,
      logoutput   => $log_output,
      require     => [File["${download_dir}/${title}_silent_${fmw_product}.rsp"],
                      Exec["extract ${fmw_file1}"],],
    }
  }
}