nodemanagerautostart.pp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # == Define: orautils::nodemanagerautostart
  2. #
  3. # autostart of the nodemanager for linux
  4. #
  5. define orautils::nodemanagerautostart
  6. (
  7. $version = "1111",
  8. $wlHome = undef,
  9. $user = 'oracle',
  10. $domain = undef,
  11. $logDir = undef,
  12. $jsseEnabled = false,
  13. $customTrust = false,
  14. $trustKeystoreFile = undef,
  15. $trustKeystorePassphrase = undef,
  16. )
  17. {
  18. if ( $version == "1111" or $version == "1211" or $version == "1036" ) {
  19. $nodeMgrPath = "${wlHome}/common/nodemanager"
  20. $nodeMgrBinPath = "${wlHome}/server/bin"
  21. $scriptName = "nodemanager_${$version}"
  22. if $logDir == undef {
  23. $nodeMgrLckFile = "${nodeMgrPath}/nodemanager.log.lck"
  24. } else {
  25. $nodeMgrLckFile = "${logDir}/nodemanager.log.lck"
  26. }
  27. } elsif $version == "1212" {
  28. $nodeMgrPath = "${wlHome}/../user_projects/domains/${domain}/nodemanager"
  29. $nodeMgrBinPath = "${wlHome}/../user_projects/domains/${domain}/bin"
  30. $scriptName = "nodemanager_${domain}"
  31. if $logDir == undef {
  32. $nodeMgrLckFile = "${nodeMgrPath}/nodemanager_${domain}.log.lck"
  33. } else {
  34. $nodeMgrLckFile = "${logDir}/nodemanager_${domain}.log.lck"
  35. }
  36. } else {
  37. $nodeMgrPath = "${wlHome}/common/nodemanager"
  38. $nodeMgrBinPath = "${wlHome}/server/bin"
  39. if $logDir == undef {
  40. $nodeMgrLckFile = "${nodeMgrPath}/nodemanager.log.lck"
  41. } else {
  42. $nodeMgrLckFile = "${logDir}/nodemanager.log.lck"
  43. }
  44. }
  45. case $operatingsystem {
  46. 'CentOS', 'RedHat', 'OracleLinux', 'Ubuntu', 'Debian', 'SLES': {
  47. $execPath = '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:'
  48. Exec {
  49. path => $execPath,
  50. logoutput => true,
  51. }
  52. }
  53. default: {
  54. fail("Unrecognized operating system")
  55. }
  56. }
  57. if $customTrust == true {
  58. $trust_env = "-Dweblogic.security.TrustKeyStore=CustomTrust -Dweblogic.security.CustomTrustKeyStoreFileName=${trustKeystoreFile} -Dweblogic.security.CustomTrustKeystorePassPhrase=${trustKeystorePassphrase}"
  59. } else {
  60. $trust_env = ""
  61. }
  62. file { "/etc/init.d/${scriptName}" :
  63. ensure => present,
  64. mode => "0755",
  65. content => template("orautils/nodemanager.erb"),
  66. }
  67. exec { "chkconfig ${scriptName}":
  68. command => "chkconfig --add ${scriptName}",
  69. require => File["/etc/init.d/${scriptName}"],
  70. user => 'root',
  71. unless => "chkconfig | /bin/grep '${scriptName}'",
  72. }
  73. }