prepareautostart.pp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # == Class: oradb::prepareautostart
  2. #
  3. # prepare autostart of the nodemanager for linux
  4. #
  5. class oradb::prepareautostart
  6. {
  7. case $::kernel {
  8. Linux: {
  9. $execPath = '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:'
  10. Exec {
  11. path => $execPath,
  12. logoutput => true,
  13. }
  14. }
  15. default: {
  16. fail("Unrecognized operating system")
  17. }
  18. }
  19. file { "/etc/init.d/dbora" :
  20. ensure => present,
  21. mode => "0755",
  22. owner => 'root',
  23. content => template("oradb/dbora.erb"),
  24. }
  25. case $operatingsystem {
  26. CentOS, RedHat, OracleLinux: {
  27. exec { "chkconfig dbora":
  28. command => "chkconfig --add dbora",
  29. require => File["/etc/init.d/dbora"],
  30. user => 'root',
  31. unless => "chkconfig | /bin/grep 'dbora'",
  32. }
  33. }
  34. Ubuntu, Debian, SLES:{
  35. exec { "update-rc.d dbora":
  36. command => "update-rc.d dbora defaults",
  37. require => File["/etc/init.d/dbora"],
  38. user => 'root',
  39. unless => "ls /etc/rc3.d/*dbora | /bin/grep 'dbora'",
  40. }
  41. }
  42. default: {
  43. fail("Unrecognized operating system")
  44. }
  45. }
  46. }