fmw_extract_windows.pp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #
  2. # fmw_inst::internal::fmw_extract_windows
  3. #
  4. # Copyright 2015 Oracle. All Rights Reserved
  5. #
  6. define fmw_inst::internal::fmw_extract_windows(
  7. $version = undef,
  8. $middleware_home_dir = undef,
  9. $source_file = undef,
  10. $source_2_file = undef,
  11. $source_3_file = undef,
  12. $create_file_check = undef,
  13. $create_2_file_check = undef,
  14. $create_3_file_check = undef,
  15. $tmp_dir = undef,
  16. )
  17. {
  18. if $version == '10.3.6' {
  19. $path = "C:\\Windows\\system32;C:\\Windows;${middleware_home_dir}\\wlserver_10.3\\server\\adr"
  20. } elsif $version == '12.1.1' {
  21. $path = "C:\\Windows\\system32;C:\\Windows;${middleware_home_dir}\\wlserver_12.1\\server\\adr"
  22. } else {
  23. $path = "C:\\Windows\\system32;C:\\Windows;${middleware_home_dir}\\oracle_common\\adr"
  24. }
  25. exec{ "extract ${title} file 1":
  26. command => "unzip -o ${source_file} -d ${tmp_dir}/${title}",
  27. creates => $create_file_check,
  28. cwd => $tmp_dir,
  29. path => $path,
  30. timeout => 0,
  31. }
  32. if ( $source_2_file != undef ) {
  33. exec{ "extract ${title} file 2":
  34. command => "unzip -o ${source_2_file} -d ${tmp_dir}/${title}",
  35. creates => $create_2_file_check,
  36. cwd => $tmp_dir,
  37. path => $path,
  38. timeout => 0,
  39. require => Exec["extract ${title} file 1"],
  40. }
  41. }
  42. if ( $source_3_file != undef ) {
  43. exec{ "extract ${title} file 3":
  44. command => "unzip -o ${source_3_file} -d ${tmp_dir}/${title}",
  45. creates => $create_3_file_check,
  46. cwd => $tmp_dir,
  47. path => $path,
  48. timeout => 0,
  49. require => Exec["extract ${title} file 2"],
  50. }
  51. }
  52. }