autostartdatabase.pp 843 B

12345678910111213141516171819202122232425262728293031323334
  1. # == Define: orautils::nodemanagerautostart
  2. #
  3. # autostart of the nodemanager for linux
  4. #
  5. define oradb::autostartdatabase( $oracleHome = undef,
  6. $dbName = undef,
  7. $user = 'oracle',
  8. )
  9. {
  10. include oradb::prepareautostart
  11. case $::kernel {
  12. Linux: {
  13. $execPath = '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:'
  14. Exec {
  15. path => $execPath,
  16. logoutput => true,
  17. }
  18. }
  19. default: {
  20. fail("Unrecognized operating system")
  21. }
  22. }
  23. exec { "set dbora ${dbName}:${oracleHome}":
  24. command => "sed -i -e's/:N/:Y/g' /etc/oratab",
  25. unless => "/bin/grep '^${dbName}:${oracleHome}:Y' /etc/oratab",
  26. require => File["/etc/init.d/dbora"],
  27. }
  28. }