| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260 |
- # == Define: wls::installoim
- #
- # installs Oracle Identity Management addon
- #
- # === Examples
- #
- # $jdkWls11gJDK = 'jdk1.7.0_40'
- # $wls11gVersion = "1036"
- #
- # case $operatingsystem {
- # CentOS, RedHat, OracleLinux, Ubuntu, Debian: {
- # $osMdwHome = "/opt/wls/Middleware11gR1"
- # $osWlHome = "/opt/wls/Middleware11gR1/wlserver_10.3"
- # $oracleHome = "/opt/wls/"
- # $user = "oracle"
- # $group = "dba"
- # }
- # windows: {
- # $osMdwHome = "c:/oracle/wls11g"
- # $osWlHome = "c:/oracle/wls11g/wlserver_10.3"
- # $user = "Administrator"
- # $group = "Administrators"
- # }
- # }
- #
- #
- # Wls::Installoim {
- # mdwHome => $osMdwHome,
- # wlHome => $osWlHome,
- # fullJDKName => $jdkWls11gJDK,
- # user => $user,
- # group => $group,
- # }
- #
- #
- # wls::installoim{'oim11.2':
- # oimFile1 => 'V37472-01_1of2.zip',
- # oimFile2 => 'V37472-01_2of2.zip',
- # }
- #
- #
- define wls::installoim($mdwHome = undef,
- $wlHome = undef,
- $oracleHome = undef,
- $fullJDKName = undef,
- $oimFile1 = undef,
- $oimFile2 = undef,
- $user = 'oracle',
- $group = 'dba',
- $downloadDir = '/install',
- $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
- $oimOracleHome = "${mdwHome}/Oracle_IDM1"
- $oraInventory = "${oracleHome}/oraInventory"
- $oimInstallDir = "linux64"
- $jreLocDir = "/usr/java/${fullJDKName}"
- Exec { path => $execPath,
- user => $user,
- group => $group,
- logoutput => true,
- }
- File {
- ensure => present,
- mode => 0775,
- owner => $user,
- group => $group,
- }
- }
- Solaris: {
- $execPath = "/usr/jdk/${fullJDKName}/bin/amd64:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:"
- $path = $downloadDir
- $oimOracleHome = "${mdwHome}/Oracle_IDM1"
- $oraInventory = "${oracleHome}/oraInventory"
- $oimInstallDir = "intelsolaris"
- $jreLocDir = "/usr/jdk/${fullJDKName}"
- Exec { path => $execPath,
- user => $user,
- group => $group,
- logoutput => true,
- }
- File {
- ensure => present,
- mode => 0775,
- owner => $user,
- group => $group,
- }
- }
- 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
- $oimOracleHome = "${mdwHome}/Oracle_IDM1"
- Exec { path => $execPath,
- }
- File { ensure => present,
- mode => 0777,
- }
- }
- }
- # check if the oim already exists
- $found = oracle_exists( $oimOracleHome )
- if $found == undef {
- $continue = true
- } else {
- if ( $found ) {
- $continue = false
- } else {
- notify {"wls::installoim ${title} ${oimOracleHome} does not exists":}
- $continue = true
- }
- }
- if ( $continue ) {
- if $puppetDownloadMntPoint == undef {
- $mountPoint = "puppet:///modules/wls/"
- } else {
- $mountPoint = $puppetDownloadMntPoint
- }
- wls::utils::orainst{'create oim oraInst':
- oraInventory => $oraInventory,
- group => $group,
- }
- $oimTemplate = "wls/silent_oim.xml.erb"
- file { "${path}/${title}silent_oim.xml":
- ensure => present,
- content => template($oimTemplate),
- require => Wls::Utils::Orainst ['create oim oraInst'],
- }
- # oim file 1 installer zip
- if ! defined(File["${path}/${oimFile1}"]) {
- file { "${path}/${oimFile1}":
- source => "${mountPoint}/${oimFile1}",
- require => File ["${path}/${title}silent_oim.xml"],
- }
- }
- # oim file 2 installer zip
- if ! defined(File["${path}/${oimFile2}"]) {
- file { "${path}/${oimFile2}":
- source => "${mountPoint}/${oimFile2}",
- require => [File ["${path}/${title}silent_oim.xml"],File["${path}/${oimFile1}"]],
- }
- }
- $command = "-silent -response ${path}/${title}silent_oim.xml -waitforcompletion "
- case $operatingsystem {
- CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES: {
- if ! defined(Exec["extract ${oimFile1}"]) {
- exec { "extract ${oimFile1}":
- command => "unzip -o ${path}/${oimFile1} -d ${path}/oim",
- creates => "${path}/oim/Disk1",
- require => [File ["${path}/${oimFile2}"],File ["${path}/${oimFile1}"]],
- }
- }
- if ! defined(Exec["extract ${oimFile2}"]) {
- exec { "extract ${oimFile2}":
- command => "unzip -o ${path}/${oimFile2} -d ${path}/oim",
- creates => "${path}/oim/Disk3",
- require => [File ["${path}/${oimFile2}"],Exec["extract ${oimFile1}"]],
- }
- }
- exec { "install oim ${title}":
- command => "${path}/oim/Disk1/install/${oimInstallDir}/runInstaller ${command} -invPtrLoc /etc/oraInst.loc -ignoreSysPrereqs -jreLoc ${jreLocDir}",
- require => [File["${path}/${title}silent_oim.xml"],Exec["extract ${oimFile1}"],Exec["extract ${oimFile2}"]],
- creates => $oimOracleHome,
- timeout => 0,
- }
- }
- Solaris: {
- if ! defined(Exec["extract ${oimFile1}"]) {
- exec { "extract ${oimFile1}":
- command => "unzip ${path}/${oimFile1} -d ${path}/oim",
- creates => "${path}/oim/Disk1",
- require => [File ["${path}/${oimFile2}"],File ["${path}/${oimFile1}"]],
- }
- }
- if ! defined(Exec["extract ${oimFile2}"]) {
- exec { "extract ${oimFile2}":
- command => "unzip ${path}/${oimFile2} -d ${path}/oim",
- creates => "${path}/oim/Disk3",
- require => [File ["${path}/${oimFile2}"],Exec["extract ${oimFile1}"]],
- }
- }
- exec { "add -d64 oraparam.ini oim":
- command => "sed -e's/JRE_MEMORY_OPTIONS=\" -Xverify:none\"/JRE_MEMORY_OPTIONS=\"-d64 -Xverify:none\"/g' ${path}/oim/Disk1/install/${oimInstallDir}/oraparam.ini > /tmp/oim.tmp && mv /tmp/oim.tmp ${path}/oim/Disk1/install/${oimInstallDir}/oraparam.ini",
- require => [Exec["extract ${oimFile1}"],Exec["extract ${oimFile2}"]],
- }
- exec { "install oim ${title}":
- command => "${path}/oim/Disk1/install/${oimInstallDir}/runInstaller ${command} -invPtrLoc /var/opt/oraInst.loc -ignoreSysPrereqs -jreLoc ${jreLocDir}",
- require => [File["${path}/${title}silent_oim.xml"],Exec["extract ${oimFile1}"],Exec["extract ${oimFile2}"],Exec["add -d64 oraparam.ini oim"]],
- creates => $oimOracleHome,
- timeout => 0,
- }
- }
- windows: {
- if ! defined(Exec["extract ${oimFile1}"]) {
- exec { "extract ${oimFile1}":
- command => "${checkCommand} unzip ${path}/${oimFile1} -d ${path}/oim",
- require => [Registry_Value ["HKEY_LOCAL_MACHINE\\SOFTWARE\\Oracle\\inst_loc"],File ["${path}/${oimFile1}"]],
- creates => "${path}/oim/Disk1",
- }
- }
- if ! defined(Exec["extract ${oimFile2}"]) {
- exec { "extract ${oimFile2}":
- command => "${checkCommand} unzip ${path}/${oimFile2} -d ${path}/oim",
- require => [Exec["extract ${oimFile1}"],File ["${path}/${oimFile2}"]],
- creates => "${path}/oim/Disk3",
- }
- }
- exec {"icacls oim disk ${title}":
- command => "${checkCommand} icacls ${path}\\oim\\* /T /C /grant Administrator:F Administrators:F",
- logoutput => false,
- require => [Exec["extract ${oimFile2}"],Exec["extract ${oimFile1}"]],
- }
- exec { "install oim ${title}":
- command => "${path}\\oim\\Disk1\\setup.exe ${command} -ignoreSysPrereqs -jreLoc C:\\oracle\\${fullJDKName}",
- logoutput => true,
- require => [Exec["icacls oim disk ${title}"],File["${path}/${title}silent_oim.xml"],Exec["extract ${oimFile2}"],Exec["extract ${oimFile1}"]],
- creates => $oimOracleHome,
- timeout => 0,
- }
- }
- }
- }
- }
|