extension_service_bus.pp 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. #
  2. # fmw_domain::extension_service_bus
  3. #
  4. # Copyright 2015 Oracle. All Rights Reserved
  5. #
  6. class fmw_domain::extension_service_bus()
  7. {
  8. require fmw_domain::domain
  9. require fmw_inst::service_bus
  10. if $fmw_domain::soa_suite_install_type != undef {
  11. unless $fmw_domain::soa_suite_install_type in ['BPM', 'SOA Suite'] {
  12. fail('unknown soa_suite_install_type please use BPM|SOA Suite')
  13. }
  14. if $fmw_domain::soa_suite_install_type == 'BPM' {
  15. $bpm_enabled = true
  16. } else {
  17. $bpm_enabled = false
  18. }
  19. } else {
  20. $bpm_enabled = false
  21. }
  22. if $fmw_domain::version in ['12.2.1', '12.2.1.1', '12.2.1.2', '12.1.3'] {
  23. $check = 'osb.em'
  24. if $fmw_domain::version == '12.1.3' {
  25. $wls_em_template = "${fmw_domain::middleware_home_dir}/em/common/templates/wls/oracle.em_wls_template_12.1.3.jar"
  26. $wls_sb_template = "${fmw_domain::middleware_home_dir}/osb/common/templates/wls/oracle.osb_template_12.1.3.jar"
  27. $wls_ws_template = "${fmw_domain::middleware_home_dir}/oracle_common/common/templates/wls/oracle.wls-webservice-template_12.1.3.jar"
  28. }
  29. else {
  30. $wls_em_template = "${fmw_domain::middleware_home_dir}/em/common/templates/wls/oracle.em_wls_template.jar"
  31. $wls_sb_template = "${fmw_domain::middleware_home_dir}/osb/common/templates/wls/oracle.osb_template.jar"
  32. $wls_ws_template = "${fmw_domain::middleware_home_dir}/oracle_common/common/templates/wls/oracle.wls-webservice-template.jar"
  33. }
  34. }
  35. elsif $fmw_domain::version == '10.3.6' {
  36. $check = 'ALSB'
  37. $wls_em_template = "${fmw_domain::middleware_home_dir}/oracle_common/common/templates/applications/oracle.em_11_1_1_0_0_template.jar"
  38. $wls_sb_template = "${fmw_domain::middleware_home_dir}/Oracle_OSB1/common/templates/applications/wlsb.jar"
  39. $wls_ws_template = "${fmw_domain::weblogic_home_dir}/common/templates/applications/wls_webservice.jar"
  40. }
  41. $domain_name = $fmw_domain::domain_name
  42. $adminserver_name = $fmw_domain::adminserver_name
  43. $adminserver_listen_address = $fmw_domain::adminserver_listen_address
  44. $version = $fmw_domain::version
  45. $osb_server_startup_arguments = $fmw_domain::osb_server_startup_arguments
  46. $bam_cluster = $fmw_domain::bam_cluster
  47. $osb_cluster = $fmw_domain::service_bus_cluster
  48. $ess_cluster = $fmw_domain::enterprise_scheduler_cluster
  49. $soa_cluster = $fmw_domain::soa_suite_cluster
  50. $repository_database_url = $fmw_domain::repository_database_url
  51. $repository_prefix = $fmw_domain::repository_prefix
  52. if $::kernel in ['Linux', 'SunOS'] {
  53. $domain_path = "${fmw_domain::domains_dir}/${fmw_domain::domain_name}"
  54. $weblogic_home_dir = $fmw_domain::weblogic_home_dir
  55. $java_home_dir = $fmw_domain::java_home_dir
  56. $domain_dir = $domain_path
  57. $app_dir = "${fmw_domain::apps_dir}/${fmw_domain::domain_name}"
  58. $tmp_dir = $fmw_domain::tmp_dir
  59. file { "${fmw_domain::tmp_dir}/service_bus.py":
  60. ensure => present,
  61. content => template('fmw_domain/domain/extensions/service_bus.py'),
  62. mode => '0755',
  63. owner => $fmw_domain::os_user,
  64. group => $fmw_domain::os_group,
  65. }
  66. if !defined(File[$fmw_domain::apps_dir]) {
  67. file { $fmw_domain::apps_dir:
  68. ensure => directory,
  69. mode => '0755',
  70. owner => $fmw_domain::os_user,
  71. group => $fmw_domain::os_group,
  72. }
  73. }
  74. # add SOA SUITE
  75. fmw_domain_wlst{'WLST add service_bus':
  76. ensure => 'present',
  77. version => $fmw_domain::version,
  78. extension_check => $check,
  79. script_file => "${fmw_domain::tmp_dir}/service_bus.py",
  80. middleware_home_dir => $fmw_domain::middleware_home_dir,
  81. weblogic_home_dir => $fmw_domain::weblogic_home_dir,
  82. java_home_dir => $fmw_domain::java_home_dir,
  83. tmp_dir => $fmw_domain::tmp_dir,
  84. domain_dir => $domain_dir,
  85. repository_password => $fmw_domain::repository_password,
  86. os_user => $fmw_domain::os_user,
  87. require => File["${fmw_domain::tmp_dir}/service_bus.py",$fmw_domain::apps_dir],
  88. }
  89. $path = '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin'
  90. if $fmw_domain::version == '10.3.6' {
  91. exec { 'change debugFlag':
  92. command => "sed -i -e's/debugFlag=\"true\"/debugFlag=\"false\"/g' ${domain_path}/bin/setDomainEnv.sh",
  93. onlyif => "/bin/grep debugFlag=\"true\" ${domain_path}/bin/setDomainEnv.sh | /usr/bin/wc -l",
  94. require => Fmw_domain_wlst['WLST add service_bus'],
  95. path => $path,
  96. user => $fmw_domain::os_user,
  97. group => $fmw_domain::os_group,
  98. }
  99. exec { 'change ALSB_DEBUG_FLAG':
  100. command => "sed -i -e's/ALSB_DEBUG_FLAG=\"true\"/ALSB_DEBUG_FLAG=\"false\"/g' ${domain_path}/bin/setDomainEnv.sh",
  101. onlyif => "/bin/grep ALSB_DEBUG_FLAG=\"true\" ${domain_path}/bin/setDomainEnv.sh | /usr/bin/wc -l",
  102. require => [Fmw_domain_wlst['WLST add service_bus'],Exec['change debugFlag']],
  103. path => $path,
  104. user => $fmw_domain::os_user,
  105. group => $fmw_domain::os_group,
  106. }
  107. exec { 'change DERBY_FLAG':
  108. command => "sed -i -e's/DERBY_FLAG=\"true\"/DERBY_FLAG=\"false\"/g' ${domain_path}/bin/setDomainEnv.sh",
  109. onlyif => "/bin/grep DERBY_FLAG=\"true\" ${domain_path}/bin/setDomainEnv.sh | /usr/bin/wc -l",
  110. require => [Fmw_domain_wlst['WLST add service_bus'],Exec['change debugFlag','change ALSB_DEBUG_FLAG']],
  111. path => $path,
  112. user => $fmw_domain::os_user,
  113. group => $fmw_domain::os_group,
  114. }
  115. }
  116. } elsif $::kernel in ['windows'] {
  117. $domain_path = fmw_domain_replace_slash("${fmw_domain::domains_dir}/${fmw_domain::domain_name}")
  118. $weblogic_home_dir = fmw_domain_replace_slash($fmw_domain::weblogic_home_dir)
  119. $java_home_dir = fmw_domain_replace_slash($fmw_domain::java_home_dir)
  120. $domain_dir = $domain_path
  121. $app_dir = fmw_domain_replace_slash("${fmw_domain::apps_dir}/${fmw_domain::domain_name}")
  122. $tmp_dir = fmw_domain_replace_slash($fmw_domain::tmp_dir)
  123. file { "${fmw_domain::tmp_dir}/service_bus.py":
  124. ensure => present,
  125. content => template('fmw_domain/domain/extensions/service_bus.py'),
  126. source_permissions => ignore,
  127. }
  128. if !defined(File[$fmw_domain::apps_dir]) {
  129. file { $fmw_domain::apps_dir:
  130. ensure => directory,
  131. }
  132. }
  133. # add service bus
  134. fmw_domain_wlst{'WLST add service_bus':
  135. ensure => 'present',
  136. version => $fmw_domain::version,
  137. extension_check => $check,
  138. script_file => "${fmw_domain::tmp_dir}/service_bus.py",
  139. middleware_home_dir => $fmw_domain::middleware_home_dir,
  140. weblogic_home_dir => $fmw_domain::weblogic_home_dir,
  141. java_home_dir => $fmw_domain::java_home_dir,
  142. tmp_dir => $fmw_domain::tmp_dir,
  143. domain_dir => $domain_dir,
  144. repository_password => $fmw_domain::repository_password,
  145. require => File["${fmw_domain::tmp_dir}/service_bus.py",$fmw_domain::apps_dir],
  146. }
  147. if $fmw_domain::version == '10.3.6' {
  148. exec { 'change ALSB_DEBUG_FLAG':
  149. command => "\$c = Get-Content ${domain_path}/bin/setDomainEnv.cmd; \$c | %{\$_ -replace 'set ALSB_DEBUG_FLAG=true','set ALSB_DEBUG_FLAG=false'} | Set-Content ${domain_path}/bin/setDomainEnv.cmd",
  150. onlyif => "if ((Get-Content ${domain_path}/bin/setDomainEnv.cmd) -match 'set ALSB_DEBUG_FLAG=true') { exit 0 } else { exit 1}",
  151. require => Fmw_domain_wlst['WLST add service_bus'],
  152. provider => powershell,
  153. logoutput => true,
  154. }
  155. exec { 'change debugFlag':
  156. command => "\$c = Get-Content ${domain_path}/bin/setDomainEnv.cmd; \$c | %{\$_ -replace 'set debugFlag=true','set debugFlag=false'} | Set-Content ${domain_path}/bin/setDomainEnv.cmd",
  157. onlyif => "if ((Get-Content ${domain_path}/bin/setDomainEnv.cmd) -match 'set debugFlag=true') { exit 0 } else { exit 1}",
  158. require => [Fmw_domain_wlst['WLST add service_bus'],Exec['change ALSB_DEBUG_FLAG']],
  159. provider => powershell,
  160. logoutput => true,
  161. }
  162. exec { 'change DERBY_FLAG':
  163. command => "\$c = Get-Content ${domain_path}/bin/setDomainEnv.cmd; \$c | %{\$_ -replace 'set DERBY_FLAG=true','set DERBY_FLAG=false'} | Set-Content ${domain_path}/bin/setDomainEnv.cmd",
  164. onlyif => "if ((Get-Content ${domain_path}/bin/setDomainEnv.cmd) -match 'set DERBY_FLAG=true') { exit 0 } else { exit 1}",
  165. require => [Fmw_domain_wlst['WLST add service_bus'],Exec['change ALSB_DEBUG_FLAG','change debugFlag']],
  166. provider => powershell,
  167. logoutput => true,
  168. }
  169. }
  170. }
  171. }