orainst.pp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # == Define: wls::utils::orainst
  2. #
  3. # creates oraInst.loc
  4. #
  5. #
  6. ##
  7. define wls::utils::orainst( $oraInventory = undef,
  8. $group = 'dba',
  9. ) {
  10. case $operatingsystem {
  11. CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES: {
  12. $oraInstPath = "/etc"
  13. }
  14. Solaris: {
  15. $oraInstPath = "/var/opt"
  16. }
  17. windows: {
  18. $oraInstPath = "C:\\Program Files\\Oracle\\Inventory"
  19. }
  20. }
  21. case $operatingsystem {
  22. CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES, Solaris: {
  23. if ! defined(File["${oraInstPath}/oraInst.loc"]) {
  24. file { "${oraInstPath}/oraInst.loc":
  25. ensure => present,
  26. content => template("wls/utils/oraInst.loc.erb"),
  27. }
  28. }
  29. }
  30. windows: {
  31. if ! defined(Registry_Key["HKEY_LOCAL_MACHINE\\SOFTWARE\\Oracle"]) {
  32. registry_key { "HKEY_LOCAL_MACHINE\\SOFTWARE\\Oracle":
  33. ensure => present,
  34. }
  35. }
  36. if ! defined(Registry_Value ["HKEY_LOCAL_MACHINE\\SOFTWARE\\Oracle\\inst_loc"]) {
  37. registry_value { "HKEY_LOCAL_MACHINE\\SOFTWARE\\Oracle\\inst_loc":
  38. type => string,
  39. data => $oraInstPath,
  40. require => Registry_Key["HKEY_LOCAL_MACHINE\\SOFTWARE\\Oracle"],
  41. }
  42. }
  43. }
  44. }
  45. }