| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273 |
- # == Define: wls::installwls
- #
- # Downloads from file folder and install weblogic with a silent install on linux and windows servers
- #
- # === Examples
- #
- #
- # $jdkWls12cJDK = 'jdk1.7.0_25'
- # $wls12cVersion = "1212"
- #
- # $user = "oracle"
- # $group = "dba"
- # $osOracleHome = "/opt/wls"
- # $osMdwHome = "/opt/wls/Middleware11gR1"
- #
- # # set the defaults
- # Wls::Installwls {
- # version => $wls12cVersion,
- # fullJDKName => $jdkWls12cJDK,
- # oracleHome => $osOracleHome,
- # mdwHome => $osMdwHome,
- # user => $user,
- # group => $group,
- # }
- #
- #
- # # install
- # wls::installwls{'wls12c':
- # }
- #
- #
- define wls::installwls( $version = undef,
- $fullJDKName = undef,
- $oracleHome = undef,
- $mdwHome = undef,
- $createUser = true,
- $user = 'oracle',
- $group = 'dba',
- $downloadDir = '/install',
- $puppetDownloadMntPoint = undef,
- ) {
- $wls1212Parameter = "1212"
- $wlsFile1212 = "wls_121200.jar"
- $wls1211Parameter = "1211"
- $wlsFile1211 = "wls1211_generic.jar"
- $wls1036Parameter = "1036"
- $wlsFile1036 = "wls1036_generic.jar"
- $wlsFileDefault = $wlsFile1036
- 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
- $beaHome = $mdwHome
- $oraInventory = "${oracleHome}/oraInventory"
- 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
- $beaHome = $mdwHome
- $oraInventory = "${oracleHome}/oraInventory"
- Exec { path => $execPath,
- user => $user,
- group => $group,
- logoutput => true,
- }
- File {
- ensure => present,
- mode => 0775,
- owner => $user,
- group => $group,
- }
- }
- windows: {
- $path = $downloadDir
- $beaHome = $mdwHome
- $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"
- Exec { path => $execPath,
- }
- File { ensure => present,
- mode => 0555,
- }
- }
- default: {
- fail("Unrecognized operating system")
- }
- }
- # check weblogic version like 12c
- if $version == undef {
- $wlsFile = $wlsFileDefault
- }
- elsif $version == $wls1211Parameter {
- $wlsFile = $wlsFile1211
- }
- elsif $version == $wls1212Parameter {
- $wlsFile = $wlsFile1212
- }
- elsif $version == $wls1036Parameter {
- $wlsFile = $wlsFile1036
- }
- else {
- $wlsFile = $wlsFileDefault
- }
- # check if the wls already exists
- $found = wls_exists($mdwHome)
- if $found == undef {
- $continue = true
- } else {
- if ( $found ) {
- $continue = false
- } else {
- notify {"wls::installwls ${title} ${mdwHome} does not exists":}
- $continue = true
- }
- }
- if ( $continue ) {
- if $puppetDownloadMntPoint == undef {
- $mountPoint = "puppet:///modules/wls/"
- } else {
- $mountPoint = $puppetDownloadMntPoint
- }
- wls::utils::defaultusersfolders{'create wls home':
- oracleHome => $oracleHome,
- oraInventory => $oraInventory,
- createUser => $createUser,
- user => $user,
- group => $group,
- downloadDir => $path,
- }
- # put weblogic generic jar
- file { "wls.jar ${version}":
- path => "${path}/${wlsFile}",
- ensure => file,
- source => "${mountPoint}/${wlsFile}",
- require => Wls::Utils::Defaultusersfolders['create wls home'],
- replace => false,
- backup => false,
- }
- if $version == $wls1212Parameter {
- wls::utils::orainst{'create wls oraInst':
- oraInventory => $oraInventory,
- group => $group,
- }
- # de xml used by the wls installer
- file { "silent.xml ${version}":
- path => "${path}/silent${version}.xml",
- ensure => present,
- replace => 'yes',
- content => template("wls/silent_${wls1212Parameter}.xml.erb"),
- require => [ Wls::Utils::Orainst ['create wls oraInst']],
- }
- $command = "-silent -responseFile ${path}/silent${version}.xml "
- case $operatingsystem {
- CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES: {
- exec { "install wls ${title}":
- command => "java -jar ${path}/${wlsFile} ${command} -invPtrLoc /etc/oraInst.loc -ignoreSysPrereqs",
- require => [Wls::Utils::Defaultusersfolders['create wls home'],File ["silent.xml ${version}"]],
- timeout => 0,
- }
- }
- Solaris: {
- exec { "install wls ${title}":
- command => "java -jar ${path}/${wlsFile} ${command} -invPtrLoc /var/opt/oraInst.loc -ignoreSysPrereqs",
- require => [Wls::Utils::Defaultusersfolders['create wls home'],File ["silent.xml ${version}"]],
- timeout => 0,
- }
- }
-
- windows: {
-
- exec {"icacls wls disk ${title}":
- command => "${checkCommand} icacls ${path}\\${wlsFile} /T /C /grant Administrator:F Administrators:F",
- logoutput => false,
- require => File["wls.jar ${version}"],
- }
-
- exec { "install wls ${title}":
- command => "${checkCommand} java -jar ${path}/${wlsFile} ${command} -ignoreSysPrereqs",
- logoutput => true,
- require => [Wls::Utils::Defaultusersfolders['create wls home'],Exec["icacls wls disk ${title}"],File ["silent.xml ${version}"]],
- timeout => 0,
- }
-
- }
- }
- }
- else {
- # de xml used by the wls installer
- file { "silent.xml ${version}":
- path => "${path}/silent${version}.xml",
- ensure => present,
- replace => 'yes',
- content => template("wls/silent.xml.erb"),
- require => Wls::Utils::Defaultusersfolders['create wls home'],
- }
- $javaCommand = "java -Xmx1024m -jar"
- # install weblogic
- case $operatingsystem {
- CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES: {
- exec { "installwls ${path}/${wlsFile}":
- command => "${javaCommand} ${path}/${wlsFile} -mode=silent -silent_xml=${path}/silent${version}.xml",
- environment => ["JAVA_VENDOR=Sun",
- "JAVA_HOME=/usr/java/${fullJDKName}"],
- logoutput => true,
- require => [Wls::Utils::Defaultusersfolders['create wls home'],File ["wls.jar ${version}"],File ["silent.xml ${version}"]],
- }
- }
- Solaris: {
- exec { "installwls ${path}/${wlsFile}":
- command => "${javaCommand} ${path}/${wlsFile} -mode=silent -silent_xml=${path}/silent${version}.xml",
- environment => ["JAVA_VENDOR=Sun",
- "JAVA_HOME=/usr/jdk/${fullJDKName}"],
- require => [Wls::Utils::Defaultusersfolders['create wls home'],File ["wls.jar ${version}"],File ["silent.xml ${version}"]],
- }
- }
- windows: {
- exec { "installwls ${path}/${wlsFile}":
- command => "${checkCommand} /c ${javaCommand} ${path}/${wlsFile} -mode=silent -silent_xml=${path}/silent${version}.xml",
- environment => ["JAVA_VENDOR=Sun",
- "JAVA_HOME=C:\\oracle\\${fullJDKName}"],
- require => [Wls::Utils::Defaultusersfolders['create wls home'],File ["wls.jar ${version}"],File ["silent.xml ${version}"]],
- }
- }
- }
- }
- }
- }
|