domain_wc.xml.erb 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. WLHOME='<%= @wlHome %>'
  2. DOMAIN_PATH='<%= @domainPath %>/<%= @domain %>'
  3. DOMAIN='<%= @domain %>'
  4. APP_PATH='<%= @appPath %>/<%= @domain %>'
  5. DEVELOPMENT_MODE=<%= @developmentMode %>
  6. WEBLOGIC_VERSION='<%= @version %>'
  7. ADMIN_SERVER='<%= @adminServerName %>'
  8. ADMIN_USER='<%= @wlsUser %>'
  9. ADMIN_PASSWORD='<%= @password %>'
  10. JAVA_HOME='<%= @JAVA_HOME %>'
  11. ADM_JAVA_ARGUMENTS='-XX:PermSize=256m -XX:MaxPermSize=512m -Xms1024m -Xmx1024m -Dweblogic.Stdout=<%= @adminNodeMgrLogDir %>/<%= @adminServerName %>.out -Dweblogic.Stderr=<%= @adminNodeMgrLogDir %>/<%= @adminServerName %>_err.out'
  12. WC_COLLABORATION_JAVA_ARGUMENTS='-XX:PermSize=512m -XX:MaxPermSize=512m -Xms1024m -Xmx1024m -Dweblogic.Stdout=<%= @wcCollaborationNodeMgrLogDir %>/wc_collaboration.out -Dweblogic.Stderr=<%= @wcCollaborationNodeMgrLogDir %>/wc_collaboration_err.out'
  13. WC_PORTLET_JAVA_ARGUMENTS='-XX:PermSize=512m -XX:MaxPermSize=512m -Xms1024m -Xmx1024m -Dweblogic.Stdout=<%= @wcPortletNodeMgrLogDir %>/wc_portlet.out -Dweblogic.Stderr=<%= @wcPortletNodeMgrLogDir %>/wc_portlet_err.out'
  14. WC_SPACES_JAVA_ARGUMENTS='-XX:PermSize=512m -XX:MaxPermSize=512m -Xms1024m -Xmx1024m -Dweblogic.Stdout=<%= @wcSpacesNodeMgrLogDir %>/wc_spaces.out -Dweblogic.Stderr=<%= @wcSpacesNodeMgrLogDir %>/wc_spaces_err.out'
  15. WC_REPOS_DBURL='<%= @reposDbUrl %>'
  16. WC_REPOS_DBUSER_PREFIX='<%= @reposPrefix %>'
  17. WC_REPOS_DBPASSWORD='<%= @reposPassword %>'
  18. def createBootPropertiesFile(directoryPath,fileName, username, password):
  19. adminserverDir = File(directoryPath)
  20. bool = adminserverDir.mkdirs()
  21. fileNew=open(directoryPath + '/'+fileName, 'w')
  22. fileNew.write('username=%s\n' % username)
  23. fileNew.write('password=%s\n' % password)
  24. fileNew.flush()
  25. fileNew.close()
  26. print('Start...wls domain with template <%= @template %>')
  27. readTemplate('<%= @template %>')
  28. print('Set crossdomain')
  29. create('base_domain','SecurityConfiguration')
  30. cd('/SecurityConfiguration/base_domain')
  31. set('CrossDomainSecurityEnabled',true)
  32. cd('/')
  33. print('Set domain log')
  34. create('base_domain','Log')
  35. cd('/Log/base_domain')
  36. set('FileName','<%= @adminNodeMgrLogDir %>/'+DOMAIN+'.log')
  37. set('FileCount',10)
  38. set('FileMinSize',5000)
  39. set('RotationType','byTime')
  40. set('FileTimeSpan',24)
  41. cd('/')
  42. create('LocalMachine', '<%= @nodeMgrMachine %>')
  43. cd('/Servers/AdminServer')
  44. # name of adminserver
  45. set('Name',ADMIN_SERVER )
  46. cd('/Servers/'+ADMIN_SERVER)
  47. # address and port
  48. #set('ListenAddress','<%= @adminListenAdr %>')
  49. set('ListenPort',<%= @adminListenPort %>)
  50. setOption( "AppDir", APP_PATH )
  51. create(ADMIN_SERVER,'ServerStart')
  52. cd('ServerStart/'+ADMIN_SERVER)
  53. set('Arguments', ADM_JAVA_ARGUMENTS)
  54. set('JavaVendor','Sun')
  55. set('JavaHome', JAVA_HOME)
  56. cd('/Server/'+ADMIN_SERVER)
  57. create(ADMIN_SERVER,'SSL')
  58. cd('SSL/'+ADMIN_SERVER)
  59. set('Enabled', 'False')
  60. set('HostNameVerificationIgnored', 'True')
  61. cd('/Server/'+ADMIN_SERVER)
  62. create(ADMIN_SERVER,'Log')
  63. cd('/Server/'+ADMIN_SERVER+'/Log/'+ADMIN_SERVER)
  64. set('FileName','<%= @adminNodeMgrLogDir %>/'+ADMIN_SERVER+'.log')
  65. set('FileCount',10)
  66. set('FileMinSize',5000)
  67. set('RotationType','byTime')
  68. set('FileTimeSpan',24)
  69. print('Set password...')
  70. cd('/')
  71. cd('Security/base_domain/User/weblogic')
  72. # weblogic user name + password
  73. set('Name',ADMIN_USER)
  74. cmo.setPassword(ADMIN_PASSWORD)
  75. # Set domain save options:
  76. # - ServerStartMode: Set mode to development.
  77. # - JavaHome: Sets home directory for the JVM used when starting the server.
  78. if DEVELOPMENT_MODE == true:
  79. setOption('ServerStartMode', 'dev')
  80. else:
  81. setOption('ServerStartMode', 'prod')
  82. setOption('JavaHome', JAVA_HOME)
  83. print('write domain...')
  84. # write path + domain name
  85. writeDomain(DOMAIN_PATH)
  86. closeTemplate()
  87. createBootPropertiesFile(DOMAIN_PATH+'/servers/'+ADMIN_SERVER+'/security','boot.properties',ADMIN_USER,ADMIN_PASSWORD)
  88. createBootPropertiesFile(DOMAIN_PATH+'/config/nodemanager','nm_password.properties',ADMIN_USER,ADMIN_PASSWORD)
  89. es = encrypt(ADMIN_PASSWORD,DOMAIN_PATH)
  90. readDomain(DOMAIN_PATH)
  91. print('set domain password...')
  92. cd('/SecurityConfiguration/'+DOMAIN)
  93. set('CredentialEncrypted',es)
  94. print('Set nodemanager password')
  95. set('NodeManagerUsername',ADMIN_USER )
  96. set('NodeManagerPasswordEncrypted',es )
  97. cd('/')
  98. setOption( "AppDir", APP_PATH )
  99. print 'Adding WC Template'
  100. addTemplate('<%= @templateJRF %>')
  101. print 'Adding EM Template'
  102. addTemplate('<%= @templateEM %>')
  103. print 'Adding WSMPM'
  104. addTemplate('<%= @templateWSMPM %>')
  105. print 'Adding Spaces'
  106. addTemplate('<%= @templateSpaces %>')
  107. print 'Adding Portlets'
  108. addTemplate('<%= @templatePortlets %>')
  109. print 'Adding Pagelet'
  110. addTemplate('<%= @templatePagelet %>')
  111. print 'Adding Discussion'
  112. addTemplate('<%= @templateDiscussion %>')
  113. dumpStack();
  114. print 'Change datasources'
  115. print 'Change datasource mds-owsm'
  116. cd('/JDBCSystemResource/mds-owsm/JdbcResource/mds-owsm/JDBCDriverParams/NO_NAME_0')
  117. set('URL',WC_REPOS_DBURL)
  118. set('PasswordEncrypted',WC_REPOS_DBPASSWORD)
  119. cd('Properties/NO_NAME_0/Property/user')
  120. set('Value',WC_REPOS_DBUSER_PREFIX+'_MDS')
  121. print 'Change datasource WebCenterDS'
  122. cd('/JDBCSystemResource/WebCenterDS/JdbcResource/WebCenterDS/JDBCDriverParams/NO_NAME_0')
  123. set('URL',WC_REPOS_DBURL)
  124. set('PasswordEncrypted',WC_REPOS_DBPASSWORD)
  125. cd('Properties/NO_NAME_0/Property/user')
  126. set('Value',WC_REPOS_DBUSER_PREFIX+'_WEBCENTER')
  127. print 'Change datasource mds-SpacesDS'
  128. cd('/JDBCSystemResource/mds-SpacesDS/JdbcResource/mds-SpacesDS/JDBCDriverParams/NO_NAME_0')
  129. set('URL',WC_REPOS_DBURL)
  130. set('PasswordEncrypted',WC_REPOS_DBPASSWORD)
  131. cd('Properties/NO_NAME_0/Property/user')
  132. set('Value',WC_REPOS_DBUSER_PREFIX+'_MDS')
  133. print 'Change datasource PortletDS'
  134. cd('/JDBCSystemResource/PortletDS/JdbcResource/PortletDS/JDBCDriverParams/NO_NAME_0')
  135. set('URL',WC_REPOS_DBURL)
  136. set('PasswordEncrypted',WC_REPOS_DBPASSWORD)
  137. cd('Properties/NO_NAME_0/Property/user')
  138. set('Value',WC_REPOS_DBUSER_PREFIX+'_PORTLET')
  139. print 'Change datasource mds-PageletProducerDS'
  140. cd('/JDBCSystemResource/mds-PageletProducerDS/JdbcResource/mds-PageletProducerDS/JDBCDriverParams/NO_NAME_0')
  141. set('URL',WC_REPOS_DBURL)
  142. set('PasswordEncrypted',WC_REPOS_DBPASSWORD)
  143. cd('Properties/NO_NAME_0/Property/user')
  144. set('Value',WC_REPOS_DBUSER_PREFIX+'_MDS')
  145. print 'Change datasource OWC_DiscussionDS'
  146. cd('/JDBCSystemResource/OWC_DiscussionDS/JdbcResource/OWC_DiscussionDS/JDBCDriverParams/NO_NAME_0')
  147. set('URL',WC_REPOS_DBURL)
  148. set('PasswordEncrypted',WC_REPOS_DBPASSWORD)
  149. cd('Properties/NO_NAME_0/Property/user')
  150. set('Value',WC_REPOS_DBUSER_PREFIX+'_DISCUSSIONS')
  151. print 'Finished datasources'
  152. dumpStack();
  153. updateDomain()
  154. dumpStack();
  155. closeDomain();
  156. readDomain(DOMAIN_PATH)
  157. setOption( "AppDir", APP_PATH )
  158. cd('/Servers/AdminServer')
  159. set('Machine','LocalMachine')
  160. print 'Change wc_collaboration'
  161. setOption( "AppDir", APP_PATH )
  162. cd('/Servers/WC_Collaboration')
  163. set('Machine','LocalMachine')
  164. create('WC_Collaboration','ServerStart')
  165. cd('ServerStart/WC_Collaboration')
  166. set('Arguments', WC_COLLABORATION_JAVA_ARGUMENTS)
  167. set('JavaVendor','Sun')
  168. set('JavaHome', JAVA_HOME)
  169. cd('/Server/WC_Collaboration')
  170. create('WC_Collaboration','SSL')
  171. cd('SSL/WC_Collaboration')
  172. set('Enabled', 'False')
  173. set('HostNameVerificationIgnored', 'True')
  174. cd('/Server/WC_Collaboration')
  175. create('WC_Collaboration','Log')
  176. cd('/Server/WC_Collaboration/Log/WC_Collaboration')
  177. set('FileName','<%= @wcCollaborationNodeMgrLogDir %>/WC_Collaboration.log')
  178. set('FileCount',10)
  179. set('FileMinSize',5000)
  180. set('RotationType','byTime')
  181. set('FileTimeSpan',24)
  182. print 'Change wc_portlet'
  183. setOption( "AppDir", APP_PATH )
  184. cd('/Servers/WC_Portlet')
  185. set('Machine','LocalMachine')
  186. create('WC_Portlet','ServerStart')
  187. cd('ServerStart/WC_Portlet')
  188. set('Arguments', WC_PORTLET_JAVA_ARGUMENTS)
  189. set('JavaVendor','Sun')
  190. set('JavaHome', JAVA_HOME)
  191. cd('/Server/WC_Portlet')
  192. create('WC_Portlet','SSL')
  193. cd('SSL/WC_Portlet')
  194. set('Enabled', 'False')
  195. set('HostNameVerificationIgnored', 'True')
  196. cd('/Server/WC_Portlet')
  197. create('WC_Portlet','Log')
  198. cd('/Server/WC_Portlet/Log/WC_Portlet')
  199. set('FileName','<%= @wcPortletNodeMgrLogDir %>/WC_Portlet.log')
  200. set('FileCount',10)
  201. set('FileMinSize',5000)
  202. set('RotationType','byTime')
  203. set('FileTimeSpan',24)
  204. print 'Change WC_Spaces'
  205. setOption( "AppDir", APP_PATH )
  206. cd('/Servers/WC_Spaces')
  207. set('Machine','LocalMachine')
  208. create('WC_Spaces','ServerStart')
  209. cd('ServerStart/WC_Spaces')
  210. set('Arguments', WC_SPACES_JAVA_ARGUMENTS)
  211. set('JavaVendor','Sun')
  212. set('JavaHome', JAVA_HOME)
  213. cd('/Server/WC_Spaces')
  214. create('WC_Spaces','SSL')
  215. cd('SSL/WC_Spaces')
  216. set('Enabled', 'False')
  217. set('HostNameVerificationIgnored', 'True')
  218. cd('/Server/WC_Spaces')
  219. create('WC_Spaces','Log')
  220. cd('/Server/WC_Spaces/Log/WC_Spaces')
  221. set('FileName','<%= @wcSpacesNodeMgrLogDir %>/WC_Spaces.log')
  222. set('FileCount',10)
  223. set('FileMinSize',5000)
  224. set('RotationType','byTime')
  225. set('FileTimeSpan',24)
  226. dumpStack();
  227. updateDomain()
  228. closeDomain()
  229. createBootPropertiesFile(DOMAIN_PATH+'/servers/WC_Collaboration/security','boot.properties',ADMIN_USER,ADMIN_PASSWORD)
  230. createBootPropertiesFile(DOMAIN_PATH+'/servers/WC_Spaces/security','boot.properties',ADMIN_USER,ADMIN_PASSWORD)
  231. createBootPropertiesFile(DOMAIN_PATH+'/servers/WC_Portlet/security','boot.properties',ADMIN_USER,ADMIN_PASSWORD)
  232. print('Exiting...')
  233. exit()