packdomain.pp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # == Define: wls::packdomain
  2. #
  3. # packs a weblogic domain to the download folder
  4. ##
  5. define wls::packdomain (
  6. $wlHome = undef,
  7. $mdwHome = undef,
  8. $fullJDKName = undef,
  9. $domain = undef,
  10. $user = 'oracle',
  11. $group = 'dba',
  12. $downloadDir = '/install',
  13. ) {
  14. if $::override_weblogic_domain_folder == undef {
  15. $domainPath = "${mdwHome}/user_projects/domains"
  16. } else {
  17. $domainPath = "${::override_weblogic_domain_folder}/domains"
  18. }
  19. case $operatingsystem {
  20. CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES : {
  21. $execPath = "/usr/java/${fullJDKName}/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin"
  22. }
  23. Solaris : {
  24. $execPath = "/usr/jdk/${fullJDKName}/bin/amd64:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin"
  25. }
  26. windows : {
  27. $execPath = "C:\\oracle\\${fullJDKName}\\bin;C:\\unxutils\\bin;C:\\unxutils\\usr\\local\\wbin;C:\\Windows\\system32;C:\\Windows"
  28. $checkCommand = "C:\\Windows\\System32\\cmd.exe /c"
  29. }
  30. }
  31. $packCommand = "-domain=${domainPath}/${domain} -template=${downloadDir}/domain_${domain}.jar -template_name=domain_${domain} -log=${downloadDir}/domain_${domain}.log -log_priority=INFO"
  32. case $operatingsystem {
  33. CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES, Solaris : {
  34. exec { "pack domain ${domain} ${title}":
  35. command => "${wlHome}/common/bin/pack.sh ${packCommand}",
  36. creates => "${downloadDir}/domain_${domain}.jar",
  37. logoutput => true,
  38. user => $user,
  39. group => $group,
  40. }
  41. }
  42. windows : {
  43. exec { "pack domain ${domain} ${title}":
  44. command => "${checkCommand} ${wlHome}/common/bin/pack.cmd ${packCommand}",
  45. creates => "${downloadDir}/domain_${domain}.jar",
  46. logoutput => true,
  47. user => $user,
  48. group => $group,
  49. }
  50. }
  51. }
  52. }