| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- # == Define: wls::storeuserconfig
- #
- # generic storeuserconfig wlst script
- #
- #
- # === Examples
- #
- #
- # wls::storeuserconfig{
- # 'adminServer':
- # wlHome => "/opt/oracle/wls/wls11g/wlserver_10.3",
- # fullJDKName => $jdkWls11gJDK,
- # domain => 'osbSoaDomain',
- # address => "localhost",
- # wlsUser => "weblogic",
- # password => "weblogic1",
- # port => "7001",
- # user => 'oracle',
- # group => 'dba',
- # userConfigDir => '/home/oracle',
- # downloadDir => "/install/",
- # }
- #
- #
- #
- define wls::storeuserconfig( $wlHome = undef,
- $fullJDKName = undef,
- $domain = undef,
- $address = "localhost",
- $port = '7001',
- $wlsUser = "weblogic",
- $password = "weblogic1",
- $user = 'oracle',
- $group = 'dba',
- $userConfigDir = '/home/oracle',
- $downloadDir = '/install/',
- $logOutput = false,
- ) {
- $javaCommand = "java -Dweblogic.management.confirmKeyfileCreation=true -Dweblogic.security.SSL.ignoreHostnameVerification=true weblogic.WLST -skipWLSModuleScanning "
- 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
- $JAVA_HOME = "/usr/java/${fullJDKName}"
- Exec { path => $execPath,
- user => $user,
- group => $group,
- logoutput => $logOutput,
- }
- File {
- ensure => present,
- replace => 'yes',
- mode => 0555,
- 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
- $JAVA_HOME = "/usr/jdk/${fullJDKName}"
- Exec { path => $execPath,
- user => $user,
- group => $group,
- logoutput => $logOutput,
- }
- File {
- ensure => present,
- replace => 'yes',
- mode => 0555,
- owner => $user,
- group => $group,
- }
- }
- windows: {
- $execPath = "C:\\oracle\\${fullJDKName}\\bin;C:\\unxutils\\bin;C:\\unxutils\\usr\\local\\wbin;C:\\Windows\\system32;C:\\Windows"
- $path = $downloadDir
- $JAVA_HOME = "c:\\oracle\\${fullJDKName}"
- Exec { path => $execPath,
- logoutput => $logOutput,
- }
- File { ensure => present,
- replace => 'yes',
- mode => 0777,
- }
- }
- }
- # the py script used by the wlst
- file { "${path}/${title}storeUserConfig.py":
- path => "${path}/${title}storeUserConfig.py",
- content => template("wls/wlst/storeUserConfig.py.erb"),
- }
- case $operatingsystem {
- CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES, Solaris: {
- exec { "execwlst ${title}storeUserConfig.py":
- command => "${javaCommand} ${path}/${title}storeUserConfig.py ${password}",
- environment => ["CLASSPATH=${wlHome}/server/lib/weblogic.jar",
- "JAVA_HOME=${JAVA_HOME}"],
- unless => "ls -l ${userConfigDir}/${user}-${$domain}-WebLogicConfig.properties",
- require => File["${path}/${title}storeUserConfig.py"],
- }
- }
- windows: {
- exec { "execwlst ${title}storeUserConfig.py":
- command => "C:\\Windows\\System32\\cmd.exe /c ${javaCommand} ${path}/${title}storeUserConfig.py ${password}",
- unless => "C:\\Windows\\System32\\cmd.exe /c dir ${userConfigDir}/${user}-${domain}-WebLogicConfig.properties",
- require => File["${path}/${title}storeUserConfig.py"],
- environment => ["CLASSPATH=${wlHome}\\server\\lib\\weblogic.jar",
- "JAVA_HOME=${JAVA_HOME}"],
- }
- }
- }
- }
|