| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- # == Define: wls::installwc
- #
- # installs Oracle Webcenter
- #
- # === Examples
- #
- # $jdkWls11gJDK = 'jdk1.7.0_09'
- # $wls11gVersion = "1036"
- #
- # $osMdwHome = "/opt/wls/Middleware11gR1"
- # $osWlHome = "/opt/wls/Middleware11gR1/wlserver_10.3"
- # $oracleHome = "/opt/wls/"
- # $user = "oracle"
- # $group = "dba"
- #
- #
- # Wls::Installwc {
- # mdwHome => $osMdwHome,
- # wlHome => $osWlHome,
- # fullJDKName => $jdkWls11gJDK,
- # user => $user,
- # group => $group,
- # }
- #
- #
- # wls::installwc{'wcPS6':
- # wcFile => 'ofm_wc_generic_11.1.1.7.0_disk1_1of1.zip',
- # }
- #
- ##
- define wls::installwc( $mdwHome = undef,
- $wlHome = undef,
- $oracleHome = undef,
- $fullJDKName = undef,
- $wcFile = undef,
- $user = 'oracle',
- $group = 'dba',
- $downloadDir = '/install',
- $remoteFile = true,
- $puppetDownloadMntPoint = undef,
- ) {
- case $operatingsystem {
- CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES: {
- $execPath = "/usr/java/${fullJDKName}/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:"
- $path = $downloadDir
- $wcOracleHome = "${mdwHome}/Oracle_WC1"
- $oraInventory = "${oracleHome}/oraInventory"
- $wcInstallDir = "linux64"
- $jreLocDir = "/usr/java/${fullJDKName}"
- Exec { path => $execPath,
- user => $user,
- group => $group,
- logoutput => true,
- }
- File {
- ensure => present,
- mode => 0775,
- owner => $user,
- group => $group,
- backup => false,
- }
- }
- Solaris: {
- $execPath = "/usr/jdk/${fullJDKName}/bin/amd64:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:"
- $path = $downloadDir
- $wcOracleHome = "${mdwHome}/Oracle_WC1"
- $oraInventory = "${oracleHome}/oraInventory"
- $wcInstallDir = "intelsolaris"
- $jreLocDir = "/usr/jdk/${fullJDKName}"
- Exec { path => $execPath,
- user => $user,
- group => $group,
- logoutput => true,
- }
- File {
- ensure => present,
- mode => 0775,
- owner => $user,
- group => $group,
- backup => false,
- }
- }
- windows: {
- $execPath = "C:\\oracle\\${fullJDKName}\\bin;C:\\unxutils\\bin;C:\\unxutils\\usr\\local\\wbin;C:\\Windows\\system32;C:\\Windows"
- $checkCommand = "C:\\Windows\\System32\\cmd.exe /c"
- $path = $downloadDir
- $wcOracleHome = "${mdwHome}/Oracle_WC1"
- Exec { path => $execPath,
- }
- File { ensure => present,
- mode => 0555,
- backup => false,
- }
- }
- }
- # check if the wc already exists
- $found = oracle_exists( $wcOracleHome )
- if $found == undef {
- $continue = true
- } else {
- if ( $found ) {
- $continue = false
- } else {
- notify {"wls::installwc ${title} ${$wcOracleHome} does not exists":}
- $continue = true
- }
- }
- if ( $continue ) {
- if $puppetDownloadMntPoint == undef {
- $mountPoint = "puppet:///modules/wls/"
- } else {
- $mountPoint = $puppetDownloadMntPoint
- }
- wls::utils::orainst{'create wc oraInst':
- oraInventory => $oraInventory,
- group => $group,
- }
- $wcTemplate = "wls/silent_wc.xml.erb"
- # if ! defined(File["${path}/${title}silent_wc.xml"]) {
- file { "${path}/${title}silent_wc.xml":
- ensure => present,
- content => template($wcTemplate),
- require => Wls::Utils::Orainst ['create wc oraInst'],
- }
- # }
- # weblogic generic installer zip
- if $remoteFile == true {
- file { "${path}/${wcFile}":
- source => "${mountPoint}/${wcFile}",
- require => File ["${path}/${title}silent_wc.xml"],
- }
- }
- $command = "-silent -response ${path}/${title}silent_wc.xml -waitforcompletion "
- case $operatingsystem {
- CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES: {
- if $remoteFile == true {
- exec { "extract ${wcFile}":
- command => "unzip ${path}/${wcFile} -d ${path}/wc",
- require => [File ["${path}/${wcFile}"],File ["${path}/${title}silent_wc.xml"]],
- creates => "${path}/wc",
- }
- } else {
- exec { "extract ${wcFile}":
- command => "unzip ${mountPoint}/${wcFile} -d ${path}/wc",
- require => File ["${path}/${title}silent_wc.xml"],
- creates => "${path}/wc",
- }
- }
- exec { "install wc ${title}":
- command => "${path}/wc/Disk1/install/${wcInstallDir}/runInstaller ${command} -invPtrLoc /etc/oraInst.loc -ignoreSysPrereqs -jreLoc ${jreLocDir}",
- require => [File ["${path}/${title}silent_wc.xml"],Exec["extract ${wcFile}"]],
- creates => $wcOracleHome,
- timeout => 0,
- }
- }
- Solaris: {
- if $remoteFile == true {
- exec { "extract ${wcFile}":
- command => "unzip ${path}/${wcFile} -d ${path}/wc",
- require => [File ["${path}/${wcFile}"],File ["${path}/${title}silent_wc.xml"]],
- creates => "${path}/wc",
- }
- } else {
- exec { "extract ${wcFile}":
- command => "unzip ${mountPoint}/${wcFile} -d ${path}/wc",
- require => File ["${path}/${title}silent_wc.xml"],
- creates => "${path}/wc",
- }
- }
- exec { "add -d64 oraparam.ini wc":
- command => "sed -e's/JRE_MEMORY_OPTIONS=\" -Xverify:none\"/JRE_MEMORY_OPTIONS=\"-d64 -Xverify:none\"/g' ${path}/wc/Disk1/install/${wcInstallDir}/oraparam.ini > /tmp/wc.tmp && mv /tmp/wc.tmp ${path}/wc/Disk1/install/${wcInstallDir}/oraparam.ini",
- require => Exec["extract ${wcFile}"],
- }
- exec { "install wc ${title}":
- command => "${path}/wc/Disk1/install/${wcInstallDir}/runInstaller ${command} -invPtrLoc /var/opt/oraInst.loc -ignoreSysPrereqs -jreLoc ${jreLocDir}",
- require => [File ["${path}/${title}silent_wc.xml"],Exec["extract ${wcFile}"],Exec["add -d64 oraparam.ini wc"]],
- creates => $wcOracleHome,
- timeout => 0,
- }
- }
- windows: {
- if $remoteFile == true {
- exec { "extract ${wcFile}":
- command => "${checkCommand} unzip ${path}/${wcFile} -d ${path}/wc",
- require => File ["${path}/${wcFile}"],
- creates => "${path}/wc/Disk1",
- cwd => $path,
- }
- } else {
- exec { "extract ${wcFile}":
- command => "${checkCommand} unzip ${mountPoint}/${wcFile} -d ${path}/wc",
- creates => "${path}/wc/Disk1",
- cwd => $path,
- }
- }
- exec {"icacls wc disk ${title}":
- command => "${checkCommand} icacls ${path}\\wc\\* /T /C /grant Administrator:F Administrators:F",
- logoutput => false,
- require => Exec["extract ${wcFile}"],
- }
- exec { "install wc ${title}":
- command => "${path}\\wc\\Disk1\\setup.exe ${command} -ignoreSysPrereqs -jreLoc C:\\oracle\\${fullJDKName}",
- logoutput => true,
- require => [Exec["icacls wc disk ${title}"],File ["${path}/${title}silent_wc.xml"],Exec["extract ${wcFile}"]],
- creates => $wcOracleHome,
- timeout => 0,
- }
- }
- }
- }
- }
|