wlsdomain.pp 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. # == Define: wls::wlsdomain
  2. #
  3. # install a new weblogic domain
  4. # support a normal WebLogic Domain , OSB , OSB plus SOA, OSB plus SOA & BPM , ADF , Webcenter, Webcenter + Content + BPM
  5. # use parameter wlsTemplate to control this
  6. #
  7. # in weblogic 12.1.2 the domain creation will also create a nodemanager inside the domain folder
  8. # other version need to manually create a nodemanager.
  9. #
  10. # === Examples
  11. #
  12. # $jdkWls11gJDK = 'jdk1.7.0_09'
  13. #
  14. # $wlsDomainName = "osbDomain"
  15. # $osTemplate = "osb"
  16. # $osTemplate = "standard"
  17. # $adminListenPort = "7001"
  18. # $nodemanagerPort = "5556"
  19. # $address = "localhost"
  20. # $wlsUser = "weblogic"
  21. # $password = "weblogic1"
  22. #
  23. #
  24. # case $operatingsystem {
  25. # centos, redhat, OracleLinux, Ubuntu, debian: {
  26. # $osMdwHome = "/opt/oracle/wls/wls11g"
  27. # $osWlHome = "/opt/oracle/wls/wls11g/wlserver_10.3"
  28. # $user = "oracle"
  29. # $group = "dba"
  30. # }
  31. # windows: {
  32. # $osMdwHome = "c:/oracle/wls/wls11g"
  33. # $osWlHome = "c:/oracle/wls/wls11g/wlserver_10.3"
  34. # $user = "Administrator"
  35. # $group = "Administrators"
  36. # $serviceName = "C_oracle_wls_wls11g_wlserver_10.3"
  37. # }
  38. # }
  39. #
  40. # # set the defaults
  41. #
  42. # Wls::Wlsdomain {
  43. # wlHome => $osWlHome,
  44. # mdwHome => $osMdwHome,
  45. # fullJDKName => $jdkWls11gJDK,
  46. # user => $user,
  47. # group => $group,
  48. # }
  49. #
  50. # # install OSB domain
  51. # wls::wlsdomain{
  52. #
  53. # 'osbDomain':
  54. # wlsTemplate => $osTemplate,
  55. # domain => $wlsDomainName,
  56. # domainPath => $osDomainPath,
  57. # adminListenPort => $adminListenPort,
  58. # nodemanagerPort => $nodemanagerPort,
  59. # }
  60. ##
  61. #
  62. define wls::wlsdomain ($version = '1111',
  63. $wlHome = undef,
  64. $mdwHome = undef,
  65. $fullJDKName = undef,
  66. $wlsTemplate = "standard",
  67. $domain = undef,
  68. $developmentMode = true,
  69. $adminServerName = "AdminServer",
  70. $adminListenAdr = "localhost",
  71. $adminListenPort = '7001',
  72. $nodemanagerPort = '5556',
  73. $java_arguments = {}, # java_arguments = { "ADM" => "...", "OSB" => "...", "SOA" => "...", "BAM" => "...","OAM" => "....","OIM" => "...."}
  74. $wlsUser = undef,
  75. $password = undef,
  76. $user = 'oracle',
  77. $group = 'dba',
  78. $logDir = undef,
  79. $downloadDir = '/install',
  80. $reposDbUrl = undef,
  81. $reposPrefix = undef,
  82. $reposPassword = undef,
  83. $dbUrl = undef,
  84. $sysPassword = undef,
  85. ) {
  86. if $::override_weblogic_domain_folder == undef {
  87. $domainPath = "${mdwHome}/user_projects/domains"
  88. $appPath = "${mdwHome}/user_projects/applications"
  89. } else {
  90. $domainPath = "${::override_weblogic_domain_folder}/domains"
  91. $appPath = "${::override_weblogic_domain_folder}/applications"
  92. }
  93. # check if the domain already exists
  94. $found = domain_exists("${domainPath}/${domain}",$version, $domainPath)
  95. if $found == undef {
  96. $continue = true
  97. } else {
  98. if ( $found ) {
  99. $continue = false
  100. } else {
  101. notify {"wls::wlsdomain ${title} ${domainPath}/${domain} ${version} does not exists":}
  102. $continue = true
  103. }
  104. }
  105. if ( $continue ) {
  106. if $version == "1111" {
  107. $template = "${wlHome}/common/templates/domains/wls.jar"
  108. $templateWS = "${wlHome}/common/templates/applications/wls_webservice.jar"
  109. $templateJaxWS = "${mdwHome}/oracle_common/common/templates/applications/wls_webservice_jaxws.jar"
  110. $templateEM = "${mdwHome}/oracle_common/common/templates/applications/oracle.em_11_1_1_0_0_template.jar"
  111. $templateJRF = "${mdwHome}/oracle_common/common/templates/applications/jrf_template_11.1.1.jar"
  112. $templateApplCore = "${mdwHome}/oracle_common/common/templates/applications/oracle.applcore.model.stub.11.1.1_template.jar"
  113. $templateWSMPM = "${mdwHome}/oracle_common/common/templates/applications/oracle.wsmpm_template_11.1.1.jar"
  114. } elsif $version == "1121" {
  115. $template = "${wlHome}/common/templates/domains/wls.jar"
  116. $templateWS = "${wlHome}/common/templates/applications/wls_webservice.jar"
  117. $templateJaxWS = "${mdwHome}/oracle_common/common/templates/applications/wls_webservice_jaxws.jar"
  118. $templateEM = "${mdwHome}/oracle_common/common/templates/applications/oracle.em_11_1_1_0_0_template.jar"
  119. $templateJRF = "${mdwHome}/oracle_common/common/templates/applications/jrf_template_11.1.1.jar"
  120. $templateApplCore = "${mdwHome}/oracle_common/common/templates/applications/oracle.applcore.model.stub.11.1.1_template.jar"
  121. $templateWSMPM = "${mdwHome}/oracle_common/common/templates/applications/oracle.wsmpm_template_11.1.1.jar"
  122. $templateOIM = "${mdwHome}/Oracle_IDM1/common/templates/applications/oracle.oim_11.1.2.0.0_template.jar"
  123. $templateOAM = "${mdwHome}/Oracle_IDM1/common/templates/applications/oracle.oam_ds_11.1.2.0.0_template.jar"
  124. } elsif $version == "1212" {
  125. $template = "${wlHome}/common/templates/wls/wls.jar"
  126. $templateWS = "${wlHome}/common/templates/wls/wls_webservice.jar"
  127. $templateJaxWS = "${wlHome}/common/templates/wls/wls_webservice_jaxws.jar"
  128. $templateSoapJms = "${wlHome}/common/templates/wls/wls_webservice_soapjms.jar"
  129. $templateCoherence = "${wlHome}/common/templates/wls/wls_coherence.jar"
  130. $templateEM = "${mdwHome}/em/common/templates/wls/oracle.em_wls_template_12.1.2.jar"
  131. $templateJRF = "${mdwHome}/oracle_common/common/templates/wls/oracle.jrf_template_12.1.2.jar"
  132. $templateApplCore = "${mdwHome}/oracle_common/common/templates/applications/oracle.applcore.model.stub.12.1.3_template.jar"
  133. $templateWSMPM = "${mdwHome}/oracle_common/common/templates/wls/oracle.wsmpm_template_12.1.2.jar"
  134. } else {
  135. $template = "${wlHome}/common/templates/domains/wls.jar"
  136. $templateWS = "${wlHome}/common/templates/applications/wls_webservice.jar"
  137. $templateEM = "${mdwHome}/oracle_common/common/templates/applications/oracle.em_11_1_1_0_0_template.jar"
  138. $templateJRF = "${mdwHome}/oracle_common/common/templates/applications/jrf_template_11.1.1.jar"
  139. $templateJaxWS = "${mdwHome}/oracle_common/common/templates/applications/wls_webservice_jaxws.jar"
  140. $templateApplCore = "${mdwHome}/oracle_common/common/templates/applications/oracle.applcore.model.stub.11.1.1_template.jar"
  141. $templateWSMPM = "${mdwHome}/oracle_common/common/templates/applications/oracle.wsmpm_template_11.1.1.jar"
  142. }
  143. $templateOSB = "${mdwHome}/Oracle_OSB1/common/templates/applications/wlsb.jar"
  144. $templateSOAAdapters = "${mdwHome}/Oracle_OSB1/common/templates/applications/oracle.soa.common.adapters_template_11.1.1.jar"
  145. $templateSOA = "${mdwHome}/Oracle_SOA1/common/templates/applications/oracle.soa_template_11.1.1.jar"
  146. $templateBPM = "${mdwHome}/Oracle_SOA1/common/templates/applications/oracle.bpm_template_11.1.1.jar"
  147. $templateBAM = "${mdwHome}/Oracle_SOA1/common/templates/applications/oracle.bam_template_11.1.1.jar"
  148. $templateSpaces = "${mdwHome}/Oracle_WC1/common/templates/applications/oracle.wc_spaces_template_11.1.1.jar"
  149. $templateBPMSpaces = "${mdwHome}/Oracle_WC1/common/templates/applications/oracle.bpm.spaces_template_11.1.1.jar"
  150. $templatePortlets = "${mdwHome}/Oracle_WC1/common/templates/applications/oracle.producer_apps_template_11.1.1.jar"
  151. $templatePagelet = "${mdwHome}/Oracle_WC1/common/templates/applications/oracle.pagelet-producer_template_11.1.1.jar"
  152. $templateDiscussion = "${mdwHome}/Oracle_WC1/common/templates/applications/oracle.owc_discussions_template_11.1.1.jar"
  153. $templateUCM = "${mdwHome}/Oracle_WCC1/common/templates/applications/oracle.ucm.cs_template_11.1.1.jar"
  154. if $wlsTemplate == 'standard' {
  155. $templateFile = "wls/domains/domain.xml.erb"
  156. $wlstPath = "${wlHome}/common/bin"
  157. } elsif $wlsTemplate == 'oim' {
  158. $templateFile = "wls/domains/domain_oim.xml.erb"
  159. $wlstPath = "${mdwHome}/Oracle_IDM1/common/bin"
  160. $oracleHome = "${mdwHome}/Oracle_IDM1"
  161. } elsif $wlsTemplate == 'osb' {
  162. $templateFile = "wls/domains/domain_osb.xml.erb"
  163. $wlstPath = "${mdwHome}/Oracle_OSB1/common/bin"
  164. $oracleHome = "${mdwHome}/Oracle_OSB1"
  165. } elsif $wlsTemplate == 'adf' {
  166. $templateFile = "wls/domains/domain_adf.xml.erb"
  167. $wlstPath = "${mdwHome}/oracle_common/common/bin"
  168. $oracleHome = "${mdwHome}/oracle_common"
  169. } elsif $wlsTemplate == 'osb_soa' or $wlsTemplate == 'osb_soa_bpm' {
  170. $templateFile = "wls/domains/domain_osb_soa_bpm.xml.erb"
  171. $wlstPath = "${mdwHome}/Oracle_SOA1/common/bin"
  172. $oracleHome = "${mdwHome}/Oracle_SOA1"
  173. if $wlsTemplate == 'osb_soa' {
  174. $bpm = false
  175. } elsif $wlsTemplate == 'osb_soa_bpm' {
  176. $bpm = true
  177. }
  178. } elsif $wlsTemplate == 'soa' or $wlsTemplate == 'soa_bpm' {
  179. $templateFile = "wls/domains/domain_soa_bpm.xml.erb"
  180. $wlstPath = "${mdwHome}/Oracle_SOA1/common/bin"
  181. $oracleHome = "${mdwHome}/Oracle_SOA1"
  182. if $wlsTemplate == 'soa' {
  183. $bpm = false
  184. } elsif $wlsTemplate == 'soa_bpm' {
  185. $bpm = true
  186. }
  187. } elsif $wlsTemplate == 'wc' {
  188. $templateFile = "wls/domains/domain_wc.xml.erb"
  189. $wlstPath = "${mdwHome}/Oracle_WC1/common/bin"
  190. $oracleHome = "${mdwHome}/Oracle_WC1"
  191. } elsif $wlsTemplate == 'wc_wcc_bpm' {
  192. $templateFile = "wls/domains/domain_wc_wcc_bpm.xml.erb"
  193. $wlstPath = "${mdwHome}/Oracle_WCC1/common/bin"
  194. $oracleHome = "${mdwHome}/Oracle_WCC1"
  195. } else {
  196. $templateFile = "wls/domains/domain.xml.erb"
  197. $wlstPath = "${wlHome}/common/bin"
  198. }
  199. case $operatingsystem {
  200. CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES: {
  201. $execPath = "/usr/java/${fullJDKName}/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin"
  202. $path = $downloadDir
  203. $JAVA_HOME = "/usr/java/${fullJDKName}"
  204. $nodeMgrMachine = "UnixMachine"
  205. Exec { path => $execPath,
  206. user => $user,
  207. group => $group,
  208. logoutput => true,
  209. }
  210. File {
  211. ensure => present,
  212. replace => true,
  213. mode => 0775,
  214. owner => $user,
  215. group => $group,
  216. backup => false,
  217. }
  218. }
  219. Solaris: {
  220. $execPath = "/usr/jdk/${fullJDKName}/bin/amd64:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin"
  221. $path = $downloadDir
  222. $JAVA_HOME = "/usr/jdk/${fullJDKName}"
  223. $nodeMgrMachine = "UnixMachine"
  224. Exec { path => $execPath,
  225. user => $user,
  226. group => $group,
  227. logoutput => true,
  228. }
  229. File {
  230. ensure => present,
  231. replace => true,
  232. mode => 0775,
  233. owner => $user,
  234. group => $group,
  235. backup => false,
  236. }
  237. }
  238. windows: {
  239. $execPath = "C:\\oracle\\${fullJDKName}\\bin;C:\\unxutils\\bin;C:\\unxutils\\usr\\local\\wbin;C:\\Windows\\system32;C:\\Windows"
  240. $path = $downloadDir
  241. $JAVA_HOME = "c:\\oracle\\${fullJDKName}"
  242. $nodeMgrMachine = "Machine"
  243. $checkCommand = "C:\\Windows\\System32\\cmd.exe /c"
  244. Exec { path => $execPath,
  245. logoutput => true,
  246. }
  247. File { ensure => present,
  248. replace => true,
  249. mode => 0777,
  250. backup => false,
  251. }
  252. }
  253. }
  254. if $logDir == undef {
  255. $adminNodeMgrLogDir = "${domainPath}/${domain}/servers/${adminServerName}/logs"
  256. $osbNodeMgrLogDir = "${domainPath}/${domain}/servers/osb_server1/logs"
  257. $soaNodeMgrLogDir = "${domainPath}/${domain}/servers/soa_server1/logs"
  258. $bamNodeMgrLogDir = "${domainPath}/${domain}/servers/bam_server1/logs"
  259. $oimNodeMgrLogDir = "${domainPath}/${domain}/servers/oim_server1/logs"
  260. $oamNodeMgrLogDir = "${domainPath}/${domain}/servers/oam_server1/logs"
  261. $wcCollaborationNodeMgrLogDir = "${domainPath}/${domain}/servers/WC_Collaboration/logs"
  262. $wcPortletNodeMgrLogDir = "${domainPath}/${domain}/servers/WC_Portlet/logs"
  263. $wcSpacesNodeMgrLogDir = "${domainPath}/${domain}/servers/WC_Spaces/logs"
  264. $umcNodeMgrLogDir = "${domainPath}/${domain}/servers/UCM_server1/logs"
  265. $nodeMgrLogDir = "${domainPath}/${domain}/nodemanager/nodemanager.log"
  266. } else {
  267. $adminNodeMgrLogDir = "${logDir}"
  268. $osbNodeMgrLogDir = "${logDir}"
  269. $soaNodeMgrLogDir = "${logDir}"
  270. $bamNodeMgrLogDir = "${logDir}"
  271. $oimNodeMgrLogDir = "${logDir}"
  272. $oamNodeMgrLogDir = "${logDir}"
  273. $wcCollaborationNodeMgrLogDir = "${logDir}"
  274. $wcPortletNodeMgrLogDir = "${logDir}"
  275. $wcSpacesNodeMgrLogDir = "${logDir}"
  276. $umcNodeMgrLogDir = "${logDir}"
  277. $nodeMgrLogDir = "${logDir}/nodemanager_${domain}.log"
  278. # create all log folders
  279. case $operatingsystem {
  280. CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES, Solaris: {
  281. if ! defined(Exec["create ${logDir} directory"]) {
  282. exec { "create ${logDir} directory":
  283. command => "mkdir -p ${logDir}",
  284. unless => "test -d ${logDir}",
  285. user => 'root',
  286. }
  287. }
  288. }
  289. windows: {
  290. $logDirWin = slash_replace( $logDir )
  291. if ! defined(Exec["create ${logDir} directory"]) {
  292. exec { "create ${logDir} directory":
  293. command => "${checkCommand} mkdir ${logDirWin}",
  294. unless => "${checkCommand} dir ${logDirWin}",
  295. }
  296. }
  297. }
  298. default: {
  299. fail("Unrecognized operating system")
  300. }
  301. }
  302. if ! defined(File["${logDir}"]) {
  303. file { "${logDir}" :
  304. ensure => directory,
  305. recurse => false,
  306. replace => false,
  307. require => Exec["create ${logDir} directory"],
  308. }
  309. }
  310. }
  311. if ( $version == "1212" and $wlsTemplate == 'adf' ) {
  312. # only works for a 12c middleware home
  313. # creates RCU for ADF
  314. if ( $dbUrl == undefined or
  315. $sysPassword == undefined or
  316. $reposPassword == undefined or
  317. $reposPrefix == undefined
  318. ) {
  319. fail("Not all RCU parameters are provided")
  320. }
  321. wls::utils::rcu{ "RCU_12c ${title}":
  322. product => 'adf',
  323. oracleHome => $oracleHome,
  324. fullJDKName => $fullJDKName,
  325. user => $user,
  326. group => $group,
  327. downloadDir => $downloadDir,
  328. action => 'create',
  329. dbUrl => $dbUrl,
  330. sysPassword => $sysPassword,
  331. schemaPrefix => $reposPrefix,
  332. reposPassword => $reposPassword,
  333. notify => File["domain.py ${domain} ${title}"]
  334. }
  335. }
  336. # the domain.py used by the wlst
  337. file { "domain.py ${domain} ${title}":
  338. path => "${path}/domain_${domain}.py",
  339. content => template($templateFile),
  340. }
  341. if $::override_weblogic_domain_folder == undef {
  342. # make the default domain folders
  343. if !defined(File["weblogic_domain_folder"]) {
  344. # check oracle install folder
  345. file { "weblogic_domain_folder":
  346. path => "${mdwHome}/user_projects",
  347. ensure => directory,
  348. recurse => false,
  349. replace => false,
  350. }
  351. }
  352. } else {
  353. # make override domain folders
  354. if !defined(File["weblogic_domain_folder"]) {
  355. # check oracle install folder
  356. file { "weblogic_domain_folder":
  357. path => $::override_weblogic_domain_folder,
  358. ensure => directory,
  359. recurse => false,
  360. replace => false,
  361. }
  362. }
  363. }
  364. if !defined(File[$domainPath]) {
  365. # check oracle install folder
  366. file { $domainPath:
  367. ensure => directory,
  368. recurse => false,
  369. replace => false,
  370. require => File["weblogic_domain_folder"],
  371. }
  372. }
  373. if !defined(File[$appPath]) {
  374. # check oracle install folder
  375. file { $appPath:
  376. ensure => directory,
  377. recurse => false,
  378. replace => false,
  379. require => File["weblogic_domain_folder"],
  380. }
  381. }
  382. case $operatingsystem {
  383. CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES, Solaris: {
  384. exec { "execwlst ${domain} ${title}":
  385. command => "${wlstPath}/wlst.sh ${path}/domain_${domain}.py",
  386. environment => ["JAVA_HOME=${JAVA_HOME}"],
  387. unless => "/usr/bin/test -e ${domainPath}/${domain}",
  388. creates => "${domainPath}/${domain}",
  389. require => [File["domain.py ${domain} ${title}"],
  390. File[$domainPath],
  391. File[$appPath]],
  392. timeout => 0,
  393. }
  394. if ($wlsTemplate == 'oim') {
  395. exec { "execwlst create OPSS store ${domain} ${title}":
  396. command => "${wlstPath}/wlst.sh ${mdwHome}/Oracle_IDM1/common/tools/configureSecurityStore.py -d ${domainPath}/${domain} -m create -c IAM -p ${reposPassword}",
  397. environment => ["JAVA_HOME=${JAVA_HOME}"],
  398. require => Exec["execwlst ${domain} ${title}"],
  399. timeout => 0,
  400. }
  401. exec { "execwlst validate OPSS store ${domain} ${title}":
  402. command => "${wlstPath}/wlst.sh ${mdwHome}/Oracle_IDM1/common/tools/configureSecurityStore.py -d ${domainPath}/${domain} -m validate",
  403. environment => ["JAVA_HOME=${JAVA_HOME}"],
  404. require => [Exec["execwlst ${domain} ${title}"],
  405. Exec["execwlst create OPSS store ${domain} ${title}"]],
  406. timeout => 0,
  407. }
  408. }
  409. case $operatingsystem {
  410. CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES: {
  411. if ( $wlsTemplate == 'osb' or
  412. $wlsTemplate == 'osb_soa' or
  413. $wlsTemplate == 'osb_soa_bpm'){
  414. exec { "setDebugFlagOnFalse ${domain} ${title}":
  415. command => "sed -i -e's/debugFlag=\"true\"/debugFlag=\"false\"/g' ${domainPath}/${domain}/bin/setDomainEnv.sh",
  416. onlyif => "/bin/grep debugFlag=\"true\" ${domainPath}/${domain}/bin/setDomainEnv.sh | /usr/bin/wc -l",
  417. require => Exec["execwlst ${domain} ${title}"],
  418. }
  419. exec { "setOSBDebugFlagOnFalse ${domain} ${title}":
  420. command => "sed -i -e's/ALSB_DEBUG_FLAG=\"true\"/ALSB_DEBUG_FLAG=\"false\"/g' ${domainPath}/${domain}/bin/setDomainEnv.sh",
  421. onlyif => "/bin/grep ALSB_DEBUG_FLAG=\"true\" ${domainPath}/${domain}/bin/setDomainEnv.sh | /usr/bin/wc -l",
  422. require => Exec["setDebugFlagOnFalse ${domain} ${title}"],
  423. }
  424. }
  425. exec { "domain.py ${domain} ${title}":
  426. command => "rm ${path}/domain_${domain}.py",
  427. require => Exec["execwlst ${domain} ${title}"],
  428. }
  429. }
  430. Solaris: {
  431. if ( $wlsTemplate == 'osb' or
  432. $wlsTemplate == 'osb_soa' or
  433. $wlsTemplate == 'osb_soa_bpm'){
  434. exec { "setDebugFlagOnFalse ${domain} ${title}":
  435. command => "sed -e's/debugFlag=\"true\"/debugFlag=\"false\"/g' ${domainPath}/${domain}/bin/setDomainEnv.sh > /tmp/test.tmp && mv /tmp/test.tmp ${domainPath}/${domain}/bin/setDomainEnv.sh",
  436. onlyif => "/bin/grep debugFlag=\"true\" ${domainPath}/${domain}/bin/setDomainEnv.sh | /usr/bin/wc -l",
  437. require => Exec["execwlst ${domain} ${title}"],
  438. }
  439. exec { "setOSBDebugFlagOnFalse ${domain} ${title}":
  440. command => "sed -e's/ALSB_DEBUG_FLAG=\"true\"/ALSB_DEBUG_FLAG=\"false\"/g' ${domainPath}/${domain}/bin/setDomainEnv.sh > /tmp/test2.tmp && mv /tmp/test2.tmp ${domainPath}/${domain}/bin/setDomainEnv.sh",
  441. onlyif => "/bin/grep ALSB_DEBUG_FLAG=\"true\" ${domainPath}/${domain}/bin/setDomainEnv.sh | /usr/bin/wc -l",
  442. require => Exec["setDebugFlagOnFalse ${domain} ${title}"],
  443. }
  444. }
  445. exec { "domain.py ${domain} ${title}":
  446. command => "rm ${path}/domain_${domain}.py",
  447. require => Exec["execwlst ${domain} ${title}"],
  448. }
  449. }
  450. }
  451. }
  452. windows: {
  453. notify{"${domainPath}/${domain} ${title}":}
  454. exec { "execwlst ${domain} ${title}":
  455. command => "C:\\Windows\\System32\\cmd.exe /c ${wlstPath}/wlst.cmd ${path}/domain_${domain}.py",
  456. environment => ["CLASSPATH=${wlHome}\\server\\lib\\weblogic.jar",
  457. "JAVA_HOME=${JAVA_HOME}"],
  458. creates => "${domainPath}/${domain}",
  459. require => [File["domain.py ${domain} ${title}"],
  460. File[$domainPath],
  461. File[$appPath]],
  462. timeout => 0,
  463. }
  464. exec {"icacls domain ${title}":
  465. command => "C:\\Windows\\System32\\cmd.exe /c icacls ${domainPath}/${domain} /T /C /grant Administrator:F Administrators:F",
  466. logoutput => false,
  467. require => Exec["execwlst ${domain} ${title}"],
  468. }
  469. exec { "domain.py ${domain} ${title}":
  470. command => "C:\\Windows\\System32\\cmd.exe /c rm ${path}/domain_${domain}.py",
  471. require => Exec["icacls domain ${title}"],
  472. }
  473. }
  474. }
  475. $nodeMgrHome = "${domainPath}/${domain}/nodemanager"
  476. $listenPort = $nodemanagerPort
  477. # set our 12.1.2 nodemanager properties
  478. if ( $version == "1212" ){
  479. case $operatingsystem {
  480. CentOS, RedHat, OracleLinux, Ubuntu, Debian, SLES, Solaris: {
  481. file { "nodemanager.properties ux 1212 ${title}":
  482. path => "${nodeMgrHome}/nodemanager.properties",
  483. ensure => present,
  484. replace => 'yes',
  485. content => template("wls/nodemgr/nodemanager.properties_1212.erb"),
  486. require => Exec["execwlst ${domain} ${title}"],
  487. }
  488. }
  489. windows: {
  490. file { "nodemanager.properties ux 1212 ${title}":
  491. path => "${nodeMgrHome}/nodemanager.properties",
  492. ensure => present,
  493. replace => 'yes',
  494. content => template("wls/nodemgr/nodemanager.properties_1212.erb"),
  495. require => Exec["execwlst ${domain} ${title}"],
  496. }
  497. exec {"icacls win nodemanager bin ${title}":
  498. command => "${checkCommand} icacls ${wlHome}\\server\\bin\\* /T /C /grant Administrator:F Administrators:F",
  499. logoutput => false,
  500. }
  501. exec {"icacls win nodemanager native ${title}":
  502. command => "${checkCommand} icacls ${wlHome}\\server\\native\\* /T /C /grant Administrator:F Administrators:F",
  503. logoutput => false,
  504. }
  505. exec { "execwlst win nodemanager ${title}":
  506. command => "${domainPath}/${domain}/bin/installNodeMgrSvc.cmd",
  507. environment => ["CLASSPATH=${wlHome}\\server\\lib\\weblogic.jar",
  508. "JAVA_HOME=${JAVA_HOME}"],
  509. cwd => "${domainPath}/${domain}/bin",
  510. require => [Exec ["icacls win nodemanager bin ${title}"],
  511. Exec ["icacls win nodemanager native ${title}"],
  512. File["nodemanager.properties ux 1212 ${title}"]],
  513. logoutput => true,
  514. }
  515. }
  516. }
  517. }
  518. }
  519. }