├── README.md ├── customization_example └── windows │ └── psft_customizations.yaml └── patches ├── pt_dpk_85704.patch ├── pt_dpk_85706.patch └── pt_dpk_85711.patch /README.md: -------------------------------------------------------------------------------- 1 | 2 | This repository contains fixes and enhancements to Oracle's PeopleSoft DPK. 3 | 4 | ## Pre-Requisites 5 | 6 | ### Windows 7 | 1. puppet-agent - [5.5.6+](http://downloads.puppetlabs.com/windows/puppet5/) 8 | 2. puppet module - [acl](https://forge.puppet.com/puppetlabs/acl) 9 | `puppet module install puppetlabs-acl --version 2.0.1 --confdir [dir]` 10 | 3. puppet module - [inifile](https://forge.puppet.com/puppetlabs/inifile) 11 | `puppet module install puppetlabs-inifile --version 2.3.0 --confdir [dir]` 12 | 4. puppet module - [registry](https://forge.puppet.com/puppetlabs/registry) 13 | `puppet module install puppetlabs-registry --version 2.0.2 --confdir [dir]` 14 | 5. puppet module - [xml_fragment](https://forge.puppet.com/ianoberst/xml_fragment) 15 | `puppet module install ianoberst-xml_fragment --version 1.0.2 --confdir [dir]` 16 | 6. puppet module - [stdlib 4.11+](https://forge.puppet.com/puppetlabs/stdlib) 17 | `puppet module upgrade puppetlabs-stdlib --confdir [dir]` 18 | 7. Set `JAVA_HOME` in system environment variables. 19 | 8. If using custom service accounts, each service account must be granted rights to logon as service or the service will fail to start. 20 | 21 | ## Features 22 | 23 | ### Customization Enhancements 24 | * Windows service customization for app/prcs/pia domains. 25 | * Registry support for domain services. 26 | * PIA XML/Property file support for modifications. 27 | * Custom file support to copy files to app/prcs/pia domain folders post-installation. 28 | * Multiple PS_CFG_HOME Support: In the providers, the $PS_CFG_HOME environment variable is set to support multiple configuration homes 29 | * Support for per-software middleware reployments using custom ::*_redeploy facts 30 | * Support for specifying archive files (enables centralizing on DFS) 31 | * Better WL Status checking 32 | 33 | ### Bug Fixes 34 | * Fixes WebLogic patch support for windows. 35 | * Fixes Tuxedo patch support for windows. 36 | * Fixes various Tuxedo install/uninstall issues. 37 | * Fixes various WebLogic install/uninstall issues. 38 | * Fixes Process Scheduler feature validation (change `KIOSK` to `PPM`) 39 | * Other minor cleanup/fixes. 40 | 41 | ## Custom Facts 42 | 43 | **redeploy** 44 | 45 | This fact can be used as-is. The fact is built to always return `false` by design. To override the fact, you can specify an environment variable: 46 | 47 | ```powershell 48 | PS C:\> $env:FACTER_weblogic_redeploy="true" 49 | ``` 50 | 51 | This will tell the DPK to redeploy the WebLogic DPK archive (uninstall, then re-install). 52 | 53 | ## How to apply DPK patch 54 | 1. Copy pt_dpk_[version].patch to `/pt/dpk/puppet/production/modules/` 55 | 1. Navigate to `/pt/dpk/puppet/production/modules/` 56 | 1. On Windows platform, set `git config core.autocrlf input` 57 | 1. Run `git apply pt_dpk_[version].patch` 58 | For example, if applying DPK 8.56.10 patch, you would run the following command 59 | `git apply -v pt_dpk_85610.patch` -------------------------------------------------------------------------------- /customization_example/windows/psft_customizations.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | #################### 4 | # Deployment # 5 | #################### 6 | 7 | peoplesoft_base: 'E:\PSoft' 8 | 9 | dpk_location: 'E:\PSoft\dpk' 10 | archive_location: "%{hiera('dpk_location')}\\archives" 11 | archive_files: 12 | weblogic: "%{hiera('archive_location')}/pt-weblogic12.2.1.3.0.tgz" 13 | tuxedo: "%{hiera('archive_location')}/pt-tuxedo12.2.2.0.0.tgz" 14 | jdk: "%{hiera('archive_location')}/pt-jdk1.8.0_231.tgz" 15 | pshome: "%{hiera('archive_location')}/pt-pshome8.57.12.tgz" 16 | oracleclient: "%{hiera('archive_location')}/pt-oracleclient12.1.0.2.tgz" 17 | pt_location: "%{hiera('peoplesoft_base')}\\pt" 18 | db_location: "%{hiera('peoplesoft_base')}\\db" 19 | db_platform: MSSQL 20 | setup_ohs: false 21 | unicode_db: false 22 | db_type: MSSQL 23 | install_type: FRESH 24 | 25 | #################### 26 | 27 | 28 | #################### 29 | # PS Homes # 30 | #################### 31 | 32 | ps_app_home: 33 | location: 'E:\PSoft\pt\ps_app_home\cs' 34 | ps_cfg_home: 35 | location: 'E:\PSoft\pt\ps_cfg_home\cs' 36 | ps_cust_home: 37 | location: 'E:\PSoft\pt\ps_cust_home\cs' 38 | tuxedo_home: 39 | location: 'E:\PSoft\pt\bea\tuxedo\tuxedo12.2.2.0.0_VS2015' 40 | 41 | ps_app_home_location: "%{hiera('pt_location')}\\ps_app_home\\cs 42 | ps_cfg_home_location: "%{hiera('pt_location')}\\ps_cfg_home\\cs 43 | ps_cust_home_location: "%{hiera('pt_location')}\\ps_cust_home\\cs 44 | ps_home_location: "%{hiera('pt_location')}\\ps_home8.57.12" 45 | inventory_location: "%{hiera('db_location')}\\oraInventory" 46 | oracle_client_location: "%{hiera('pt_location')}\\oracle-client\\12.1.0.2" 47 | jdk_location: "%{hiera('pt_location')}\\jdk" 48 | weblogic_location: "%{hiera('pt_location')}\\bea" 49 | tuxedo_location: "%{hiera('pt_location')}\\bea\\tuxedo" 50 | ohs_location: "%{hiera('pt_location')}\\bea\\ohs" 51 | 52 | #################### 53 | 54 | 55 | #################### 56 | # Security # 57 | #################### 58 | 59 | # Note: ALL Passwords below should be encrypted using eyaml. See 60 | 61 | 62 | # The PeopleSoft access ID is the RDBMS ID with which PeopleSoft applications are ultimately connected to your database after the PeopleSoft system connects using the connect ID and validates the user ID and password. 63 | # An access ID typically has all the RDBMS privileges necessary to access and manipulate data for an entire PeopleSoft application. 64 | access_id: user 65 | access_pwd: DEC::PKCS7[changeme]! 66 | 67 | # Domain Connection Password used by PIA to connect to application server via JOLT 68 | domain_conn_pwd: DEC::PKCS7[changeme]! 69 | 70 | # Oracle Database admin password 71 | # Note: This is not used for MSSQL databases 72 | db_admin_pwd: DEC::PKCS7[changeme]! 73 | 74 | # The connect ID performs the initial connection to the PeopleSoft database. 75 | db_connect_id: user 76 | db_connect_pwd: DEC::PKCS7[changeme]! 77 | 78 | # Used by the following: 79 | # 1. AppServer/Process Scheduler to connect to DB on startup 80 | # Populates the following fields in app/prcs configs: UserId, UserPswd 81 | # 2. DMS to update PSOPRDEFN with user and pwd 82 | # Note: Requires change_password to be set to true 83 | db_user: user 84 | db_user_pwd: DEC::PKCS7[changeme]! 85 | 86 | # The user used by PIA to access the integration gateway. (Default: administrator) 87 | pia_gateway_user: administrator 88 | pia_gateway_user_pwd: DEC::PKCS7[changeme]! 89 | 90 | # The PeopleSoft user id that will be used to load web profiles from the PIA. (Default: PTWEBSERVER) 91 | # Note: The PeopleSoft user specified here should have the delivered role "PeopleTools Web Server", which links to the delivered permission list "PTPT1500". 92 | pia_profile_user: PTWEBSERVER 93 | pia_profile_user_pwd: DEC::PKCS7[changeme]! 94 | 95 | ## WebLogic 96 | # The administrator user id used to boot weblogic. (Default: system) 97 | webserver_admin_user: system 98 | webserver_admin_user_pwd: DEC::PKCS7[changeme]! 99 | 100 | # The pskey keystore password 101 | # If empty or null, then the keystore will be opened without a passphrase. 102 | # This attribute is only used if KeyStores is CUSTOM_IDENTITY_AND_JAVA_STANDARD_TRUST, CUSTOM_IDENTITY_AND_CUSTOM_TRUST or CUSTOM_IDENTITY_AND_COMMAND_LINE_TRUST. 103 | webserver_keystore_identity_pwd: DEC::PKCS7[changeme]! 104 | 105 | # The pskey keystore trust password 106 | # Note: If unsure, set to same as identity password 107 | webserver_keystore_trust_pwd: DEC::PKCS7[changeme]! 108 | 109 | # The string alias used to store and retrieve the server's private key in the keystore. 110 | # This private key is associated with the server's digital certificate and is usually stored by the server hostname. 111 | webserver_private_key_alias: alias 112 | 113 | # The passphrase used to retrieve the server's private key from the keystore. 114 | # This passphrase is assigned to the private key when it is generated. 115 | webserver_private_key_pwd: DEC::PKCS7[changeme]! 116 | 117 | ## Services 118 | 119 | # The user used to boot PIA services 120 | pia_service_user: 'domain\user' 121 | pia_service_pwd: DEC::PKCS7[changeme]! 122 | 123 | # The user used to boot Process Scheduler services 124 | prcs_service_user: 'domain\user' 125 | prcs_service_pwd: DEC::PKCS7[changeme]! 126 | 127 | # The user used to boot Application Server services 128 | appserver_service_user: 'domain\user' 129 | appserver_service_pwd: DEC::PKCS7[changeme]! 130 | 131 | # The user used to boot Tuxedo services. 132 | tuxedo_service_user: 'domain\user' 133 | tuxedo_service_pwd: DEC::PKCS7[changeme]! 134 | 135 | #################### 136 | 137 | 138 | #################### 139 | # Patches # 140 | #################### 141 | 142 | # Note: Order matters so make sure to list pre-req patches first 143 | tuxedo_patches: 144 | 30630977: 'E:\PSoft\pt\patches\tuxedo\p30630977_122200_MSWIN-x86-64.zip' 145 | 146 | weblogic_patches: 147 | 30675853: 'E:\PSoft\pt\patches\weblogic\p30675853_122130_Generic.zip' 148 | 149 | #################### 150 | 151 | 152 | #################### 153 | # ACM # 154 | #################### 155 | 156 | gateway_node_name: PT_LOCAL 157 | 158 | # Set to false if not using 159 | run_preboot_config_setup: false 160 | run_postboot_config_setup: false 161 | 162 | #################### 163 | 164 | 165 | #################### 166 | # General # 167 | #################### 168 | 169 | # This setting has the following values: [all, appbatch, appserver, pia, prcs] 170 | # For example, if you only want to deploy PIA then this would be set to pia. 171 | domain_type: all 172 | 173 | domain_user: 'domain\user' 174 | help_uri: pt856pbr2 175 | 176 | #################### 177 | 178 | 179 | #################### 180 | # Database # 181 | #################### 182 | 183 | change_password: false 184 | db_host_name: sqlserv01.domain.com 185 | db_is_rac: false 186 | db_name: CSPRD 187 | db_platform: MSSQL 188 | db_port: 1521 189 | db_service_name: CSPRD 190 | 191 | # ODBC 192 | mssql_server_list: 193 | "%{hiera('db_name')}": 194 | mss_server_name: sqlserv01.domain.com 195 | mss_odbc_name: "ODBC Driver 17 for SQL Server" 196 | 197 | #################### 198 | 199 | 200 | #################### 201 | # AppServer # 202 | #################### 203 | appserver_domain_name: CSPRD1 204 | appserver_template: medium 205 | jolt_port: 5000 206 | wsl_port: 6000 207 | 208 | appserver_domain_list: 209 | "%{hiera('appserver_domain_name')}": 210 | os_user: "%{hiera('domain_user')}" 211 | ps_cust_home_dir: "%{hiera('ps_cust_home_location')}" 212 | ps_cfg_home_dir: "%{hiera('ps_cfg_home_location')}" 213 | template_type: "%{hiera('appserver_template')}" 214 | 215 | # custom domain files 216 | # Specify source location to copy files from post install 217 | # All files/folders in source will be copied to location specified in path 218 | custom_file_settings: 219 | appserver_domain_files: 220 | ensure: present 221 | source: 'E:\PSoft\dpk\puppet\production\data\files\appserver' 222 | path: "%{hiera('ps_cfg_home_location')}\\appserv" 223 | 224 | # Windows ONLY - Used to add environment paths to appserver service in registry 225 | service_registry_settings: 226 | app_cs_service: 227 | key: HKLM\System\CurrentControlSet\Services\PsftAppServerDomain%{hiera('appserver_domain_name')}Service 228 | value: Environment 229 | type: array 230 | data: 231 | - PS_APP_HOME=%{lookup('ps_app_home_location')} 232 | - PS_CFG_HOME=%{lookup('ps_cfg_home_location')} 233 | - PS_CUST_HOME=%{lookup('ps_cust_home_location')} 234 | - PS_HOME=%{lookup('ps_home_location')} 235 | - TUXDIR=%{lookup('tuxedo_home_location')} 236 | - PS_FILEDIR=%{lookup('ps_cfg_home_location')}\appserv\prcs\%{hiera('appserver_domain_name')}\files\PS_UPLOADS 237 | 238 | db_settings: 239 | db_name: "%{hiera('db_name')}" 240 | db_type: "%{hiera('db_platform')}" 241 | db_opr_id: "%{hiera('db_user')}" 242 | db_opr_pwd: "%{hiera('db_user_pwd')}" 243 | db_connect_id: "%{hiera('db_connect_id')}" 244 | db_connect_pwd: "%{hiera('db_connect_pwd')}" 245 | 246 | config_settings: 247 | Domain Settings/Domain ID: "%{hiera('appserver_domain_name')}" 248 | JOLT Listener/Port: "%{hiera('jolt_port')}" 249 | JOLT Listener/Address: 0.0.0.0 250 | PSANALYTICSRV/Min Instances: 1 251 | PSANALYTICSRV/Max Instances: 2 252 | PSAPPSRV/Min Instances: 2 253 | PSAPPSRV/Max Instances: 2 254 | PSAPPSRV/Max Fetch Size: 15000 255 | PSBRKHND_dflt/Min Instances: 1 256 | PSBRKHND_dflt/Max Instances: 2 257 | PSPPMSRV/Min Instances: 0 258 | PSPPMSRV/Max Instances: 0 259 | PSPUBHND_dflt/Min Instances: 1 260 | PSPUBHND_dflt/Max Instances: 2 261 | PSRENSRV/default_http_port: 7180 262 | PSRENSRV/default_auth_token: 'domain.com' 263 | PSSAMSRV/Min Instances: 1 264 | PSSAMSRV/Max Instances: 2 265 | PSSUBHND_dflt/Min Instances: 1 266 | PSSUBHND_dflt/Max Instances: 2 267 | PSTOOLS/Add to CLASSPATH: 'E:\Program Files\Microsoft JDBC Driver 4.1 for SQL Server\sqljdbc_4.1\enu\sqljdbc41.jar' 268 | PSTOOLS/EnablePPM Agent: 0 269 | PSTOOLS/Enable Remote Administration: 0 270 | PSTOOLS/JavaVM Options: '-Xms32m -Xmx128m -Xrs -Dxdo.ConfigFile=%%PS_HOME%%\appserv\xdo.cfg' 271 | RemoteCall/RCCBL PRDBIN: '%%PS_CUST_HOME%%\cblbin%%PS_COBOLTYPE%%;%%PS_APP_HOME%%\cblbin%%PS_COBOLTYPE%%;%%PS_HOME%%\cblbin%%PS_COBOLTYPE%%' 272 | Security/DomainConnectionPwd: "%{hiera('domain_conn_pwd')}" 273 | SMTP Settings/SMTPServer: "smtp1.domain.com" 274 | SMTP Settings/SMTPPort: 25 275 | SMTP Settings/SMTPServer1: "smtp2.domain.com" 276 | SMTP Settings/SMTPPort1: 25 277 | SMTP Settings/SMTPSender: "%{hiera('appserver_domain_name')}@domain.com" 278 | SMTP Settings/SMTPSourceMachine: "%{::fqdn}" 279 | Trace/MailErrorReport: "user1@domain.com;user2@domain.com" 280 | Workstation Listener/Port: "%{hiera('wsl_port')}" 281 | 282 | feature_settings: 283 | PUBSUB: "Yes" 284 | QUICKSRV: "No" 285 | QUERYSRV: "No" 286 | JOLT: "Yes" 287 | JRAD: "No" 288 | WSL: "No" 289 | DBGSRV: "No" 290 | RENSRV: "Yes" 291 | MCF: "No" 292 | PPM: "No" 293 | PSPPMSRV: "No" 294 | ANALYTICSRV: "No" 295 | SERVER_EVENTS: "Yes" 296 | DOMAIN_GW: "No" 297 | 298 | #################### 299 | 300 | 301 | #################### 302 | # PRCS Scheduler # 303 | #################### 304 | 305 | prcs_domain_name: CSPRD1 306 | prcs_domain_id: PSNT 307 | 308 | prcs_domain_list: 309 | "%{hiera('prcs_domain_name')}": 310 | os_user: "%{hiera('domain_user')}" 311 | ps_cfg_home_dir: "%{hiera('ps_cfg_home_location')}" 312 | ps_cust_home_dir: "%{hiera('ps_cust_home_location')}" 313 | 314 | # custom domain files 315 | # Specify source location to copy files from post install 316 | # All files/folders in source will be copied to location specified in path 317 | custom_file_settings: 318 | prcs_domain_files: 319 | ensure: present 320 | source: 'E:\PSoft\dpk\puppet\production\data\files\prcs' 321 | path: "%{hiera('ps_cfg_home_location')}\\appserv\\prcs" 322 | 323 | # Windows ONLY - Used to add environment paths to prcs service in registry 324 | service_registry_settings: 325 | prcs_cs_service: 326 | key: HKLM\System\CurrentControlSet\Services\PsftPrcsDomain%{hiera('prcs_domain_name')}Service 327 | value: Environment 328 | type: array 329 | data: 330 | - PS_APP_HOME=%{lookup('ps_app_home_location')} 331 | - PS_CFG_HOME=%{lookup('ps_cfg_home_location')} 332 | - PS_CUST_HOME=%{lookup('ps_cust_home_location')} 333 | - PS_HOME=%{lookup('ps_home_location')} 334 | - TUXDIR=%{lookup('tuxedo_home_location')} 335 | - PS_FILEDIR=%{lookup('ps_cfg_home_location')}\appserv\prcs\%{hiera('prcs_domain_name')}\files\PS_UPLOADS 336 | 337 | db_settings: 338 | db_name: "%{hiera('db_name')}" 339 | db_type: "%{hiera('db_platform')}" 340 | db_opr_id: "%{hiera('db_user')}" 341 | db_opr_pwd: "%{hiera('db_user_pwd')}" 342 | db_connect_id: "%{hiera('db_connect_id')}" 343 | db_connect_pwd: "%{hiera('db_connect_pwd')}" 344 | 345 | config_settings: 346 | Process Scheduler/PrcsServerName: "%{hiera('prcs_domain_id')}" 347 | Security/DomainConnectionPwd: "%{hiera('domain_conn_pwd')}" 348 | Trace/TracePPM: 0 349 | Process Scheduler/DBBIN: 'E:\Program Files\Microsoft SQL Server\140\Tools\Binn' 350 | Process Scheduler/Allow Dynamic Changes: "Y" 351 | Process Scheduler/File Chunk Size: 8192 352 | Process Scheduler/CBLBIN: "%{hiera('ps_cust_home_location')}\\CBLBIN%PS_COBOLTYPE%;%{hiera('ps_app_home_location')}\\CBLBIN%PS_COBOLTYPE%" 353 | Process Scheduler/CRWRPTPATH: "%{hiera('ps_cust_home_location')}\\CRW;%{hiera('ps_app_home_location')}\\CRW" 354 | Process Scheduler/WINWORD: 'E:\Program Files\Microsoft Office\Office15' 355 | PSTOOLS/Enable Remote Administration: 0 356 | PSTOOLS/EnablePPM Agent: 0 357 | PSTOOLS/Add to CLASSPATH: 'E:\Program Files\Microsoft JDBC Driver 4.0 for SQL Server\sqljdbc_4.0\enu\sqljdbc4.jar' 358 | SQR/Enhanced HTML: "Y" 359 | SQR/PSSQR: "%{hiera('ps_cust_home_location')}\\sqr;%{hiera('ps_app_home_location')}\\sqr" 360 | Data Mover/LastScriptsDir: "%{hiera('ps_cust_home_location')}\\scripts;%{hiera('ps_app_home_location')}\\scripts" 361 | nVision/DrillDownDir: "%{hiera('ps_cust_home_location')}\\NVISION\\LAYOUT\\DRILLDN;%{hiera('ps_app_home_location')}\\NVISION\\LAYOUT\\DRILLDN" 362 | nVision/LayoutDir: "%{hiera('ps_cust_home_location')}\\NVISION\\LAYOUT;%{hiera('ps_app_home_location')}\\NVISION\\LAYOUT" 363 | nVision/MacroDir: "%{hiera('ps_cust_home_location')}\\EXCEL;%{hiera('ps_app_home_location')}\\EXCEL" 364 | nVision/StyleDir: "%{hiera('ps_cust_home_location')}\\EXCEL\\STYLESHEETS;%{hiera('ps_app_home_location')}\\EXCEL\\STYLESHEETS" 365 | nVision/TemplateDir: "%{hiera('ps_cust_home_location')}\\EXCEL;%{hiera('ps_app_home_location')}\\EXCEL" 366 | Trace/MailErrorReport: "user1@domain.com;user2@domain.com" 367 | SMTP Settings/SMTPServer: "smtp1.domain.com" 368 | SMTP Settings/SMTPPort: 25 369 | SMTP Settings/SMTPServer1: "smtp2.domain.com" 370 | SMTP Settings/SMTPPort1: 25 371 | SMTP Settings/SMTPSender: "%{hiera('prcs_domain_name')}@domain.com" 372 | SMTP Settings/SMTPSourceMachine: "%{::fqdn}" 373 | 374 | feature_settings: 375 | MSTRSRV: "Yes" 376 | APPENG: "Yes" 377 | 378 | #################### 379 | 380 | 381 | #################### 382 | # PIA # 383 | #################### 384 | 385 | pia_app_home: "%{hiera('ps_cfg_home_location')}/webserv/%{hiera('pia_domain_name')}/applications/peoplesoft" 386 | pia_domain_name: pt85610cs 387 | pia_host_name: "%{::fqdn}" 388 | pia_http_port: 80 389 | pia_https_port: 443 390 | pia_psserver_list: "appserv01.domain.com:%{hiera('jolt_port')}" 391 | pia_site_name: CSPRD 392 | pia_webprofile_name: PROD 393 | report_repository_dir: 'E:\psreports' 394 | webserver_type: weblogic 395 | 396 | pia_domain_list: 397 | "%{hiera('pia_domain_name')}": 398 | os_user: "%{hiera('domain_user')}" 399 | ps_cfg_home_dir: "%{hiera('ps_cfg_home_location')}" 400 | gateway_user: "%{hiera('pia_gateway_user')}" 401 | gateway_user_pwd: "%{hiera('pia_gateway_user_pwd')}" 402 | auth_token_domain: ".%{::domain}" 403 | 404 | # custom domain files 405 | # Specify source location to copy files from post install 406 | # Note: This will recurse and force by default. 407 | # If you do not want recurse or force, set the values to false. 408 | custom_file_settings: 409 | pia_domain_files: 410 | ensure: present 411 | source: "E:\\PSoft\\dpk\\puppet\\production\\data\\files\\pia\\%{hiera('pia_domain_name')}" 412 | path: "%{hiera('ps_cfg_home_location')}\\webserv\\%{hiera('pia_domain_name')}" 413 | 414 | # Supports updating xml nodes 415 | # To modify other xml files, simply follow the format below 416 | # See https://forge.puppet.com/ianoberst/xml_fragment/readme for more information on format 417 | xml_file: 418 | "%{hiera('pia_app_home')}/PORTAL.war/WEB-INF/weblogic.xml": 419 | cookie_name: 420 | ensure: present 421 | xpath: "/weblogic-web-app/session-descriptor/cookie-name" 422 | content: 423 | value: CSPRD-443-PORTAL-PSJSESSIONID 424 | invalidation_interval: 425 | ensure: present 426 | xpath: "/weblogic-web-app/session-descriptor/invalidation-interval-secs" 427 | content: 428 | value: '90' 429 | "%{hiera('pia_app_home')}/PORTAL.war/WEB-INF/web.xml": 430 | psfilter: 431 | ensure: absent 432 | xpath: "/web-app/filter[filter-name='psfilter']" 433 | psfilter_mapping: 434 | ensure: absent 435 | xpath: "/web-app/filter-mapping[filter-name='psfilter']" 436 | 437 | # Supports updating property sections 438 | # To modify other property files, simply follow the format below 439 | property_file: 440 | "%{hiera('pia_app_home')}/PSIGW.war/WEB-INF/integrationGateway.properties": 441 | ig.version: "8.57" 442 | ig.isc.serverURL: "//appserv01.domain.com:5000,//appserv01.domain.com:5100" 443 | ig.isc.userid: "IGUSER" 444 | ig.isc.password: "{V1.1}XXXXXXXXXXXXXXXXXXXX==" 445 | ig.isc.toolsRel: "8.57.12" 446 | ig.isc.DomainConnectionPwd: "{V1.1}XXXXXXXXXXXXXXXXXXXX==" 447 | 448 | ig.isc.PT_LOCAL.serverURL: "//appserv01.domain.com:5000,//appserv01.domain.com:5100" 449 | ig.isc.PT_LOCAL.userid: "IGUSER" 450 | ig.isc.PT_LOCAL.password: "{V1.1}XXXXXXXXXXXXXXXXXXXX==" 451 | ig.isc.PT_LOCAL.toolsRel: "8.57.12" 452 | ig.isc.PT_LOCAL.DomainConnectionPwd: "{V1.1}XXXXXXXXXXXXXXXXXXXX==" 453 | 454 | ig.certificateAlias: "certalias" 455 | ig.certificatePasswd: "{V1.1}XXXXXXXXXXXXXXXXXXXX==" 456 | ig.connector.smtptargetconnector.host: "smtp1.domain.com" 457 | ig.DefaultServer.LocalNode: "PT_LOCAL" 458 | ig.qas.repositoryHomeDir: 'E:\Temp\QASRepository' 459 | secureFileKeystorePath: "%{hiera('ps_cfg_home_location')}\\webserv\\%{hiera('pia_domain_name')}\\piaconfig\\keystore\\pskey" 460 | secureFileKeystorePasswd: "{V1.1}XXXXXXXXXXXXXXXXXXXX==" 461 | 462 | webserver_settings: 463 | webserver_type: "%{hiera('webserver_type')}" 464 | webserver_home: "%{hiera('weblogic_location')}" 465 | webserver_admin_user: "%{hiera('webserver_admin_user')}" 466 | webserver_admin_user_pwd: "%{hiera('webserver_admin_user_pwd')}" 467 | webserver_admin_port: "%{hiera('pia_http_port')}" 468 | webserver_http_port: "%{hiera('pia_http_port')}" 469 | webserver_https_port: "%{hiera('pia_https_port')}" 470 | 471 | config_settings: 472 | Servers/PIA: 473 | ListenAddress: 0.0.0.0 474 | KeyStores: CustomIdentityAndCustomTrust 475 | CustomIdentityKeyStorePassPhrase: "%{hiera('webserver_keystore_identity_pwd')}" 476 | CustomTrustKeyStorePassPhrase: "%{hiera('webserver_keystore_trust_pwd')}" 477 | 478 | Servers/PIA/SSL/PIA: 479 | ServerPrivateKeyAlias: "%{hiera('webserver_private_key_alias')}" 480 | ServerPrivateKeyPassPhrase: "%{hiera('webserver_private_key_pwd')}" 481 | 482 | Servers/PIA/WebServer/PIA/WebServerLog/PIA: 483 | LoggingEnabled: true 484 | LogFileFormat: extended 485 | BufferSizeKB: 0 486 | ELFFields: 'date time cs-method cs-uri sc-status cs-username cs(user-agent) s-ip c-ip cs(X-Forwarded-For) time-taken bytes cs(referrer)' 487 | 488 | site_list: 489 | "%{hiera('pia_site_name')}": 490 | appserver_connections: "%{hiera('pia_psserver_list')}" 491 | domain_conn_pwd: "%{hiera('domain_conn_pwd')}" 492 | 493 | webprofile_settings: 494 | profile_name: "%{hiera('pia_webprofile_name')}" 495 | profile_user: "%{hiera('pia_profile_user')}" 496 | profile_user_pwd: "%{hiera('pia_profile_user_pwd')}" 497 | 498 | report_repository_dir: "%{hiera('report_repository_dir')}" 499 | 500 | # Use if you want to modify text.properties 501 | #text_settings: 502 | 503 | #################### -------------------------------------------------------------------------------- /patches/pt_dpk_85704.patch: -------------------------------------------------------------------------------- 1 | diff --git a/pt_config/files/pt_appserver/appserver_win_service.rb.erb b/pt_config/files/pt_appserver/appserver_win_service.rb.erb 2 | index 8d29c2f..bc1d287 100644 3 | --- a/pt_config/files/pt_appserver/appserver_win_service.rb.erb 4 | +++ b/pt_config/files/pt_appserver/appserver_win_service.rb.erb 5 | @@ -1,4 +1,4 @@ 6 | -LOG_FILE = "<%= ps_cfg_home %>/appserv/<%= domain_name %>/appserver_win_service.log" 7 | +LOG_FILE = "<%= ps_cfg_home.gsub('\\', '/') %>/appserv/<%= domain_name %>/appserver_win_service.log" 8 | begin 9 | 10 | require 'rubygems' 11 | @@ -15,7 +15,11 @@ begin 12 | end 13 | 14 | def service_main(*args) 15 | - system("<%= ps_home %>/appserv/psadmin -c start -d <%= domain_name %>") 16 | + ENV["PS_APP_HOME"] = "<%= ps_app_home %>" 17 | + ENV["PS_HOME"] = "<%= ps_home %>" 18 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 19 | + ENV["PS_CUST_HOME"] = "<%= ps_cust_home %>" 20 | + system("<%= ps_home.gsub('\\', '/') %>/appserv/psadmin -c start -d <%= domain_name %>") 21 | 22 | # While we're in here the daemon is running. 23 | while running? 24 | @@ -31,7 +35,11 @@ begin 25 | def service_stop 26 | msg = 'Received stop signal at: ' + Time.now.to_s 27 | File.open(LOG_FILE, 'a'){ |f| f.puts msg } 28 | - system("<%= ps_home %>/appserv/psadmin -c stop -d <%= domain_name %>") 29 | + ENV["PS_APP_HOME"] = "<%= ps_app_home %>" 30 | + ENV["PS_HOME"] = "<%= ps_home %>" 31 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 32 | + ENV["PS_CUST_HOME"] = "<%= ps_cust_home %>" 33 | + system("<%= ps_home.gsub('\\', '/') %>/appserv/psadmin -c stop -d <%= domain_name %>") 34 | end 35 | 36 | # This event triggers when the service receives a signal to pause. 37 | diff --git a/pt_config/files/pt_pia/pia_win_service.rb.erb b/pt_config/files/pt_pia/pia_win_service.rb.erb 38 | index 5dee9c4..46bd65e 100644 39 | --- a/pt_config/files/pt_pia/pia_win_service.rb.erb 40 | +++ b/pt_config/files/pt_pia/pia_win_service.rb.erb 41 | @@ -1,4 +1,4 @@ 42 | -LOG_FILE = "<%= ps_cfg_home %>/webserv/<%= domain_name %>/pia_win_service.log" 43 | +LOG_FILE = "<%= ps_cfg_home.gsub('\\', '/') %>/webserv/<%= domain_name %>/pia_win_service.log" 44 | begin 45 | 46 | require 'rubygems' 47 | @@ -15,7 +15,8 @@ begin 48 | end 49 | 50 | def service_main(*args) 51 | - system("<%= ps_cfg_home %>/webserv/<%= domain_name %>/bin/startPIA.cmd") 52 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 53 | + system("<%= ps_cfg_home.gsub('\\', '/') %>/webserv/<%= domain_name %>/bin/startPIA.cmd") 54 | 55 | # While we're in here the daemon is running. 56 | while running? 57 | @@ -31,7 +32,8 @@ begin 58 | def service_stop 59 | msg = 'Received stop signal at: ' + Time.now.to_s 60 | File.open(LOG_FILE, 'a'){ |f| f.puts msg } 61 | - system("<%= ps_cfg_home %>/webserv/<%= domain_name %>/bin/stopPIA.cmd") 62 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 63 | + system("<%= ps_cfg_home.gsub('\\', '/') %>/webserv/<%= domain_name %>/bin/stopPIA.cmd") 64 | end 65 | 66 | # This event triggers when the service receives a signal to pause. 67 | diff --git a/pt_config/files/pt_prcs/prcs_win_service.rb.erb b/pt_config/files/pt_prcs/prcs_win_service.rb.erb 68 | index 30e87e2..f8b3d28 100644 69 | --- a/pt_config/files/pt_prcs/prcs_win_service.rb.erb 70 | +++ b/pt_config/files/pt_prcs/prcs_win_service.rb.erb 71 | @@ -1,4 +1,4 @@ 72 | -LOG_FILE = "<%= ps_cfg_home %>/appserv/prcs/<%= domain_name %>/prcs_win_service.log" 73 | +LOG_FILE = "<%= ps_cfg_home.gsub('\\', '/') %>/appserv/prcs/<%= domain_name %>/prcs_win_service.log" 74 | begin 75 | 76 | require 'rubygems' 77 | @@ -15,7 +15,11 @@ begin 78 | end 79 | 80 | def service_main(*args) 81 | - system("<%= ps_home %>/appserv/psadmin -p start -d <%= domain_name %>") 82 | + ENV["PS_APP_HOME"] = "<%= ps_app_home %>" 83 | + ENV["PS_HOME"] = "<%= ps_home %>" 84 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 85 | + ENV["PS_CUST_HOME"] = "<%= ps_cust_home %>" 86 | + system("<%= ps_home.gsub('\\', '/') %>/appserv/psadmin -p start -d <%= domain_name %>") 87 | 88 | # While we're in here the daemon is running. 89 | while running? 90 | @@ -31,7 +35,11 @@ begin 91 | def service_stop 92 | msg = 'Received stop signal at: ' + Time.now.to_s 93 | File.open(LOG_FILE, 'a'){ |f| f.puts msg } 94 | - system("<%= ps_home %>/appserv/psadmin -p stop -d <%= domain_name %>") 95 | + ENV["PS_APP_HOME"] = "<%= ps_app_home %>" 96 | + ENV["PS_HOME"] = "<%= ps_home %>" 97 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 98 | + ENV["PS_CUST_HOME"] = "<%= ps_cust_home %>" 99 | + system("<%= ps_home.gsub('\\', '/') %>/appserv/psadmin -p stop -d <%= domain_name %>") 100 | end 101 | 102 | # This event triggers when the service receives a signal to pause. 103 | diff --git a/pt_config/lib/pt_comp_utils/webserver.rb b/pt_config/lib/pt_comp_utils/webserver.rb 104 | index 5953262..c3fcc8c 100644 105 | --- a/pt_config/lib/pt_comp_utils/webserver.rb 106 | +++ b/pt_config/lib/pt_comp_utils/webserver.rb 107 | @@ -212,6 +212,7 @@ module PtCompUtils 108 | cmd_suffix = '' 109 | classpath = "%CLASSPATH%" 110 | path_separator = ';' 111 | + shell_suffix = 'cmd' 112 | elsif Facter.value(:kernel) == 'AIX' or 113 | Facter.value(:osfamily) == 'Solaris' or 114 | Facter.value(:osfamily) == 'HP-UX' 115 | @@ -223,6 +224,7 @@ module PtCompUtils 116 | cmd_suffix = "\"" 117 | classpath = "$CLASSPATH" 118 | path_separator = ':' 119 | + shell_suffix = 'sh' 120 | else 121 | if Puppet.features.root? 122 | cmd_prefix = "su - #{os_user} -p -c \"" 123 | @@ -232,6 +234,7 @@ module PtCompUtils 124 | cmd_suffix = "\"" 125 | classpath = "$CLASSPATH" 126 | path_separator = ':' 127 | + shell_suffix = 'sh' 128 | end 129 | 130 | # setup weblogic environment 131 | @@ -241,8 +244,8 @@ module PtCompUtils 132 | ENV['CLASSPATH'] = ".#{path_separator}#{wl_jar_file}" 133 | 134 | java_opts = "-Dwlst.offline.log=#{wlst_log_file} -cp #{classpath}" 135 | - wl_status_cmd = "#{cmd_prefix} java #{java_opts} weblogic.WLST " + \ 136 | - "-skipWLSModuleScanning #{wl_script_file} #{cmd_suffix}" 137 | + wlst_cmd = File.join(bea_home, 'oracle_common', 'common', 'bin', "wlst.#{shell_suffix}") 138 | + wl_status_cmd = "#{cmd_prefix} #{wlst_cmd} #{wl_script_file} #{cmd_suffix}" 139 | 140 | Puppet.debug("WLST status command: #{wl_status_cmd}") 141 | 142 | @@ -300,6 +303,7 @@ module PtCompUtils 143 | count = 1 144 | status = 'UNKNOWN' 145 | while status != 'RUNNING' 146 | + Puppet.debug("[#{count}] Checking WebLogic running status...") 147 | begin 148 | Open3.popen3(wl_status_cmd) do |stdin, out, err| 149 | stdin.close 150 | diff --git a/pt_config/lib/puppet/provider/psftdomain.rb b/pt_config/lib/puppet/provider/psftdomain.rb 151 | index ea180cc..ad8f54c 100644 152 | --- a/pt_config/lib/puppet/provider/psftdomain.rb 153 | +++ b/pt_config/lib/puppet/provider/psftdomain.rb 154 | @@ -330,8 +330,15 @@ class Puppet::Provider::PsftDomain < Puppet::Provider 155 | cmd_concat = " && " 156 | 157 | if Facter.value(:osfamily) == 'windows' 158 | + # generate a batch script to avoid environment variables being resolved when passed as %%ENV%% 159 | + psadmin_script_file = File.join(Dir.tmpdir(), 'psadmin_configure.bat') 160 | command = "#{psadmin_cmd} #{domain_type} configure -d #{domain_name} #{config_args}" 161 | - command_output = execute_command(command) 162 | + File.open(psadmin_script_file, 'w') do |script_file| 163 | + script_file.puts("#{command}") 164 | + end 165 | + File.chmod(0755, psadmin_script_file) 166 | + command_output = execute_command(psadmin_script_file) 167 | + File.delete(psadmin_script_file) 168 | elsif Facter.value(:osfamily) == 'Solaris' 169 | if Puppet.features.root? 170 | command_output = domain_cmd('-', resource[:os_user], '-c', 171 | diff --git a/pt_config/lib/puppet/provider/pt_appserver_domain/appserver_domain.rb b/pt_config/lib/puppet/provider/pt_appserver_domain/appserver_domain.rb 172 | index 368f649..6b3aa38 100644 173 | --- a/pt_config/lib/puppet/provider/pt_appserver_domain/appserver_domain.rb 174 | +++ b/pt_config/lib/puppet/provider/pt_appserver_domain/appserver_domain.rb 175 | @@ -113,6 +113,7 @@ Puppet::Type.type(:pt_appserver_domain).provide :appserver_domain, 176 | domain_name = resource[:domain_name] 177 | cfg_home_dir = resource[:ps_cfg_home_dir] 178 | 179 | + FileUtils.mkdir_p cfg_home_dir 180 | domain_dir = File.join(cfg_home_dir, 'appserv', domain_name) 181 | if File.exist?(domain_dir) 182 | Puppet.debug("Removing Application Server domain directory: #{domain_dir}") 183 | diff --git a/pt_config/lib/puppet/provider/pt_appserver_domain_boot/appserver_domain_boot.rb b/pt_config/lib/puppet/provider/pt_appserver_domain_boot/appserver_domain_boot.rb 184 | index 1f2fad7..d68fc88 100644 185 | --- a/pt_config/lib/puppet/provider/pt_appserver_domain_boot/appserver_domain_boot.rb 186 | +++ b/pt_config/lib/puppet/provider/pt_appserver_domain_boot/appserver_domain_boot.rb 187 | @@ -72,6 +72,10 @@ Puppet::Type.type(:pt_appserver_domain_boot).provide :appserver_domain_boot, 188 | domain_name = resource[:domain_name] 189 | ps_cfg_home = resource[:ps_cfg_home_dir] 190 | ps_home = resource[:ps_home_dir] 191 | + ps_app_home = resource[:ps_app_home_dir] 192 | + ps_cust_home = resource[:ps_cust_home_dir] 193 | + service_user = resource[:service_user] 194 | + service_pwd = resource[:service_pwd] 195 | 196 | appserver_win_service_file = File.join(ps_cfg_home, 'appserv', domain_name, "appserver_win_service.rb") 197 | appserver_win_service_content = template('puppet:///modules/pt_config/pt_appserver/appserver_win_service.rb.erb', 198 | @@ -102,7 +106,9 @@ Puppet::Type.type(:pt_appserver_domain_boot).provide :appserver_domain_boot, 199 | :binary_path_name => "#{ruby_executable.chomp} #{appserver_win_service_file}", 200 | :load_order_group => 'Network', 201 | :dependencies => nil, 202 | - :display_name => appserver_domain_service 203 | + :display_name => appserver_domain_service, 204 | + :service_start_name => "#{service_user}", 205 | + :password => "#{service_pwd}" 206 | }) 207 | rescue Exception => e 208 | if (e.message.include?('The specified service already exists') || 209 | diff --git a/pt_config/lib/puppet/provider/pt_prcs_domain_boot/prcs_domain_boot.rb b/pt_config/lib/puppet/provider/pt_prcs_domain_boot/prcs_domain_boot.rb 210 | index 7868399..ef1b72e 100644 211 | --- a/pt_config/lib/puppet/provider/pt_prcs_domain_boot/prcs_domain_boot.rb 212 | +++ b/pt_config/lib/puppet/provider/pt_prcs_domain_boot/prcs_domain_boot.rb 213 | @@ -67,6 +67,10 @@ Puppet::Type.type(:pt_prcs_domain_boot).provide :prcs_domain_boot, 214 | domain_name = resource[:domain_name] 215 | ps_cfg_home = resource[:ps_cfg_home_dir] 216 | ps_home = resource[:ps_home_dir] 217 | + ps_app_home = resource[:ps_app_home_dir] 218 | + ps_cust_home = resource[:ps_cust_home_dir] 219 | + service_user = resource[:service_user] 220 | + service_pwd = resource[:service_pwd] 221 | 222 | prcs_win_service_file = File.join(ps_cfg_home, 'appserv', 'prcs', domain_name, "prcs_win_service.rb") 223 | prcs_win_service_content = template('puppet:///modules/pt_config/pt_prcs/prcs_win_service.rb.erb', 224 | @@ -97,7 +101,9 @@ Puppet::Type.type(:pt_prcs_domain_boot).provide :prcs_domain_boot, 225 | :binary_path_name => "#{ruby_executable.chomp} #{prcs_win_service_file}", 226 | :load_order_group => 'Network', 227 | :dependencies => nil, 228 | - :display_name => prcs_domain_service 229 | + :display_name => prcs_domain_service, 230 | + :service_start_name => "#{service_user}", 231 | + :password => "#{service_pwd}" 232 | }) 233 | rescue Exception => e 234 | if (e.message.include?('The specified service already exists') || 235 | diff --git a/pt_config/lib/puppet/provider/pt_webserver_domain/weblogic_domain.rb b/pt_config/lib/puppet/provider/pt_webserver_domain/weblogic_domain.rb 236 | index ba901bc..d60ef3d 100644 237 | --- a/pt_config/lib/puppet/provider/pt_webserver_domain/weblogic_domain.rb 238 | +++ b/pt_config/lib/puppet/provider/pt_webserver_domain/weblogic_domain.rb 239 | @@ -153,8 +153,9 @@ Puppet::Type.type(:pt_webserver_domain).provide :weblogic_domain do 240 | 241 | if Facter.value(:osfamily) == 'windows' 242 | install_cmd = File.join(install_dir, 'setup.bat') 243 | + bea_home = "#{@webserver_hash[:webserver_home]}" 244 | + wl_env_cmd = File.join(bea_home, 'wlserver', 'server', 'bin', 'setWLSEnv.cmd') 245 | 246 | - command = "#{install_cmd} -i silent -DRES_FILE_PATH=\"#{response_file}\"" 247 | + command = "#{wl_env_cmd} && #{install_cmd} -i silent -DRES_FILE_PATH=\"#{response_file}\"" 248 | execute_command(command, {}, true) 249 | 250 | elsif Facter.value(:osfamily) == 'Solaris' 251 | @@ -215,19 +216,7 @@ Puppet::Type.type(:pt_webserver_domain).provide :weblogic_domain do 252 | extract_file_path = File.join(temp_dir_name, "zip_extract.ps1") 253 | extract_file = File.open(extract_file_path, 'w') 254 | 255 | - extract_file.puts("Try {") 256 | - extract_file.puts(" $shell = new-object -com shell.application") 257 | - extract_file.puts(" $zip = $shell.NameSpace(\"#{patch}\")") 258 | - extract_file.puts(" ForEach($item in $zip.items()) {") 259 | - extract_file.puts(" $shell.Namespace(\"#{domain_dir}\").CopyHere($item, 0x14)") 260 | - extract_file.puts(" }") 261 | - extract_file.puts(" Exit 0") 262 | - extract_file.puts("}") 263 | - extract_file.puts("Catch {") 264 | - extract_file.puts(" $error_message = $_.Exception.Message") 265 | - extract_file.puts(" Write-Host $error_message") 266 | - extract_file.puts(" Exit 1") 267 | - extract_file.puts("}") 268 | + extract_file.puts("Expand-Archive -Path \"#{patch}\" -DestinationPath \"#{domain_dir}\" -Force -ErrorAction Stop") 269 | extract_file.close 270 | File.chmod(0755, extract_file_path) 271 | Puppet.debug(File.read(extract_file_path)) 272 | @@ -332,9 +321,15 @@ Puppet::Type.type(:pt_webserver_domain).provide :weblogic_domain do 273 | 274 | def post_create 275 | domain_name = resource[:domain_name] 276 | + os_user = resource[:os_user] 277 | 278 | Puppet.debug("Post Create domain: #{domain_name}") 279 | 280 | + if Facter.value(:osfamily) == 'windows' && os_user != nil 281 | + domain_dir = resource[:ps_cfg_home_dir] 282 | + perm_cmd = "icacls #{domain_dir} /grant #{os_user}:(OI)(CI)F /T > NUL" 283 | + system(perm_cmd) 284 | + end 285 | start_needed = false 286 | if ! resource[:config_settings].nil? 287 | @property_flush[:config_settings] = resource[:config_settings] 288 | diff --git a/pt_config/lib/puppet/provider/pt_webserver_domain_boot/webserver_domain_boot.rb b/pt_config/lib/puppet/provider/pt_webserver_domain_boot/webserver_domain_boot.rb 289 | index 131549b..495bb69 100644 290 | --- a/pt_config/lib/puppet/provider/pt_webserver_domain_boot/webserver_domain_boot.rb 291 | +++ b/pt_config/lib/puppet/provider/pt_webserver_domain_boot/webserver_domain_boot.rb 292 | @@ -65,6 +65,7 @@ Puppet::Type.type(:pt_webserver_domain_boot).provide :webserver_domain_boot do 293 | domain_name = resource[:domain_name] 294 | ps_cfg_home = resource[:ps_cfg_home_dir] 295 | domain_dir = File.join(ps_cfg_home, 'webserv', domain_name, 'bin') 296 | + os_user = resource[:os_user] 297 | 298 | Puppet.debug("Getting status of domain: #{domain_name}") 299 | 300 | @@ -72,6 +73,10 @@ Puppet::Type.type(:pt_webserver_domain_boot).provide :webserver_domain_boot do 301 | domain_status = :running 302 | if Facter.value(:osfamily) == 'windows' 303 | status_cmd = File.join(domain_dir, 'singleserverStatus.cmd') 304 | + # make sure os user has access to execute command 305 | + pia_domain_dir = File.join(ps_cfg_home, 'webserv', domain_name) 306 | + perm_cmd = "icacls #{pia_domain_dir} /grant #{os_user}:(OI)(CI)F /T > NUL" 307 | + execute_command(perm_cmd) 308 | else 309 | os_user = resource[:os_user] 310 | if os_user_exists?(os_user) == false 311 | @@ -155,6 +160,8 @@ Puppet::Type.type(:pt_webserver_domain_boot).provide :webserver_domain_boot do 312 | domain_name = resource[:domain_name] 313 | ps_cfg_home = resource[:ps_cfg_home_dir] 314 | domain_dir = File.join(ps_cfg_home, 'webserv', domain_name, 'bin') 315 | + service_user = resource[:service_user] 316 | + service_pwd = resource[:service_pwd] 317 | 318 | Puppet.debug("Starting domain: #{domain_name}") 319 | 320 | @@ -189,7 +196,9 @@ Puppet::Type.type(:pt_webserver_domain_boot).provide :webserver_domain_boot do 321 | :binary_path_name => "#{ruby_executable.chomp} #{pia_win_service_file}", 322 | :load_order_group => 'Network', 323 | :dependencies => nil, 324 | - :display_name => pia_domain_service 325 | + :display_name => pia_domain_service, 326 | + :service_start_name => "#{service_user}", 327 | + :password => "#{service_pwd}" 328 | }) 329 | rescue Exception => e 330 | if (e.message.include?('The specified service already exists') || 331 | diff --git a/pt_config/lib/puppet/type/pt_acm_plugin.rb b/pt_config/lib/puppet/type/pt_acm_plugin.rb 332 | index 971275a..6229958 100644 333 | --- a/pt_config/lib/puppet/type/pt_acm_plugin.rb 334 | +++ b/pt_config/lib/puppet/type/pt_acm_plugin.rb 335 | @@ -71,13 +71,15 @@ module Puppet 336 | raise ArgumentError, "Properties name/value pairs must be " + 337 | "separated by an =" 338 | else 339 | - prop.split(', ').each do |prop_item| 340 | - if ['pwd', 'pass'].any? {|var| prop_item.split('=')[0].include? var} 341 | - Puppet.debug("Got the property: #{prop_item.gsub(prop_item.split('=')[1], '*****')}") 342 | - else 343 | - Puppet.debug("Got the property: #{prop_item}") 344 | - end 345 | - end 346 | + # DJI - 6/6/18 - .include? was causing errors when trying to hide passwords 347 | + # The provider acm_plugin.rb will runs the same code 348 | + #prop.split(', ').each do |prop_item| 349 | + # if ['pwd', 'pass'].any? {|var| prop_item.split('=')[0].include? var} 350 | + # Puppet.debug("Got the property: #{prop_item.gsub(prop_item.split('=')[1], '*****')}") 351 | + # else 352 | + # Puppet.debug("Got the property: #{prop_item}") 353 | + # end 354 | + #end 355 | end 356 | end 357 | end 358 | diff --git a/pt_config/lib/puppet/type/pt_appserver_domain.rb b/pt_config/lib/puppet/type/pt_appserver_domain.rb 359 | index bb6d941..43e0a0c 100644 360 | --- a/pt_config/lib/puppet/type/pt_appserver_domain.rb 361 | +++ b/pt_config/lib/puppet/type/pt_appserver_domain.rb 362 | @@ -35,10 +35,16 @@ module Puppet 363 | 364 | validate do 365 | validate_domain_params(self[:os_user], self[:ps_home_dir]) 366 | - validate_keyvalue_array(self[:feature_settings]) 367 | + if self[:ps_cfg_home_dir].nil? 368 | + self[:ps_cfg_home_dir] = self[:ps_home_dir] 369 | + end 370 | + 371 | + if self[:ensure] == 'present' 372 | + validate_keyvalue_array(self[:feature_settings]) 373 | 374 | - if self[:ensure] == 'present' && self[:db_home_dir].nil? 375 | - fail("db_home_dir attribute should be specified") 376 | + if self[:db_home_dir].nil? 377 | + fail("db_home_dir attribute should be specified") 378 | + end 379 | end 380 | end 381 | 382 | diff --git a/pt_config/lib/puppet/type/pt_appserver_domain_boot.rb b/pt_config/lib/puppet/type/pt_appserver_domain_boot.rb 383 | index 8112e58..c9d6c7f 100644 384 | --- a/pt_config/lib/puppet/type/pt_appserver_domain_boot.rb 385 | +++ b/pt_config/lib/puppet/type/pt_appserver_domain_boot.rb 386 | @@ -48,6 +48,10 @@ module Puppet 387 | parameter :os_user 388 | parameter :ps_home_dir 389 | parameter :ps_cfg_home_dir 390 | + parameter :ps_app_home_dir 391 | + parameter :ps_cust_home_dir 392 | + parameter :service_user 393 | + parameter :service_pwd 394 | 395 | # Basically just a synonym for restarting. Used to respond 396 | # to events. 397 | diff --git a/pt_config/lib/puppet/type/pt_prcs_domain.rb b/pt_config/lib/puppet/type/pt_prcs_domain.rb 398 | index 93cca7a..9f0ce93 100644 399 | --- a/pt_config/lib/puppet/type/pt_prcs_domain.rb 400 | +++ b/pt_config/lib/puppet/type/pt_prcs_domain.rb 401 | @@ -54,7 +54,7 @@ module Puppet 402 | validate do |value| 403 | 404 | prcs_features = 405 | - [ "MSTRSRV", "APPENG", "KIOSK", "DOMAIN_GW", "SERVER_EVENTS" ] 406 | + [ "MSTRSRV", "APPENG", "PPM", "DOMAIN_GW", "SERVER_EVENTS" ] 407 | 408 | value = [value] unless value.is_a? Array 409 | 410 | diff --git a/pt_config/lib/puppet/type/pt_prcs_domain_boot.rb b/pt_config/lib/puppet/type/pt_prcs_domain_boot.rb 411 | index b25185f..041b2a0 100644 412 | --- a/pt_config/lib/puppet/type/pt_prcs_domain_boot.rb 413 | +++ b/pt_config/lib/puppet/type/pt_prcs_domain_boot.rb 414 | @@ -48,6 +48,10 @@ module Puppet 415 | parameter :os_user 416 | parameter :ps_home_dir 417 | parameter :ps_cfg_home_dir 418 | + parameter :ps_app_home_dir 419 | + parameter :ps_cust_home_dir 420 | + parameter :service_user 421 | + parameter :service_pwd 422 | 423 | # Basically just a synonym for restarting. Used to respond 424 | # to events. 425 | diff --git a/pt_config/lib/puppet/type/pt_webserver_domain.rb b/pt_config/lib/puppet/type/pt_webserver_domain.rb 426 | index 24c284f..e666a07 100644 427 | --- a/pt_config/lib/puppet/type/pt_webserver_domain.rb 428 | +++ b/pt_config/lib/puppet/type/pt_webserver_domain.rb 429 | @@ -41,10 +41,13 @@ module Puppet 430 | 431 | validate_webserver_settings_array(ensure_value, self[:webserver_settings]) 432 | 433 | - # make sure atleast one site is specified 434 | - site_list = self[:site_list] 435 | - if site_list.nil? || site_list.empty? 436 | - fail("Atleast one site needs to be specified #{self[:site_list].inspect}") 437 | + # Only verify site_list if not uninstalling 438 | + if ensure_value != "absent" 439 | + # make sure atleast one site is specified 440 | + site_list = self[:site_list] 441 | + if site_list.nil? || site_list.empty? 442 | + fail("Atleast one site needs to be specified #{self[:site_list].inspect}") 443 | + end 444 | end 445 | 446 | # make sure the ps_cfg_home_dir is given 447 | @@ -232,11 +235,11 @@ module Puppet 448 | 449 | profile_name = webprofile_settings_hash[key_profile_name] 450 | # validate to make sure profile value is one of the predefined ones 451 | - valid_profile_names = [ "DEV", "KIOSK", "PROD", "TEST" ] 452 | - if ! valid_profile_names.include?(profile_name) 453 | - fail("Specified profile name '#{profile_name}' is not one of " + 454 | - "valid profile names '#{valid_profile_names.inspect}") 455 | - end 456 | + #valid_profile_names = [ "DEV", "KIOSK", "PROD", "TEST" ] 457 | + #if ! valid_profile_names.include?(profile_name) 458 | + # fail("Specified profile name '#{profile_name}' is not one of " + 459 | + # "valid profile names '#{valid_profile_names.inspect}") 460 | + #end 461 | webprofile_settings_hash[key_profile_user] 462 | profile_user_pwd = webprofile_settings_hash[key_profile_pwd] 463 | if profile_user_pwd.match(/^(?=.*[\w]).{8,}$/).nil? 464 | diff --git a/pt_config/lib/puppet/type/pt_webserver_domain_boot.rb b/pt_config/lib/puppet/type/pt_webserver_domain_boot.rb 465 | index 712859f..5c3ae81 100644 466 | --- a/pt_config/lib/puppet/type/pt_webserver_domain_boot.rb 467 | +++ b/pt_config/lib/puppet/type/pt_webserver_domain_boot.rb 468 | @@ -54,6 +54,8 @@ module Puppet 469 | property :ensure 470 | parameter :domain_name 471 | parameter :os_user 472 | + parameter :service_user 473 | + parameter :service_pwd 474 | parameter :ps_cfg_home_dir 475 | parameter :webserver_settings 476 | 477 | diff --git a/pt_config/lib/puppet/type/shared/service_pwd.rb b/pt_config/lib/puppet/type/shared/service_pwd.rb 478 | new file mode 100644 479 | index 0000000..11d0eff 480 | --- /dev/null 481 | +++ b/pt_config/lib/puppet/type/shared/service_pwd.rb 482 | @@ -0,0 +1,6 @@ 483 | +newparam(:service_pwd) do 484 | + include EasyType 485 | + 486 | + desc "The service pwd." 487 | + 488 | +end 489 | diff --git a/pt_config/lib/puppet/type/shared/service_user.rb b/pt_config/lib/puppet/type/shared/service_user.rb 490 | new file mode 100644 491 | index 0000000..22d14e1 492 | --- /dev/null 493 | +++ b/pt_config/lib/puppet/type/shared/service_user.rb 494 | @@ -0,0 +1,6 @@ 495 | +newparam(:service_user) do 496 | + include EasyType 497 | + 498 | + desc "The service user." 499 | + 500 | +end 501 | diff --git a/pt_deploy/lib/puppet/provider/pt_deploy_tuxedo/deploy_tuxedo.rb b/pt_deploy/lib/puppet/provider/pt_deploy_tuxedo/deploy_tuxedo.rb 502 | index 68278ca..1022360 100644 503 | --- a/pt_deploy/lib/puppet/provider/pt_deploy_tuxedo/deploy_tuxedo.rb 504 | +++ b/pt_deploy/lib/puppet/provider/pt_deploy_tuxedo/deploy_tuxedo.rb 505 | @@ -149,6 +149,18 @@ Puppet::Type.type(:pt_deploy_tuxedo).provide :deploy_tuxedo, 506 | raise Puppet::ExecutionFailure, "Tuxedo home cloning failed, error message: [#{ex.message}]" 507 | end 508 | 509 | + if Facter.value(:osfamily) == 'windows' 510 | + service_user = resource[:service_user] 511 | + service_pwd = resource[:service_pwd] 512 | + if !service_user.nil? && !service_pwd.nil? 513 | + Service.configure( 514 | + :service_name => 'ORACLE ProcMGR V12.2.2.0.0_VS2015', 515 | + :service_type => Service::WIN32_OWN_PROCESS, 516 | + :service_start_name => service_user, 517 | + :password => service_pwd 518 | + ) 519 | + end 520 | + end 521 | # install tuxedo patches if specified 522 | patch_list = resource[:patch_list] 523 | if ! patch_list.nil? 524 | @@ -161,9 +173,8 @@ Puppet::Type.type(:pt_deploy_tuxedo).provide :deploy_tuxedo, 525 | 526 | if Facter.value(:osfamily) == 'windows' 527 | Puppet.debug("Extracting Tuxedo patch on Windows platform") 528 | - 529 | - extract_zip_script = generate_windows_unzip_script(patch, tuxedo_patch_dir) 530 | - system("powershell -File #{extract_zip_script}") 531 | + ENV['JAVA_HOME'] = jdk_location 532 | + system("cd #{tuxedo_patch_dir} && #{jdk_location}\\bin\\jar -xvf #{patch}") 533 | if $? == 0 534 | Puppet.debug("Extraction of Tuxedo patch #{patch} successful") 535 | else 536 | @@ -216,22 +227,23 @@ Puppet::Type.type(:pt_deploy_tuxedo).provide :deploy_tuxedo, 537 | tuxedo_opatch_cmd = "#{tuxedo_home}\\OPatch\\opatch.bat" 538 | 539 | tuxedo_patch_dir = tuxedo_patch_dir.gsub('/', '\\') 540 | - patch_response_file = "#{tuxedo_patch_dir}\\opatch.rsp" 541 | - 542 | - target = open(patch_response_file, 'w') 543 | - target.puts("joe@foo.com") 544 | - target.puts("") 545 | - target.puts("") 546 | - target.puts("") 547 | - target.close() 548 | - File.chmod(0755, patch_response_file) 549 | - 550 | - patch_apply_cmd = "cd #{tuxedo_patch_dir} && #{tuxedo_opatch_cmd} apply #{tuxedo_patch_num} < #{patch_response_file}" 551 | - system(patch_apply_cmd) 552 | - if $? == 0 553 | - Puppet.debug("Tuxedo Patch #{tuxedo_patch_num} install successful") 554 | - else 555 | - Puppet.debug("Tuxedo Patch #{tuxedo_patch_num} install failed") 556 | + 557 | + patch_apply_cmd = "cd #{tuxedo_patch_dir} && #{tuxedo_opatch_cmd} apply #{tuxedo_patch_num} -silent" 558 | + 559 | + begin 560 | + Puppet.debug("Tuxedo patch apply command #{patch_apply_cmd}") 561 | + system("#{patch_apply_cmd}") 562 | + if $? == 0 563 | + Puppet.debug("Tuxedo Patch #{tuxedo_patch_num} install successful") 564 | + else 565 | + raise Puppet::ExecutionFailure, "Tuxedo patch installation failed: #{patch} failed" 566 | + end 567 | + rescue Puppet::ExecutionFailure => e 568 | + Puppet.debug("Tuxedo patch installation failed: #{e.message}") 569 | + raise Puppet::Error, "Installation of tuxedo patch #{patch} failed: #{e.message}" 570 | + ensure 571 | + FileUtils.remove_entry(tuxedo_patch_dir) 572 | + Puppet.debug("Deleted Tuxedo patch installation directory #{tuxedo_patch_dir}") 573 | end 574 | # start the services 575 | Puppet.debug("Starting Tuxedo ProcManager service [#{tuxedo_procmgr_service}]") 576 | @@ -426,6 +438,7 @@ Puppet::Type.type(:pt_deploy_tuxedo).provide :deploy_tuxedo, 577 | # remove the registry entry if present 578 | system("REG DELETE HKEY_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\KEY_#{oracle_home_name} /f >NUL 2>&1") 579 | system("REG DELETE HKEY_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\TUXEDO\\12.2.2.0.0_VS2015 /f >NUL 2>&1") 580 | + system("REG DELETE \"HKEY_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\SALT\\12.2.2.0.0\\for Tuxedo 12.2.2.0.0\" /f >NUL 2>&1") 581 | 582 | # remove services if present 583 | remove_tuxedo_services() 584 | diff --git a/pt_deploy/lib/puppet/provider/pt_deploy_weblogic/deploy_weblogic.rb b/pt_deploy/lib/puppet/provider/pt_deploy_weblogic/deploy_weblogic.rb 585 | index 9356aa0..b16c677 100644 586 | --- a/pt_deploy/lib/puppet/provider/pt_deploy_weblogic/deploy_weblogic.rb 587 | +++ b/pt_deploy/lib/puppet/provider/pt_deploy_weblogic/deploy_weblogic.rb 588 | @@ -80,7 +80,9 @@ Puppet::Type.type(:pt_deploy_weblogic).provide :deploy_weblogic, 589 | deploy_user = resource[:deploy_user] 590 | deploy_group = resource[:deploy_user_group] 591 | 592 | + FileUtils.mkdir_p deploy_location 593 | deploy_parent_location = File.dirname(deploy_location) 594 | + Puppet.debug("deploy_location: #{deploy_location}") 595 | weblogic_archive_dir = Dir.mktmpdir(['wl', 'dir'], deploy_parent_location) 596 | FileUtils.chmod(0755, weblogic_archive_dir) 597 | 598 | @@ -205,6 +207,13 @@ Puppet::Type.type(:pt_deploy_weblogic).provide :deploy_weblogic, 599 | 600 | if Facter.value(:osfamily) == 'windows' 601 | Puppet.debug("Extracting WebLogic patch on Windows platform") 602 | + ENV['JAVA_HOME'] = jdk_location 603 | + system("cd #{weblogic_patch_dir} && #{jdk_location}\\bin\\jar -xvf #{patch}") 604 | + if $? == 0 605 | + Puppet.debug("Extraction of WebLogic patch #{patch} successful") 606 | + else 607 | + raise Puppet::ExecutionFailure, "Extraction of WebLogic patch #{patch} failed" 608 | + end 609 | else 610 | Puppet.debug("Extracting WebLogic patch on Non Windows platform") 611 | if Facter.value(:osfamily) == 'AIX' or Facter.value(:osfamily) == 'HP-UX' 612 | @@ -215,29 +224,55 @@ Puppet::Type.type(:pt_deploy_weblogic).provide :deploy_weblogic, 613 | change_ownership(deploy_user, deploy_group, weblogic_patch_dir) 614 | end 615 | begin 616 | - if Facter.value(:osfamily) != 'windows' 617 | - Puppet.debug("Installing WebLogic patch #{patch}") 618 | - ENV['ORACLE_HOME'] = deploy_location 619 | - Puppet.debug('Oracle Home environment variable' + ENV['ORACLE_HOME']) 620 | - 621 | - # get the patch number 622 | - weblogic_patch_num = Dir.entries(weblogic_patch_dir).reject {|f| !File.directory?(f) || f.include?('.')}[0] 623 | - Puppet.debug('Installing WebLogic patch number ' + weblogic_patch_num) 624 | - 625 | - patch_dir = "#{weblogic_patch_dir}/#{weblogic_patch_num}" 626 | - Puppet.debug("Installing Weblogic patch #{weblogic_patch_num} from #{patch_dir}") 627 | + Puppet.debug("Installing WebLogic patch #{patch}") 628 | + ENV['ORACLE_HOME'] = deploy_location 629 | + Puppet.debug('Oracle Home environment variable' + ENV['ORACLE_HOME']) 630 | + # get the patch number 631 | + weblogic_patch_num = Dir.entries(weblogic_patch_dir).reject {|f| f.include?('.')}[0] 632 | + Puppet.debug('Installing WebLogic patch number ' + weblogic_patch_num) 633 | + patch_dir = "#{weblogic_patch_dir}/#{weblogic_patch_num}" 634 | + opatch = Dir.glob("#{patch_dir}/**/opatch*.jar") 635 | + if Facter.value(:osfamily) == 'windows' 636 | + if opatch.empty? 637 | + Puppet.debug("Installing Weblogic patch #{weblogic_patch_num} from #{patch_dir}") 638 | + patch_apply_cmd = "cd #{patch_dir} && #{deploy_location}\\OPatch\\opatch " + \ 639 | + "apply -oh #{deploy_location} -silent -jdk #{jdk_location} -oop" 640 | + else 641 | + Puppet.debug("Installing OPatch patch #{weblogic_patch_num} from #{patch_dir}") 642 | + patch_apply_cmd = "#{jdk_location}\\bin\\java -jar #{patch_dir}\\opatch_generic.jar -silent oracle_home=#{deploy_location}" 643 | + end 644 | + 645 | + patch_apply_cmd = patch_apply_cmd.gsub('/', '\\') 646 | + weblogic_patch_dir = weblogic_patch_dir.gsub('/', '\\') 647 | + Puppet.debug("Weblogic patch apply command #{patch_apply_cmd}") 648 | + system("#{patch_apply_cmd}") 649 | + if $? != 0 650 | + raise Puppet::ExecutionFailure, "Weblogic patch installation failed: #{patch} failed" 651 | + end 652 | + else 653 | + if opatch.empty? 654 | + Puppet.debug("Installing Weblogic patch #{weblogic_patch_num} from #{patch_dir}") 655 | + patch_apply_cmd = "#{cmd_prefix} cd #{patch_dir} && #{deploy_location}/OPatch/opatch " + \ 656 | + "apply -oh #{deploy_location} -silent -jdk #{jdk_location}#{cmd_suffix}" 657 | + else 658 | + Puppet.debug("Installing OPatch patch #{weblogic_patch_num} from #{patch_dir}") 659 | + patch_apply_cmd = "java -jar #{patch_dir}/opatch_generic.jar -silent oracle_home=#{deploy_location}" 660 | + end 661 | 662 | - patch_apply_cmd = "#{cmd_prefix} cd #{patch_dir} && #{deploy_location}/OPatch/opatch " + \ 663 | - " apply -silent -jdk #{jdk_location}#{cmd_suffix}" 664 | Puppet.debug("Weblogic patch apply command #{patch_apply_cmd}") 665 | Puppet::Util::Execution.execute(patch_apply_cmd, :failonfail => true) 666 | - Puppet.debug('Weblogic patch installation successfully') 667 | end 668 | + Puppet.debug('Weblogic patch installation completed successfully') 669 | rescue Puppet::ExecutionFailure => e 670 | Puppet.debug("Weblogic patch installation failed: #{e.message}") 671 | raise Puppet::Error, "Installation of weblogic patch #{patch} failed: #{e.message}" 672 | ensure 673 | + if Facter.value(:osfamily) == 'windows' 674 | + remove_cmd = "cd #{deploy_location} && md empty && robocopy empty #{weblogic_patch_dir} /E /PURGE /NOCOPY /MOVE" 675 | + system(remove_cmd) 676 | + end 677 | FileUtils.remove_entry(weblogic_patch_dir) 678 | + Puppet.debug("Deleted Weblogic patch installation directory #{weblogic_patch_dir}") 679 | end 680 | end 681 | else 682 | diff --git a/pt_deploy/lib/puppet/type/pt_deploy_tuxedo.rb b/pt_deploy/lib/puppet/type/pt_deploy_tuxedo.rb 683 | index d0f556c..2ca2f9a 100644 684 | --- a/pt_deploy/lib/puppet/type/pt_deploy_tuxedo.rb 685 | +++ b/pt_deploy/lib/puppet/type/pt_deploy_tuxedo.rb 686 | @@ -43,7 +43,7 @@ module Puppet 687 | also be provided." 688 | 689 | validate do 690 | - if self[:ensure] == :present 691 | + if self[:ensure] == 'present' 692 | if self[:archive_file].nil? 693 | fail("archive_file attribute should be specified.") 694 | end 695 | @@ -64,7 +64,7 @@ module Puppet 696 | validate_oracle_inventory(inventory_location, 697 | inventory_user, inventory_group) 698 | end 699 | - elsif (self[:ensure] == :absent) and 700 | + elsif (self[:ensure] == 'absent') and 701 | (Facter.value(:osfamily) != 'windows') 702 | if self[:deploy_user].nil? 703 | fail("deploy_user attribute should be specified.") 704 | @@ -102,5 +102,7 @@ module Puppet 705 | parameter :redeploy 706 | parameter :remove 707 | parameter :patch_list 708 | + parameter :service_user 709 | + parameter :service_pwd 710 | end 711 | end 712 | diff --git a/pt_deploy/lib/puppet/type/shared/service_pwd.rb b/pt_deploy/lib/puppet/type/shared/service_pwd.rb 713 | new file mode 100644 714 | index 0000000..11d0eff 715 | --- /dev/null 716 | +++ b/pt_deploy/lib/puppet/type/shared/service_pwd.rb 717 | @@ -0,0 +1,6 @@ 718 | +newparam(:service_pwd) do 719 | + include EasyType 720 | + 721 | + desc "The service pwd." 722 | + 723 | +end 724 | diff --git a/pt_deploy/lib/puppet/type/shared/service_user.rb b/pt_deploy/lib/puppet/type/shared/service_user.rb 725 | new file mode 100644 726 | index 0000000..22d14e1 727 | --- /dev/null 728 | +++ b/pt_deploy/lib/puppet/type/shared/service_user.rb 729 | @@ -0,0 +1,6 @@ 730 | +newparam(:service_user) do 731 | + include EasyType 732 | + 733 | + desc "The service user." 734 | + 735 | +end 736 | diff --git a/pt_profile/manifests/pt_app_deployment.pp b/pt_profile/manifests/pt_app_deployment.pp 737 | index 4307425..d88e705 100644 738 | --- a/pt_profile/manifests/pt_app_deployment.pp 739 | +++ b/pt_profile/manifests/pt_app_deployment.pp 740 | @@ -23,6 +23,7 @@ class pt_profile::pt_app_deployment { 741 | 742 | # Hiera lookups 743 | $ensure = hiera('ensure') 744 | + $remove_default = $ensure ? { 'present' => false, default => true } 745 | if !($ensure in [ 'present', 'absent']) { 746 | fail("Invalid value for 'ensure'. It needs to be either 'present' or 'absent'.") 747 | } 748 | @@ -56,13 +57,7 @@ class pt_profile::pt_app_deployment { 749 | $ps_apphome_location = $ps_apphome_hiera['location'] 750 | notice ("PS App Home location is ${ps_apphome_location}") 751 | 752 | - $ps_apphome_remove_value = $ps_apphome_hiera['remove'] 753 | - if $ps_apphome_remove_value == undef { 754 | - $ps_apphome_remove = true 755 | - } 756 | - else { 757 | - $ps_apphome_remove = str2bool($ps_apphome_remove_value) 758 | - } 759 | + $ps_apphome_remove = any2bool(pick($ps_apphome_hiera['remove'], $remove_default)) 760 | notice ("PS App Home remove flag ${ps_apphome_remove}") 761 | 762 | if $deploy_apphome_only == false { 763 | @@ -75,13 +70,7 @@ class pt_profile::pt_app_deployment { 764 | $pi_home_location = $pi_home_hiera['location'] 765 | notice ("PS App PI Home location is ${pi_home_location}") 766 | 767 | - $pi_home_remove_value = $pi_home_hiera['remove'] 768 | - if $pi_home_remove_value == undef { 769 | - $pi_home_remove = true 770 | - } 771 | - else { 772 | - $pi_home_remove = str2bool($pi_home_remove_value) 773 | - } 774 | + $pi_home_remove = any2bool(pick($pi_home_hiera['remove'], $remove_default)) 775 | } 776 | else { 777 | $pi_home_remove = true 778 | @@ -93,13 +82,7 @@ class pt_profile::pt_app_deployment { 779 | $ps_custhome_location = $ps_custhome_hiera['location'] 780 | notice ("PS Cust Home location is ${ps_custhome_location}") 781 | 782 | - $ps_custhome_remove_value = $ps_custhome_hiera['remove'] 783 | - if $ps_custhome_remove_value == undef { 784 | - $ps_custhome_remove = true 785 | - } 786 | - else { 787 | - $ps_custhome_remove = str2bool($ps_custhome_remove_value) 788 | - } 789 | + $ps_custhome_remove = any2bool(pick($ps_custhome_hiera['remove'], $remove_default)) 790 | } 791 | else { 792 | $ps_custhome_remove = true 793 | diff --git a/pt_profile/manifests/pt_appserver.pp b/pt_profile/manifests/pt_appserver.pp 794 | index c06ab3d..fb42a40 100644 795 | --- a/pt_profile/manifests/pt_appserver.pp 796 | +++ b/pt_profile/manifests/pt_appserver.pp 797 | @@ -35,10 +35,8 @@ class pt_profile::pt_appserver { 798 | $env_settings_array = join_keys_to_values($env_settings, '=') 799 | notify {"AppServer domain ${domain_name} Env settings: ${env_settings_array}\n":} 800 | } 801 | + else { 802 | + $env_settings_array = undef 803 | + } 804 | # get the database platform 805 | $appserver_db_name = $db_settings['db_name'] 806 | $db_platform = $db_settings['db_type'] 807 | @@ -116,7 +117,8 @@ class pt_profile::pt_appserver { 808 | elsif ($db_platform_upper == 'MSSQL') { 809 | if $::osfamily != 'windows' { 810 | fail("${db_platform_upper} database type is not supported for midtier setup on $::osfamily") 811 | - } 812 | + } 813 | + $db_location = undef 814 | } 815 | else { 816 | fail("Application Server domain setup for DB platform ${db_platform_upper} is not supported") 817 | @@ -182,6 +184,39 @@ class pt_profile::pt_appserver { 818 | recreate => $recreate, 819 | require => $appserver_require, 820 | } 821 | + 822 | + if $ensure == present { 823 | + $appserver_custom_file_settings = $appserver_domain_info['custom_file_settings'] 824 | + if $appserver_custom_file_settings { 825 | + $appserver_custom_file_settings.each |$resource, $hash| { 826 | + $path = $hash['path'] 827 | + if $path == undef { 828 | + $path = "${ps_cfg_home_dir}/appserv" 829 | + } 830 | + file { $resource: 831 | + ensure => $hash['ensure'], 832 | + path => $path, 833 | + source => $hash['source'], 834 | + recurse => true, 835 | + force => true, 836 | + require => Pt_appserver_domain[$domain_name] 837 | + } 838 | + } 839 | + } 840 | + 841 | + if $::osfamily == 'windows' { 842 | + $service_registry_settings = $appserver_domain_info['service_registry_settings'] 843 | + if $service_registry_settings { 844 | + $service_registry_settings.each |$resource, $reg_data| { 845 | + registry::value { $resource: 846 | + key => $reg_data['key'], 847 | + value => $reg_data['value'], 848 | + type => $reg_data['type'], 849 | + data => $reg_data['data'], 850 | + } 851 | + } 852 | + } 853 | + } 854 | + } 855 | + 856 | if $setup_services == true { 857 | if ($::kernel == 'Linux') or ($::kernel == 'DISABLEAIX') { 858 | 859 | diff --git a/pt_profile/manifests/pt_domain_boot.pp b/pt_profile/manifests/pt_domain_boot.pp 860 | index 16694ab..3fac3cf 100644 861 | --- a/pt_profile/manifests/pt_domain_boot.pp 862 | +++ b/pt_profile/manifests/pt_domain_boot.pp 863 | @@ -40,11 +40,15 @@ class pt_profile::pt_domain_boot { 864 | $psapphome_location = $psapphome_hiera['location'] 865 | notify {"Domain boot PS APP Home: [${psapphome_location}]\n":} 866 | } 867 | + 868 | + $appserver_service_user = hiera('appserver_service_user', undef) 869 | + $appserver_service_pwd = hiera('appserver_service_pwd', undef) 870 | + $pia_service_user = hiera('pia_service_user', undef) 871 | + $pia_service_pwd = hiera('pia_service_pwd', undef) 872 | + $prcs_service_user = hiera('prcs_service_user', undef) 873 | + $prcs_service_pwd = hiera('prcs_service_pwd', undef) 874 | + 875 | if ($::osfamily == 'windows') and ($env_type == 'fulltier') { 876 | $oracleserver_hiera = hiera('oracle_server') 877 | $oracle_listener_name = $oracleserver_hiera['listener_name'] 878 | @@ -72,12 +76,29 @@ class pt_profile::pt_domain_boot { 879 | 880 | $os_user = $appserver_domain_info['os_user'] 881 | $ps_cfg_home_dir = $appserver_domain_info['ps_cfg_home_dir'] 882 | - 883 | + $ps_cust_home_dir = $appserver_domain_info['ps_cust_home_dir'] 884 | + 885 | + if $ensure == present and $appserver_service_user != undef { 886 | + acl { 'appserver_service_permission' : 887 | + target => $ps_cfg_home_dir, 888 | + permissions => [ 889 | + { 890 | + identity => $appserver_service_user, 891 | + rights => ['full'], 892 | + purge => false 893 | + } 894 | + ], 895 | + } 896 | + } 897 | pt_appserver_domain_boot { $app_domain_name: 898 | ensure => $domain_action, 899 | + ps_app_home_dir => $psapphome_location, 900 | ps_home_dir => $pshome_location, 901 | ps_cfg_home_dir => $ps_cfg_home_dir, 902 | + ps_cust_home_dir => $ps_cust_home_dir, 903 | os_user => $os_user, 904 | + service_user => $appserver_service_user, 905 | + service_pwd => $appserver_service_pwd, 906 | } 907 | if ($::osfamily == 'windows') and ($env_type == 'fulltier') { 908 | $appserver_domain_service = "PsftAppServerDomain${app_domain_name}Service" 909 | @@ -98,12 +119,29 @@ class pt_profile::pt_domain_boot { 910 | 911 | $os_user = $prcs_domain_info['os_user'] 912 | $ps_cfg_home_dir = $prcs_domain_info['ps_cfg_home_dir'] 913 | - 914 | + $ps_cust_home_dir = $prcs_domain_info['ps_cust_home_dir'] 915 | + 916 | + if $ensure == present and $prcs_service_user != undef { 917 | + acl { 'prcs_service_permission' : 918 | + target => $ps_cfg_home_dir, 919 | + permissions => [ 920 | + { 921 | + identity => $prcs_service_user, 922 | + rights => ['full'], 923 | + purge => false 924 | + } 925 | + ], 926 | + } 927 | + } 928 | pt_prcs_domain_boot { $prcs_domain_name: 929 | ensure => $domain_action, 930 | + ps_app_home_dir => $psapphome_location, 931 | ps_home_dir => $pshome_location, 932 | ps_cfg_home_dir => $ps_cfg_home_dir, 933 | + ps_cust_home_dir => $ps_cust_home_dir, 934 | os_user => $os_user, 935 | + service_user => $prcs_service_user, 936 | + service_pwd => $prcs_service_pwd, 937 | } 938 | if ($::osfamily == 'windows') and ($env_type == 'fulltier') { 939 | $prcs_domain_service = "PsftPrcsDomain${prcs_domain_name}Service" 940 | @@ -129,10 +167,23 @@ class pt_profile::pt_domain_boot { 941 | validate_hash($webserver_settings) 942 | $webserver_settings_array = join_keys_to_values($webserver_settings, '=') 943 | 944 | + if $ensure == present and $pia_service_user != undef { 945 | + acl { "${ps_cfg_home_dir}/webserv": 946 | + permissions => [ 947 | + { 948 | + identity => $pia_service_user, 949 | + rights => ['full'], 950 | + purge => false, 951 | + } 952 | + ], 953 | + } 954 | + } 955 | pt_webserver_domain_boot { $pia_domain_name: 956 | ensure => $domain_action, 957 | ps_cfg_home_dir => $ps_cfg_home_dir, 958 | os_user => $os_user, 959 | + service_user => $pia_service_user, 960 | + service_pwd => $pia_service_pwd, 961 | webserver_settings => $webserver_settings_array, 962 | } 963 | } 964 | diff --git a/pt_profile/manifests/pt_oracleserver.pp b/pt_profile/manifests/pt_oracleserver.pp 965 | index 328d13d..44d3b16 100644 966 | --- a/pt_profile/manifests/pt_oracleserver.pp 967 | +++ b/pt_profile/manifests/pt_oracleserver.pp 968 | @@ -23,6 +23,7 @@ class pt_profile::pt_oracleserver { 969 | 970 | # Hiera lookups 971 | $ensure = hiera('ensure') 972 | + $remove_default = $ensure ? { 'present' => false, default => true } 973 | if !($ensure in [ 'present', 'absent']) { 974 | fail("Invalid value for 'ensure'. It needs to be either 'present' or 'absent'.") 975 | } 976 | @@ -65,13 +66,7 @@ class pt_profile::pt_oracleserver { 977 | $oracleserver_location = $oracleserver_hiera['location'] 978 | $oracleserver_listener_port = $oracleserver_hiera['listener_port'] 979 | $oracleserver_listener_name = $oracleserver_hiera['listener_name'] 980 | - $oracleserver_remove = $oracleserver_hiera['remove'] 981 | - if $oracleserver_remove == undef { 982 | - $remove = true 983 | - } 984 | - else { 985 | - $remove = str2bool($oracleserver_remove) 986 | - } 987 | + $oracleserver_remove = any2bool(pick($oracleserver_hiera['remove'], $remove_default)) 988 | 989 | if $ensure == present { 990 | $db_location = hiera('db_location') 991 | diff --git a/pt_profile/manifests/pt_pia.pp b/pt_profile/manifests/pt_pia.pp 992 | index 00aa5f1..4b34c8a 100644 993 | --- a/pt_profile/manifests/pt_pia.pp 994 | +++ b/pt_profile/manifests/pt_pia.pp 995 | @@ -117,6 +117,68 @@ class pt_profile::pt_pia { 996 | site_list => $pia_site_list_array, 997 | recreate => $recreate, 998 | } 999 | + 1000 | + if $ensure == present { 1001 | + $property_files = $pia_domain_info['property_file'] 1002 | + if $property_files { 1003 | + notify {"Applying property file updates..":} 1004 | + $property_files.each |$file, $data| { 1005 | + notify {"Updating property file ${file}":} 1006 | + $defaults = { 1007 | + 'path' => $file, 1008 | + 'section' => '', 1009 | + 'key_val_separator' => '=' 1010 | + } 1011 | + $hash = {"" => $data} 1012 | + create_ini_settings($hash, $defaults) 1013 | + } 1014 | + } 1015 | + 1016 | + $xml_files = $pia_domain_info['xml_file'] 1017 | + if $xml_files { 1018 | + notify {"Applying xml file updates..":} 1019 | + $xml_files.each |$file, $data| { 1020 | + notify {"Updating xml file ${file}":} 1021 | + $data.each |$resource, $hash| { 1022 | + $content = $hash['content'] 1023 | + if $content { 1024 | + xml_fragment { $resource: 1025 | + ensure => $hash['ensure'], 1026 | + path => "${file}", 1027 | + xpath => $hash['xpath'], 1028 | + content => $content 1029 | + } 1030 | + } 1031 | + else { 1032 | + xml_fragment { $resource: 1033 | + ensure => $hash['ensure'], 1034 | + path => "${file}", 1035 | + xpath => $hash['xpath'] 1036 | + } 1037 | + } 1038 | + } 1039 | + } 1040 | + } 1041 | + 1042 | + $pia_custom_file_settings = $pia_domain_info['custom_file_settings'] 1043 | + if $pia_custom_file_settings { 1044 | + notify {"Applying Custom File Settings..":} 1045 | + $pia_custom_file_settings.each |$resource, $hash| { 1046 | + $path = $hash['path'] 1047 | + if $path == undef { 1048 | + $path = "${ps_cfg_home_dir}/webserv/${domain_name}" 1049 | + } 1050 | + file { $resource: 1051 | + ensure => $hash['ensure'], 1052 | + path => $path, 1053 | + source => $hash['source'], 1054 | + recurse => true, 1055 | + force => true 1056 | + } 1057 | + } 1058 | + } 1059 | + } 1060 | + 1061 | if $setup_services == true { 1062 | if ($::kernel == 'Linux') or ($::kernel == 'DISABLEAIX') { 1063 | 1064 | diff --git a/pt_profile/manifests/pt_prcs.pp b/pt_profile/manifests/pt_prcs.pp 1065 | index 52435a0..1bc2675 100644 1066 | --- a/pt_profile/manifests/pt_prcs.pp 1067 | +++ b/pt_profile/manifests/pt_prcs.pp 1068 | @@ -36,10 +36,7 @@ class pt_profile::pt_prcs { 1069 | $env_settings_array = join_keys_to_values($env_settings, '=') 1070 | notify {"PRCS domain ${domain_name} Env settings: ${env_settings_array}\n":} 1071 | } 1072 | + else { 1073 | + $env_settings_array = undef 1074 | + } 1075 | # get the database platform 1076 | $prcs_db_name = $db_settings['db_name'] 1077 | $db_platform = $db_settings['db_type'] 1078 | @@ -119,6 +119,7 @@ class pt_profile::pt_prcs { 1079 | if $::osfamily != 'windows' { 1080 | fail("${db_platform_upper} database type is not supported for midtier setup on $::osfamily") 1081 | } 1082 | + $db_location = undef 1083 | } 1084 | else { 1085 | fail("Process Scheduler domain setup for DB platform ${db_platform_upper} is not supported") 1086 | diff --git a/pt_profile/manifests/pt_psft_environment.pp b/pt_profile/manifests/pt_psft_environment.pp 1087 | index 1f50450..cca92d2 100644 1088 | --- a/pt_profile/manifests/pt_psft_environment.pp 1089 | +++ b/pt_profile/manifests/pt_psft_environment.pp 1090 | @@ -86,9 +86,11 @@ class pt_profile::pt_psft_environment { 1091 | fail("env_type parameter value ${env_type} is not supported for ${pshome_db_type_upper} \ 1092 | database type") 1093 | } 1094 | + $tns_location = undef 1095 | } 1096 | elsif ($pshome_db_type_upper == 'MSSQL') { 1097 | notice ("Database type is MSSQL, nothing to set for the user environment") 1098 | + $tns_location = undef 1099 | } 1100 | else { 1101 | fail("DB platform ${pshome_db_type_upper} is not supported") 1102 | diff --git a/pt_profile/manifests/pt_tools_deployment.pp b/pt_profile/manifests/pt_tools_deployment.pp 1103 | index 6406f4a..081179b 100644 1104 | --- a/pt_profile/manifests/pt_tools_deployment.pp 1105 | +++ b/pt_profile/manifests/pt_tools_deployment.pp 1106 | @@ -23,6 +23,7 @@ class pt_profile::pt_tools_deployment { 1107 | 1108 | ## Hiera lookups 1109 | $ensure = hiera('ensure') 1110 | + $remove_default = $ensure ? { 'present' => false, default => true } 1111 | if !($ensure in [ 'present', 'absent']) { 1112 | fail("Invalid value for 'ensure'. It needs to be either 'present' or 'absent'.") 1113 | } 1114 | @@ -62,6 +63,15 @@ class pt_profile::pt_tools_deployment { 1115 | notice ("Inventory location is ${inventory_location}") 1116 | 1117 | } 1118 | + else { 1119 | + $inventory_location = undef 1120 | + $oracle_install_group_name = undef 1121 | + $oracle_install_user_name = undef 1122 | + $oracleclient_location = undef 1123 | + $oracleclient_remove = undef 1124 | + $tools_install_group_name = undef 1125 | + $tools_install_user_name = undef 1126 | + } 1127 | $deploy_pshome_only = hiera('deploy_pshome_only', false) 1128 | 1129 | $pshome_hiera = hiera('ps_home') 1130 | @@ -69,13 +79,7 @@ class pt_profile::pt_tools_deployment { 1131 | $pshome_location = $pshome_hiera['location'] 1132 | notice ("PS Home location is ${pshome_location}") 1133 | 1134 | - $pshome_remove_value = $pshome_hiera['remove'] 1135 | - if $pshome_remove_value == undef { 1136 | - $pshome_remove = true 1137 | - } 1138 | - else { 1139 | - $pshome_remove = str2bool($pshome_remove_value) 1140 | - } 1141 | + $pshome_remove = any2bool(pick($pshome_hiera['remove'], $remove_default)) 1142 | notice ("PS Home remove is ${pshome_remove}") 1143 | 1144 | if $deploy_pshome_only == false { 1145 | @@ -84,65 +88,45 @@ class pt_profile::pt_tools_deployment { 1146 | if $db_platform == 'ORACLE' { 1147 | $oracleclient_hiera = hiera('oracle_client') 1148 | $oracleclient_location = $oracleclient_hiera['location'] 1149 | - 1150 | - $oracleclient_remove_value = $oracleclient_hiera['remove'] 1151 | - if $oracleclient_remove_value == undef { 1152 | - $oracleclient_remove = true 1153 | - } 1154 | - else { 1155 | - $oracleclient_remove = str2bool($oracleclient_remove_value) 1156 | - } 1157 | + $oracleclient_remove = any2bool(pick($oracleclient_hiera['remove'], $remove_default)) 1158 | notice ("Oracle client remove is ${oracleclient_remove}") 1159 | } 1160 | } 1161 | $jdk_hiera = hiera('jdk') 1162 | $jdk_location = $jdk_hiera['location'] 1163 | - $jdk_remove_value = $jdk_hiera['remove'] 1164 | - if $jdk_remove_value == undef { 1165 | - $jdk_remove = true 1166 | - } 1167 | - else { 1168 | - $jdk_remove = str2bool($jdk_remove_value) 1169 | - } 1170 | + $jdk_remove = any2bool(pick($jdk_hiera['remove'], $remove_default)) 1171 | notice ("JDK remove is ${jdk_remove}") 1172 | 1173 | $weblogic_hiera = hiera('weblogic') 1174 | $weblogic_location = $weblogic_hiera['location'] 1175 | - $weblogic_remove_value = $weblogic_hiera['remove'] 1176 | - if $weblogic_remove_value == undef { 1177 | - $weblogic_remove = true 1178 | - } 1179 | - else { 1180 | - $weblogic_remove = str2bool($weblogic_remove_value) 1181 | - } 1182 | + $weblogic_remove = any2bool(pick($weblogic_hiera['remove'], $remove_default)) 1183 | notice ("Weblogic remove is ${weblogic_remove}") 1184 | 1185 | $tuxedo_hiera = hiera('tuxedo') 1186 | $tuxedo_location = $tuxedo_hiera['location'] 1187 | - $tuxedo_remove_value = $tuxedo_hiera['remove'] 1188 | - if $tuxedo_remove_value == undef { 1189 | - $tuxedo_remove = true 1190 | - } 1191 | - else { 1192 | - $tuxedo_remove = str2bool($tuxedo_remove_value) 1193 | - } 1194 | + $tuxedo_remove = any2bool(pick($tuxedo_hiera['remove'], $remove_default)) 1195 | notice ("Tuxedo remove is ${tuxedo_remove}") 1196 | 1197 | $ohs_hiera = hiera('setup_ohs', false) 1198 | if $ohs_hiera == true { 1199 | $ohs_comp_hiera = hiera('ohs') 1200 | $ohs_location = $ohs_comp_hiera['location'] 1201 | - $ohs_remove_value = $ohs_comp_hiera['remove'] 1202 | - if $ohs_remove_value == undef { 1203 | - $ohs_remove = true 1204 | - } 1205 | - else { 1206 | - $ohs_remove = str2bool($ohs_remove_value) 1207 | - } 1208 | + $ohs_remove = any2bool(pick($ohs_comp_hiera['remove'], $remove_default)) 1209 | notice ("OHS remove is ${ohs_remove}") 1210 | } 1211 | + else { 1212 | + $ohs_location = undef 1213 | + $ohs_remove = undef 1214 | + } 1215 | } 1216 | - $redeploy = hiera('redeploy', false) 1217 | + $redeploy = hiera('redeploy', false) 1218 | + $pshome_redeploy = hiera('pshome_redeploy', false) 1219 | + $oracleclient_redeploy = hiera('oracleclient_redeploy', false) 1220 | + $jdk_redeploy = hiera('jdk_redeploy', false) 1221 | + $weblogic_redeploy = hiera('weblogic_redeploy', false) 1222 | + $tuxedo_redeploy = hiera('tuxedo_redeploy', false) 1223 | + $ohs_redeploy = hiera('ohs_redeploy', false) 1224 | + 1225 | class { '::pt_setup::tools_deployment': 1226 | ensure => $ensure, 1227 | deploy_pshome_only => $deploy_pshome_only, 1228 | @@ -154,17 +138,23 @@ class pt_profile::pt_tools_deployment { 1229 | db_type => $db_type, 1230 | pshome_location => $pshome_location, 1231 | pshome_remove => $pshome_remove, 1232 | + pshome_redeploy => $pshome_redeploy, 1233 | inventory_location => $inventory_location, 1234 | oracleclient_location => $oracleclient_location, 1235 | oracleclient_remove => $oracleclient_remove, 1236 | + oracleclient_redeploy => $oracleclient_redeploy, 1237 | jdk_location => $jdk_location, 1238 | jdk_remove => $jdk_remove, 1239 | + jdk_redeploy => $jdk_redeploy, 1240 | weblogic_location => $weblogic_location, 1241 | weblogic_remove => $weblogic_remove, 1242 | + weblogic_redeploy => $weblogic_redeploy, 1243 | tuxedo_location => $tuxedo_location, 1244 | tuxedo_remove => $tuxedo_remove, 1245 | + tuxedo_redeploy => $tuxedo_redeploy, 1246 | ohs_location => $ohs_location, 1247 | ohs_remove => $ohs_remove, 1248 | + ohs_redeploy => $ohs_redeploy, 1249 | redeploy => $redeploy, 1250 | } 1251 | contain ::pt_setup::tools_deployment 1252 | diff --git a/pt_role/lib/facter/redeploy.rb b/pt_role/lib/facter/redeploy.rb 1253 | new file mode 100644 1254 | index 0000000..dbe08ae 1255 | --- /dev/null 1256 | +++ b/pt_role/lib/facter/redeploy.rb 1257 | @@ -0,0 +1,41 @@ 1258 | +Facter.add(:redeploy) do 1259 | + setcode do 1260 | + 'false' 1261 | + end 1262 | +end 1263 | + 1264 | +Facter.add(:pshome_redeploy) do 1265 | + setcode do 1266 | + 'false' 1267 | + end 1268 | +end 1269 | + 1270 | +Facter.add(:oracleclient_redeploy) do 1271 | + setcode do 1272 | + 'false' 1273 | + end 1274 | +end 1275 | + 1276 | +Facter.add(:jdk_redeploy) do 1277 | + setcode do 1278 | + 'false' 1279 | + end 1280 | +end 1281 | + 1282 | +Facter.add(:weblogic_redeploy) do 1283 | + setcode do 1284 | + 'false' 1285 | + end 1286 | +end 1287 | + 1288 | +Facter.add(:tuxedo_redeploy) do 1289 | + setcode do 1290 | + 'false' 1291 | + end 1292 | +end 1293 | + 1294 | +Facter.add(:ohs_redeploy) do 1295 | + setcode do 1296 | + 'false' 1297 | + end 1298 | +end 1299 | \ No newline at end of file 1300 | diff --git a/pt_setup/manifests/app_deployment.pp b/pt_setup/manifests/app_deployment.pp 1301 | index 5bed44c..9fe946b 100644 1302 | --- a/pt_setup/manifests/app_deployment.pp 1303 | +++ b/pt_setup/manifests/app_deployment.pp 1304 | @@ -47,14 +47,20 @@ class pt_setup::app_deployment ( 1305 | realize ( ::File[$pt_location] ) 1306 | 1307 | # retrieve the archives for each App component 1308 | - $ps_apphome_archive_file = get_matched_file($app_archive_location, $ps_apphome_tag) 1309 | + $archive_files = hiera('archive_files', '') 1310 | + if $archive_files { 1311 | + $ps_apphome_archive_file = $archive_files[$ps_apphome_tag] 1312 | + } 1313 | + if $ps_apphome_archive_file == '' { 1314 | + $ps_apphome_archive_file = get_matched_file($app_archive_location, $ps_apphome_tag) 1315 | + } 1316 | if $ps_apphome_archive_file == '' { 1317 | fail("Unable to locate archive (tgz) file for PS_APP_HOME in ${app_archive_location}") 1318 | } 1319 | } 1320 | $ps_apphome_hiera = hiera('ps_app_home') 1321 | - $ps_apphome_extract_only_hiera = $ps_apphome_hiera['extract_only'] 1322 | - $apphome_extract_only = str2bool($ps_apphome_extract_only_hiera) 1323 | + $ps_apphome_extract_only_hiera = $ps_apphome_hiera['extract_only'] 1324 | + $apphome_extract_only = str2bool($ps_apphome_extract_only_hiera) 1325 | 1326 | notice ("PS Application Home extract only flag: ${apphome_extract_only}") 1327 | $apphome_patches = hiera('apphome_patches', '') 1328 | diff --git a/pt_setup/manifests/tools_deployment.pp b/pt_setup/manifests/tools_deployment.pp 1329 | index a24a324..794021b 100644 1330 | --- a/pt_setup/manifests/tools_deployment.pp 1331 | +++ b/pt_setup/manifests/tools_deployment.pp 1332 | @@ -29,17 +29,23 @@ class pt_setup::tools_deployment ( 1333 | $db_type = undef, 1334 | $pshome_location = undef, 1335 | $pshome_remove = true, 1336 | + $pshome_redeploy = false, 1337 | $inventory_location = undef, 1338 | $oracleclient_location = undef, 1339 | $oracleclient_remove = true, 1340 | + $oracleclient_redeploy = false, 1341 | $jdk_location = undef, 1342 | $jdk_remove = true, 1343 | + $jdk_redeploy = false, 1344 | $weblogic_location = undef, 1345 | $weblogic_remove = true, 1346 | + $weblogic_redeploy = false, 1347 | $tuxedo_location = undef, 1348 | $tuxedo_remove = true, 1349 | + $tuxedo_redeploy = false, 1350 | $ohs_location = undef, 1351 | $ohs_remove = true, 1352 | + $ohs_redeploy = false, 1353 | $redeploy = false, 1354 | ) { 1355 | notice ("Applying pt_setup::tools_deployment") 1356 | @@ -51,6 +57,16 @@ class pt_setup::tools_deployment ( 1357 | $oracleclient_tag = 'oracleclient' 1358 | $ohs_tag = 'ohs' 1359 | $cobol_tag = 'cobol' 1360 | + $archive_files = hiera('archive_files', '') 1361 | + $domain_type = hiera('domain_type') 1362 | + $appserver_service_user = hiera('appserver_service_user', undef) 1363 | + $appserver_service_pwd = hiera('appserver_service_pwd', undef) 1364 | + $pia_service_user = hiera('pia_service_user', undef) 1365 | + $pia_service_pwd = hiera('pia_service_pwd', undef) 1366 | + $prcs_service_user = hiera('prcs_service_user', undef) 1367 | + $prcs_service_pwd = hiera('prcs_service_pwd', undef) 1368 | + $tuxedo_service_user = hiera('tuxedo_service_user', undef) 1369 | + $tuxedo_service_pwd = hiera('tuxedo_service_pwd', undef) 1370 | 1371 | if $ensure == present { 1372 | $pt_location = hiera('pt_location') 1373 | @@ -64,7 +80,13 @@ class pt_setup::tools_deployment ( 1374 | realize ( ::File[$db_location] ) 1375 | 1376 | # retrieve the archives for each Tools component 1377 | - $pshome_archive_file = get_matched_file($tools_archive_location, $pshome_tag) 1378 | + 1379 | + if $archive_files { 1380 | + $pshome_archive_file = $archive_files[$pshome_tag] 1381 | + } 1382 | + if $pshome_archive_file == '' { 1383 | + $pshome_archive_file = get_matched_file($tools_archive_location, $pshome_tag) 1384 | + } 1385 | if $pshome_archive_file == '' { 1386 | fail("Unable to locate archive (tgz) file for PS_HOME in ${tools_archive_location}") 1387 | } 1388 | @@ -72,30 +94,56 @@ class pt_setup::tools_deployment ( 1389 | if $deploy_pshome_only == false { 1390 | if $ensure == present { 1391 | if ($::kernel != 'AIX' and $::kernel != 'HP-UX') { 1392 | - $jdk_archive_file = get_matched_file($tools_archive_location, $jdk_tag) 1393 | + if $archive_files { 1394 | + $jdk_archive_file = $archive_files[$jdk_tag] 1395 | + } 1396 | + if $jdk_archive_file == '' { 1397 | + $jdk_archive_file = get_matched_file($tools_archive_location, $jdk_tag) 1398 | + } 1399 | if $jdk_archive_file == '' { 1400 | fail("Unable to locate archive (tgz) file for JDK in ${tools_archive_location}") 1401 | } 1402 | } 1403 | - 1404 | - $weblogic_archive_file = get_matched_file($tools_archive_location, 1405 | + 1406 | + if $archive_files { 1407 | + $weblogic_archive_file = $archive_files[$weblogic_tag] 1408 | + } 1409 | + if $weblogic_archive_file == '' { 1410 | + $weblogic_archive_file = get_matched_file($tools_archive_location, 1411 | $weblogic_tag) 1412 | + } 1413 | if $weblogic_archive_file == '' { 1414 | fail("Unable to locate archive (tgz) file for Weblogic in ${tools_archive_location}") 1415 | } 1416 | - $tuxedo_archive_file = get_matched_file($tools_archive_location, 1417 | + 1418 | + if $archive_files { 1419 | + $tuxedo_archive_file = $archive_files[$tuxedo_tag] 1420 | + } 1421 | + if $tuxedo_archive_file == '' { 1422 | + $tuxedo_archive_file = get_matched_file($tools_archive_location, 1423 | $tuxedo_tag) 1424 | + } 1425 | if $tuxedo_archive_file == '' { 1426 | fail("Unable to locate archive (tgz) file for Tuxedo in ${tools_archive_location}") 1427 | } 1428 | } 1429 | + else { 1430 | + $jdk_archive_file = nil 1431 | + $weblogic_archive_file = nil 1432 | + $tuxedo_archive_file = nil 1433 | + } 1434 | $db_platform = hiera('db_platform') 1435 | if ($oracleclient_location) and ($db_platform == 'ORACLE') { 1436 | $deploy_oracleclient = true 1437 | 1438 | if $ensure == present { 1439 | - $oracleclient_archive_file = get_matched_file($tools_archive_location, 1440 | + if $archive_files { 1441 | + $oracleclient_archive_file = $archive_files[$oracleclient_tag] 1442 | + } 1443 | + if $oracleclient_archive_file == '' { 1444 | + $oracleclient_archive_file = get_matched_file($tools_archive_location, 1445 | $oracleclient_tag) 1446 | + } 1447 | if $oracleclient_archive_file == '' { 1448 | fail("Unable to locate archive (tgz) file for Oracle Client in ${tools_archive_location}") 1449 | } 1450 | @@ -109,6 +157,11 @@ class pt_setup::tools_deployment ( 1451 | notice ("Oracle Client patches do NOT exist") 1452 | $oracleclient_patches_list = undef 1453 | } 1454 | + if ($redeploy == 'true') or ($oracleclient_redeploy == 'true') { 1455 | + $oc_redeploy = true 1456 | + } else { 1457 | + $oc_redeploy = false 1458 | + } 1459 | pt_deploy_oracleclient { $oracleclient_tag: 1460 | ensure => $ensure, 1461 | deploy_user => $oracle_install_user, 1462 | @@ -118,7 +171,7 @@ class pt_setup::tools_deployment ( 1463 | oracle_inventory_location => $inventory_location, 1464 | oracle_inventory_user => $oracle_install_user, 1465 | oracle_inventory_group => $oracle_install_group, 1466 | - redeploy => $redeploy, 1467 | + redeploy => $oc_redeploy, 1468 | remove => $oracleclient_remove, 1469 | patch_list => $oracleclient_patches_list, 1470 | } 1471 | @@ -146,6 +199,11 @@ class pt_setup::tools_deployment ( 1472 | $tools_patches_list = undef 1473 | } 1474 | 1475 | + if ($redeploy == 'true') or ($pshome_redeploy == 'true') { 1476 | + $pt_redeploy = true 1477 | + } else { 1478 | + $pt_redeploy = false 1479 | + } 1480 | # deploy each Tools component 1481 | pt_deploy_pshome { $pshome_tag: 1482 | ensure => $ensure, 1483 | @@ -156,7 +214,7 @@ class pt_setup::tools_deployment ( 1484 | deploy_location => $pshome_location, 1485 | extract_only => $extract_only, 1486 | unicode_db => $unicode_db, 1487 | - redeploy => $redeploy, 1488 | + redeploy => $pt_redeploy, 1489 | remove => $pshome_remove, 1490 | patch_list => $tools_patches_list, 1491 | } 1492 | @@ -178,30 +236,83 @@ class pt_setup::tools_deployment ( 1493 | $jdk_patches_list = undef 1494 | } 1495 | 1496 | + if ($redeploy == 'true') or ($jdk_redeploy == 'true') { 1497 | + $java_redeploy = true 1498 | + } else { 1499 | + $java_redeploy = false 1500 | + } 1501 | pt_deploy_jdk { $jdk_tag: 1502 | ensure => $ensure, 1503 | deploy_user => $tools_install_user, 1504 | deploy_user_group => $tools_install_group, 1505 | archive_file => $jdk_archive_file, 1506 | deploy_location => $jdk_location, 1507 | - redeploy => $redeploy, 1508 | + redeploy => $java_redeploy, 1509 | remove => $jdk_remove, 1510 | patch_list => $jdk_patches_list, 1511 | } 1512 | + # Make sure both service and domain user have access to JDK 1513 | + if $::osfamily == 'windows' and $ensure == present { 1514 | + acl { 'jdk_domain_user' : 1515 | + target => $jdk_location, 1516 | + purge => false, 1517 | + permissions => [ 1518 | + { identity => $::identity[user], rights => ['write','read','execute'] } 1519 | + ], 1520 | + } 1521 | + if $appserver_service_user != undef and $domain_type in [ 'all', 'appserver', 'appbatch'] { 1522 | + acl { 'jdk_app_service' : 1523 | + target => $jdk_location, 1524 | + purge => false, 1525 | + permissions => [ 1526 | + { identity => $appserver_service_user, rights => ['write','read','execute'] } 1527 | + ], 1528 | + } 1529 | + } 1530 | + if $pia_service_user != undef and $domain_type in [ 'all', 'pia'] { 1531 | + acl { 'jdk_pia_service' : 1532 | + target => $jdk_location, 1533 | + purge => false, 1534 | + permissions => [ 1535 | + { identity => $pia_service_user, rights => ['write','read','execute'] } 1536 | + ], 1537 | + } 1538 | + } 1539 | + if $prcs_service_user != undef and $domain_type in [ 'all', 'prcs', 'appbatch'] { 1540 | + acl { 'jdk_prcs_service' : 1541 | + target => $jdk_location, 1542 | + purge => false, 1543 | + permissions => [ 1544 | + { identity => $prcs_service_user, rights => ['write','read','execute'] } 1545 | + ], 1546 | + } 1547 | + } 1548 | + } 1549 | } 1550 | 1551 | # ### Weblogic ### 1552 | - $weblogic_patches = hiera('weblogic_patches', '') 1553 | - if ($weblogic_patches) and ($weblogic_patches != '') { 1554 | - notice ("Weblogic patches do exist") 1555 | - $weblogic_patches_list = values($weblogic_patches) 1556 | + if $domain_type == 'all' or $domain_type == 'pia' { 1557 | + $weblogic_ensure = $ensure 1558 | + $weblogic_patches = hiera('weblogic_patches', '') 1559 | + if ($weblogic_patches) and ($weblogic_patches != '') { 1560 | + notice ("Weblogic patches do exist") 1561 | + $weblogic_patches_list = values($weblogic_patches) 1562 | + } 1563 | + else { 1564 | + notice ("Weblogic patches do NOT exist") 1565 | + $weblogic_patches_list = undef 1566 | + } 1567 | } 1568 | else { 1569 | - notice ("Weblogic patches do NOT exist") 1570 | - $weblogic_patches_list = undef 1571 | + $weblogic_ensure = absent 1572 | + } 1573 | + if ($redeploy == 'true') or ($weblogic_redeploy == 'true') { 1574 | + $wl_redeploy = true 1575 | + } else { 1576 | + $wl_redeploy = false 1577 | } 1578 | pt_deploy_weblogic { $weblogic_tag: 1579 | - ensure => $ensure, 1580 | + ensure => $weblogic_ensure, 1581 | deploy_user => $tools_install_user, 1582 | deploy_user_group => $tools_install_group, 1583 | archive_file => $weblogic_archive_file, 1584 | @@ -210,23 +321,46 @@ class pt_setup::tools_deployment ( 1585 | oracle_inventory_user => $oracle_install_user, 1586 | oracle_inventory_group => $oracle_install_group, 1587 | jdk_location => $jdk_location, 1588 | - redeploy => $redeploy, 1589 | + redeploy => $wl_redeploy, 1590 | remove => $weblogic_remove, 1591 | patch_list => $weblogic_patches_list, 1592 | } 1593 | 1594 | # ### Tuxedo ### 1595 | - $tuxedo_patches = hiera('tuxedo_patches', '') 1596 | - if ($tuxedo_patches) and ($tuxedo_patches != '') { 1597 | - notice ("Tuxedo patches do exist") 1598 | - $tuxedo_patches_list = values($tuxedo_patches) 1599 | + if $::osfamily == 'windows' and $weblogic_ensure == present and $pia_service_user != undef { 1600 | + acl { "$weblogic_location": 1601 | + permissions => [ 1602 | + { 1603 | + identity => $pia_service_user, 1604 | + rights => ['write','read','execute'], 1605 | + purge => false, 1606 | + } 1607 | + ], 1608 | + } 1609 | + } 1610 | + if $domain_type == 'all' or $domain_type != 'pia' { 1611 | + $tuxedo_ensure = $ensure 1612 | + $tuxedo_patches = hiera('tuxedo_patches', '') 1613 | + if ($tuxedo_patches) and ($tuxedo_patches != '') { 1614 | + notice ("Tuxedo patches do exist") 1615 | + $tuxedo_patches_list = values($tuxedo_patches) 1616 | + } 1617 | + else { 1618 | + notice ("Tuxedo patches do NOT exist") 1619 | + $tuxedo_patches_list = undef 1620 | + } 1621 | + 1622 | } 1623 | else { 1624 | - notice ("Tuxedo patches do NOT exist") 1625 | - $tuxedo_patches_list = undef 1626 | + $tuxedo_ensure = absent 1627 | + } 1628 | + if ($redeploy == 'true') or ($tuxedo_redeploy == 'true') { 1629 | + $tux_redeploy = true 1630 | + } else { 1631 | + $tux_redeploy = false 1632 | } 1633 | pt_deploy_tuxedo { $tuxedo_tag: 1634 | - ensure => $ensure, 1635 | + ensure => $tuxedo_ensure, 1636 | deploy_user => $tools_install_user, 1637 | deploy_user_group => $tools_install_group, 1638 | archive_file => $tuxedo_archive_file, 1639 | @@ -234,10 +368,23 @@ class pt_setup::tools_deployment ( 1640 | oracle_inventory_location => $inventory_location, 1641 | oracle_inventory_user => $oracle_install_user, 1642 | oracle_inventory_group => $oracle_install_group, 1643 | - redeploy => $redeploy, 1644 | + redeploy => $tux_redeploy, 1645 | remove => $tuxedo_remove, 1646 | patch_list => $tuxedo_patches_list, 1647 | jdk_location => $jdk_location, 1648 | + service_user => $tuxedo_service_user, 1649 | + service_pwd => $tuxedo_service_pwd 1650 | + } 1651 | + if $::osfamily == 'windows' and $tuxedo_ensure == present and $tuxedo_service_user != undef { 1652 | + acl { "$tuxedo_location": 1653 | + permissions => [ 1654 | + { 1655 | + identity => $tuxedo_service_user, 1656 | + rights => ['write','read','execute'], 1657 | + purge => false, 1658 | + } 1659 | + ], 1660 | + } 1661 | } 1662 | 1663 | # ### Oracle HTTP Server ### 1664 | @@ -251,6 +398,11 @@ class pt_setup::tools_deployment ( 1665 | fail("Unable to locate archive (tgz) file for OHS in ${tools_archive_location}") 1666 | } 1667 | } 1668 | + if ($redeploy == 'true') or ($ohs_redeploy == 'true') { 1669 | + $http_redeploy = true 1670 | + } else { 1671 | + $http_redeploy = false 1672 | + } 1673 | pt_deploy_ohs { $ohs_tag: 1674 | ensure => $ensure, 1675 | deploy_user => $tools_install_user, 1676 | @@ -261,7 +413,7 @@ class pt_setup::tools_deployment ( 1677 | oracle_inventory_user => $oracle_install_user, 1678 | oracle_inventory_group => $oracle_install_group, 1679 | jdk_location => $jdk_location, 1680 | - redeploy => $redeploy, 1681 | + redeploy => $http_redeploy, 1682 | remove => $ohs_remove, 1683 | } 1684 | } 1685 | -------------------------------------------------------------------------------- /patches/pt_dpk_85711.patch: -------------------------------------------------------------------------------- 1 | diff --git a/pt_config/files/pt_appserver/appserver_win_service.rb.erb b/pt_config/files/pt_appserver/appserver_win_service.rb.erb 2 | index 8d29c2f..bc1d287 100644 3 | --- a/pt_config/files/pt_appserver/appserver_win_service.rb.erb 4 | +++ b/pt_config/files/pt_appserver/appserver_win_service.rb.erb 5 | @@ -1,4 +1,4 @@ 6 | -LOG_FILE = "<%= ps_cfg_home %>/appserv/<%= domain_name %>/appserver_win_service.log" 7 | +LOG_FILE = "<%= ps_cfg_home.gsub('\\', '/') %>/appserv/<%= domain_name %>/appserver_win_service.log" 8 | begin 9 | 10 | require 'rubygems' 11 | @@ -15,7 +15,11 @@ begin 12 | end 13 | 14 | def service_main(*args) 15 | - system("<%= ps_home %>/appserv/psadmin -c start -d <%= domain_name %>") 16 | + ENV["PS_APP_HOME"] = "<%= ps_app_home %>" 17 | + ENV["PS_HOME"] = "<%= ps_home %>" 18 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 19 | + ENV["PS_CUST_HOME"] = "<%= ps_cust_home %>" 20 | + system("<%= ps_home.gsub('\\', '/') %>/appserv/psadmin -c start -d <%= domain_name %>") 21 | 22 | # While we're in here the daemon is running. 23 | while running? 24 | @@ -31,7 +35,11 @@ begin 25 | def service_stop 26 | msg = 'Received stop signal at: ' + Time.now.to_s 27 | File.open(LOG_FILE, 'a'){ |f| f.puts msg } 28 | - system("<%= ps_home %>/appserv/psadmin -c stop -d <%= domain_name %>") 29 | + ENV["PS_APP_HOME"] = "<%= ps_app_home %>" 30 | + ENV["PS_HOME"] = "<%= ps_home %>" 31 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 32 | + ENV["PS_CUST_HOME"] = "<%= ps_cust_home %>" 33 | + system("<%= ps_home.gsub('\\', '/') %>/appserv/psadmin -c stop -d <%= domain_name %>") 34 | end 35 | 36 | # This event triggers when the service receives a signal to pause. 37 | diff --git a/pt_config/files/pt_pia/pia_win_service.rb.erb b/pt_config/files/pt_pia/pia_win_service.rb.erb 38 | index 5dee9c4..46bd65e 100644 39 | --- a/pt_config/files/pt_pia/pia_win_service.rb.erb 40 | +++ b/pt_config/files/pt_pia/pia_win_service.rb.erb 41 | @@ -1,4 +1,4 @@ 42 | -LOG_FILE = "<%= ps_cfg_home %>/webserv/<%= domain_name %>/pia_win_service.log" 43 | +LOG_FILE = "<%= ps_cfg_home.gsub('\\', '/') %>/webserv/<%= domain_name %>/pia_win_service.log" 44 | begin 45 | 46 | require 'rubygems' 47 | @@ -15,7 +15,8 @@ begin 48 | end 49 | 50 | def service_main(*args) 51 | - system("<%= ps_cfg_home %>/webserv/<%= domain_name %>/bin/startPIA.cmd") 52 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 53 | + system("<%= ps_cfg_home.gsub('\\', '/') %>/webserv/<%= domain_name %>/bin/startPIA.cmd") 54 | 55 | # While we're in here the daemon is running. 56 | while running? 57 | @@ -31,7 +32,8 @@ begin 58 | def service_stop 59 | msg = 'Received stop signal at: ' + Time.now.to_s 60 | File.open(LOG_FILE, 'a'){ |f| f.puts msg } 61 | - system("<%= ps_cfg_home %>/webserv/<%= domain_name %>/bin/stopPIA.cmd") 62 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 63 | + system("<%= ps_cfg_home.gsub('\\', '/') %>/webserv/<%= domain_name %>/bin/stopPIA.cmd") 64 | end 65 | 66 | # This event triggers when the service receives a signal to pause. 67 | diff --git a/pt_config/files/pt_prcs/prcs_win_service.rb.erb b/pt_config/files/pt_prcs/prcs_win_service.rb.erb 68 | index 30e87e2..f8b3d28 100644 69 | --- a/pt_config/files/pt_prcs/prcs_win_service.rb.erb 70 | +++ b/pt_config/files/pt_prcs/prcs_win_service.rb.erb 71 | @@ -1,4 +1,4 @@ 72 | -LOG_FILE = "<%= ps_cfg_home %>/appserv/prcs/<%= domain_name %>/prcs_win_service.log" 73 | +LOG_FILE = "<%= ps_cfg_home.gsub('\\', '/') %>/appserv/prcs/<%= domain_name %>/prcs_win_service.log" 74 | begin 75 | 76 | require 'rubygems' 77 | @@ -15,7 +15,11 @@ begin 78 | end 79 | 80 | def service_main(*args) 81 | - system("<%= ps_home %>/appserv/psadmin -p start -d <%= domain_name %>") 82 | + ENV["PS_APP_HOME"] = "<%= ps_app_home %>" 83 | + ENV["PS_HOME"] = "<%= ps_home %>" 84 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 85 | + ENV["PS_CUST_HOME"] = "<%= ps_cust_home %>" 86 | + system("<%= ps_home.gsub('\\', '/') %>/appserv/psadmin -p start -d <%= domain_name %>") 87 | 88 | # While we're in here the daemon is running. 89 | while running? 90 | @@ -31,7 +35,11 @@ begin 91 | def service_stop 92 | msg = 'Received stop signal at: ' + Time.now.to_s 93 | File.open(LOG_FILE, 'a'){ |f| f.puts msg } 94 | - system("<%= ps_home %>/appserv/psadmin -p stop -d <%= domain_name %>") 95 | + ENV["PS_APP_HOME"] = "<%= ps_app_home %>" 96 | + ENV["PS_HOME"] = "<%= ps_home %>" 97 | + ENV["PS_CFG_HOME"] = "<%= ps_cfg_home %>" 98 | + ENV["PS_CUST_HOME"] = "<%= ps_cust_home %>" 99 | + system("<%= ps_home.gsub('\\', '/') %>/appserv/psadmin -p stop -d <%= domain_name %>") 100 | end 101 | 102 | # This event triggers when the service receives a signal to pause. 103 | diff --git a/pt_config/lib/pt_comp_utils/webserver.rb b/pt_config/lib/pt_comp_utils/webserver.rb 104 | index 5953262..c3fcc8c 100644 105 | --- a/pt_config/lib/pt_comp_utils/webserver.rb 106 | +++ b/pt_config/lib/pt_comp_utils/webserver.rb 107 | @@ -212,6 +212,7 @@ module PtCompUtils 108 | cmd_suffix = '' 109 | classpath = "%CLASSPATH%" 110 | path_separator = ';' 111 | + shell_suffix = 'cmd' 112 | elsif Facter.value(:kernel) == 'AIX' or 113 | Facter.value(:osfamily) == 'Solaris' or 114 | Facter.value(:osfamily) == 'HP-UX' 115 | @@ -223,6 +224,7 @@ module PtCompUtils 116 | cmd_suffix = "\"" 117 | classpath = "$CLASSPATH" 118 | path_separator = ':' 119 | + shell_suffix = 'sh' 120 | else 121 | if Puppet.features.root? 122 | cmd_prefix = "su - #{os_user} -p -c \"" 123 | @@ -232,6 +234,7 @@ module PtCompUtils 124 | cmd_suffix = "\"" 125 | classpath = "$CLASSPATH" 126 | path_separator = ':' 127 | + shell_suffix = 'sh' 128 | end 129 | 130 | # setup weblogic environment 131 | @@ -241,8 +244,8 @@ module PtCompUtils 132 | ENV['CLASSPATH'] = ".#{path_separator}#{wl_jar_file}" 133 | 134 | java_opts = "-Dwlst.offline.log=#{wlst_log_file} -cp #{classpath}" 135 | - wl_status_cmd = "#{cmd_prefix} java #{java_opts} weblogic.WLST " + \ 136 | - "-skipWLSModuleScanning #{wl_script_file} #{cmd_suffix}" 137 | + wlst_cmd = File.join(bea_home, 'oracle_common', 'common', 'bin', "wlst.#{shell_suffix}") 138 | + wl_status_cmd = "#{cmd_prefix} #{wlst_cmd} #{wl_script_file} #{cmd_suffix}" 139 | 140 | Puppet.debug("WLST status command: #{wl_status_cmd}") 141 | 142 | @@ -300,6 +303,7 @@ module PtCompUtils 143 | count = 1 144 | status = 'UNKNOWN' 145 | while status != 'RUNNING' 146 | + Puppet.debug("[#{count}] Checking WebLogic running status...") 147 | begin 148 | Open3.popen3(wl_status_cmd) do |stdin, out, err| 149 | stdin.close 150 | diff --git a/pt_config/lib/puppet/provider/psftdomain.rb b/pt_config/lib/puppet/provider/psftdomain.rb 151 | index ea180cc..ad8f54c 100644 152 | --- a/pt_config/lib/puppet/provider/psftdomain.rb 153 | +++ b/pt_config/lib/puppet/provider/psftdomain.rb 154 | @@ -330,8 +330,15 @@ class Puppet::Provider::PsftDomain < Puppet::Provider 155 | cmd_concat = " && " 156 | 157 | if Facter.value(:osfamily) == 'windows' 158 | + # generate a batch script to avoid environment variables being resolved when passed as %%ENV%% 159 | + psadmin_script_file = File.join(Dir.tmpdir(), 'psadmin_configure.bat') 160 | command = "#{psadmin_cmd} #{domain_type} configure -d #{domain_name} #{config_args}" 161 | - command_output = execute_command(command) 162 | + File.open(psadmin_script_file, 'w') do |script_file| 163 | + script_file.puts("#{command}") 164 | + end 165 | + File.chmod(0755, psadmin_script_file) 166 | + command_output = execute_command(psadmin_script_file) 167 | + File.delete(psadmin_script_file) 168 | elsif Facter.value(:osfamily) == 'Solaris' 169 | if Puppet.features.root? 170 | command_output = domain_cmd('-', resource[:os_user], '-c', 171 | diff --git a/pt_config/lib/puppet/provider/pt_appserver_domain/appserver_domain.rb b/pt_config/lib/puppet/provider/pt_appserver_domain/appserver_domain.rb 172 | index 368f649..6b3aa38 100644 173 | --- a/pt_config/lib/puppet/provider/pt_appserver_domain/appserver_domain.rb 174 | +++ b/pt_config/lib/puppet/provider/pt_appserver_domain/appserver_domain.rb 175 | @@ -113,6 +113,7 @@ Puppet::Type.type(:pt_appserver_domain).provide :appserver_domain, 176 | domain_name = resource[:domain_name] 177 | cfg_home_dir = resource[:ps_cfg_home_dir] 178 | 179 | + FileUtils.mkdir_p cfg_home_dir 180 | domain_dir = File.join(cfg_home_dir, 'appserv', domain_name) 181 | if File.exist?(domain_dir) 182 | Puppet.debug("Removing Application Server domain directory: #{domain_dir}") 183 | diff --git a/pt_config/lib/puppet/provider/pt_appserver_domain_boot/appserver_domain_boot.rb b/pt_config/lib/puppet/provider/pt_appserver_domain_boot/appserver_domain_boot.rb 184 | index 1f2fad7..d68fc88 100644 185 | --- a/pt_config/lib/puppet/provider/pt_appserver_domain_boot/appserver_domain_boot.rb 186 | +++ b/pt_config/lib/puppet/provider/pt_appserver_domain_boot/appserver_domain_boot.rb 187 | @@ -72,6 +72,10 @@ Puppet::Type.type(:pt_appserver_domain_boot).provide :appserver_domain_boot, 188 | domain_name = resource[:domain_name] 189 | ps_cfg_home = resource[:ps_cfg_home_dir] 190 | ps_home = resource[:ps_home_dir] 191 | + ps_app_home = resource[:ps_app_home_dir] 192 | + ps_cust_home = resource[:ps_cust_home_dir] 193 | + service_user = resource[:service_user] 194 | + service_pwd = resource[:service_pwd] 195 | 196 | appserver_win_service_file = File.join(ps_cfg_home, 'appserv', domain_name, "appserver_win_service.rb") 197 | appserver_win_service_content = template('puppet:///modules/pt_config/pt_appserver/appserver_win_service.rb.erb', 198 | @@ -102,7 +106,9 @@ Puppet::Type.type(:pt_appserver_domain_boot).provide :appserver_domain_boot, 199 | :binary_path_name => "#{ruby_executable.chomp} #{appserver_win_service_file}", 200 | :load_order_group => 'Network', 201 | :dependencies => nil, 202 | - :display_name => appserver_domain_service 203 | + :display_name => appserver_domain_service, 204 | + :service_start_name => "#{service_user}", 205 | + :password => "#{service_pwd}" 206 | }) 207 | rescue Exception => e 208 | if (e.message.include?('The specified service already exists') || 209 | diff --git a/pt_config/lib/puppet/provider/pt_prcs_domain_boot/prcs_domain_boot.rb b/pt_config/lib/puppet/provider/pt_prcs_domain_boot/prcs_domain_boot.rb 210 | index 7868399..ef1b72e 100644 211 | --- a/pt_config/lib/puppet/provider/pt_prcs_domain_boot/prcs_domain_boot.rb 212 | +++ b/pt_config/lib/puppet/provider/pt_prcs_domain_boot/prcs_domain_boot.rb 213 | @@ -67,6 +67,10 @@ Puppet::Type.type(:pt_prcs_domain_boot).provide :prcs_domain_boot, 214 | domain_name = resource[:domain_name] 215 | ps_cfg_home = resource[:ps_cfg_home_dir] 216 | ps_home = resource[:ps_home_dir] 217 | + ps_app_home = resource[:ps_app_home_dir] 218 | + ps_cust_home = resource[:ps_cust_home_dir] 219 | + service_user = resource[:service_user] 220 | + service_pwd = resource[:service_pwd] 221 | 222 | prcs_win_service_file = File.join(ps_cfg_home, 'appserv', 'prcs', domain_name, "prcs_win_service.rb") 223 | prcs_win_service_content = template('puppet:///modules/pt_config/pt_prcs/prcs_win_service.rb.erb', 224 | @@ -97,7 +101,9 @@ Puppet::Type.type(:pt_prcs_domain_boot).provide :prcs_domain_boot, 225 | :binary_path_name => "#{ruby_executable.chomp} #{prcs_win_service_file}", 226 | :load_order_group => 'Network', 227 | :dependencies => nil, 228 | - :display_name => prcs_domain_service 229 | + :display_name => prcs_domain_service, 230 | + :service_start_name => "#{service_user}", 231 | + :password => "#{service_pwd}" 232 | }) 233 | rescue Exception => e 234 | if (e.message.include?('The specified service already exists') || 235 | diff --git a/pt_config/lib/puppet/provider/pt_webserver_domain/weblogic_domain.rb b/pt_config/lib/puppet/provider/pt_webserver_domain/weblogic_domain.rb 236 | index ba901bc..d60ef3d 100644 237 | --- a/pt_config/lib/puppet/provider/pt_webserver_domain/weblogic_domain.rb 238 | +++ b/pt_config/lib/puppet/provider/pt_webserver_domain/weblogic_domain.rb 239 | @@ -153,8 +153,10 @@ Puppet::Type.type(:pt_webserver_domain).provide :weblogic_domain do 240 | 241 | if Facter.value(:osfamily) == 'windows' 242 | install_cmd = File.join(install_dir, 'setup.bat') 243 | + bea_home = "#{@webserver_hash[:webserver_home]}" 244 | + wl_env_cmd = File.join(bea_home, 'wlserver', 'server', 'bin', 'setWLSEnv.cmd') 245 | 246 | - command = "#{install_cmd} -i silent -DRES_FILE_PATH=\"#{response_file}\"" 247 | + command = "#{wl_env_cmd} && #{install_cmd} -i silent -DRES_FILE_PATH=\"#{response_file}\"" 248 | execute_command(command, {}, true) 249 | 250 | elsif Facter.value(:osfamily) == 'Solaris' 251 | @@ -215,19 +217,7 @@ Puppet::Type.type(:pt_webserver_domain).provide :weblogic_domain do 252 | extract_file_path = File.join(temp_dir_name, "zip_extract.ps1") 253 | extract_file = File.open(extract_file_path, 'w') 254 | 255 | - extract_file.puts("Try {") 256 | - extract_file.puts(" $shell = new-object -com shell.application") 257 | - extract_file.puts(" $zip = $shell.NameSpace(\"#{patch}\")") 258 | - extract_file.puts(" ForEach($item in $zip.items()) {") 259 | - extract_file.puts(" $shell.Namespace(\"#{domain_dir}\").CopyHere($item, 0x14)") 260 | - extract_file.puts(" }") 261 | - extract_file.puts(" Exit 0") 262 | - extract_file.puts("}") 263 | - extract_file.puts("Catch {") 264 | - extract_file.puts(" $error_message = $_.Exception.Message") 265 | - extract_file.puts(" Write-Host $error_message") 266 | - extract_file.puts(" Exit 1") 267 | - extract_file.puts("}") 268 | + extract_file.puts("Expand-Archive -Path \"#{patch}\" -DestinationPath \"#{domain_dir}\" -Force -ErrorAction Stop") 269 | extract_file.close 270 | File.chmod(0755, extract_file_path) 271 | Puppet.debug(File.read(extract_file_path)) 272 | @@ -332,9 +322,15 @@ Puppet::Type.type(:pt_webserver_domain).provide :weblogic_domain do 273 | 274 | def post_create 275 | domain_name = resource[:domain_name] 276 | + os_user = resource[:os_user] 277 | 278 | Puppet.debug("Post Create domain: #{domain_name}") 279 | 280 | + if Facter.value(:osfamily) == 'windows' && os_user != nil 281 | + domain_dir = resource[:ps_cfg_home_dir] 282 | + perm_cmd = "icacls #{domain_dir} /grant #{os_user}:(OI)(CI)F /T > NUL" 283 | + system(perm_cmd) 284 | + end 285 | start_needed = false 286 | if ! resource[:config_settings].nil? 287 | @property_flush[:config_settings] = resource[:config_settings] 288 | diff --git a/pt_config/lib/puppet/provider/pt_webserver_domain_boot/webserver_domain_boot.rb b/pt_config/lib/puppet/provider/pt_webserver_domain_boot/webserver_domain_boot.rb 289 | index 131549b..495bb69 100644 290 | --- a/pt_config/lib/puppet/provider/pt_webserver_domain_boot/webserver_domain_boot.rb 291 | +++ b/pt_config/lib/puppet/provider/pt_webserver_domain_boot/webserver_domain_boot.rb 292 | @@ -65,6 +65,7 @@ Puppet::Type.type(:pt_webserver_domain_boot).provide :webserver_domain_boot do 293 | domain_name = resource[:domain_name] 294 | ps_cfg_home = resource[:ps_cfg_home_dir] 295 | domain_dir = File.join(ps_cfg_home, 'webserv', domain_name, 'bin') 296 | + os_user = resource[:os_user] 297 | 298 | Puppet.debug("Getting status of domain: #{domain_name}") 299 | 300 | @@ -72,6 +73,10 @@ Puppet::Type.type(:pt_webserver_domain_boot).provide :webserver_domain_boot do 301 | domain_status = :running 302 | if Facter.value(:osfamily) == 'windows' 303 | status_cmd = File.join(domain_dir, 'singleserverStatus.cmd') 304 | + # make sure os user has access to execute command 305 | + pia_domain_dir = File.join(ps_cfg_home, 'webserv', domain_name) 306 | + perm_cmd = "icacls #{pia_domain_dir} /grant #{os_user}:(OI)(CI)F /T > NUL" 307 | + execute_command(perm_cmd) 308 | else 309 | os_user = resource[:os_user] 310 | if os_user_exists?(os_user) == false 311 | @@ -155,6 +160,8 @@ Puppet::Type.type(:pt_webserver_domain_boot).provide :webserver_domain_boot do 312 | domain_name = resource[:domain_name] 313 | ps_cfg_home = resource[:ps_cfg_home_dir] 314 | domain_dir = File.join(ps_cfg_home, 'webserv', domain_name, 'bin') 315 | + service_user = resource[:service_user] 316 | + service_pwd = resource[:service_pwd] 317 | 318 | Puppet.debug("Starting domain: #{domain_name}") 319 | 320 | @@ -189,7 +196,9 @@ Puppet::Type.type(:pt_webserver_domain_boot).provide :webserver_domain_boot do 321 | :binary_path_name => "#{ruby_executable.chomp} #{pia_win_service_file}", 322 | :load_order_group => 'Network', 323 | :dependencies => nil, 324 | - :display_name => pia_domain_service 325 | + :display_name => pia_domain_service, 326 | + :service_start_name => "#{service_user}", 327 | + :password => "#{service_pwd}" 328 | }) 329 | rescue Exception => e 330 | if (e.message.include?('The specified service already exists') || 331 | diff --git a/pt_config/lib/puppet/type/pt_acm_plugin.rb b/pt_config/lib/puppet/type/pt_acm_plugin.rb 332 | index 971275a..6229958 100644 333 | --- a/pt_config/lib/puppet/type/pt_acm_plugin.rb 334 | +++ b/pt_config/lib/puppet/type/pt_acm_plugin.rb 335 | @@ -71,13 +71,15 @@ module Puppet 336 | raise ArgumentError, "Properties name/value pairs must be " + 337 | "separated by an =" 338 | else 339 | - prop.split(', ').each do |prop_item| 340 | - if ['pwd', 'pass'].any? {|var| prop_item.split('=')[0].include? var} 341 | - Puppet.debug("Got the property: #{prop_item.gsub(prop_item.split('=')[1], '*****')}") 342 | - else 343 | - Puppet.debug("Got the property: #{prop_item}") 344 | - end 345 | - end 346 | + # DJI - 6/6/18 - .include? was causing errors when trying to hide passwords 347 | + # The provider acm_plugin.rb will runs the same code 348 | + #prop.split(', ').each do |prop_item| 349 | + # if ['pwd', 'pass'].any? {|var| prop_item.split('=')[0].include? var} 350 | + # Puppet.debug("Got the property: #{prop_item.gsub(prop_item.split('=')[1], '*****')}") 351 | + # else 352 | + # Puppet.debug("Got the property: #{prop_item}") 353 | + # end 354 | + #end 355 | end 356 | end 357 | end 358 | diff --git a/pt_config/lib/puppet/type/pt_appserver_domain.rb b/pt_config/lib/puppet/type/pt_appserver_domain.rb 359 | index bb6d941..43e0a0c 100644 360 | --- a/pt_config/lib/puppet/type/pt_appserver_domain.rb 361 | +++ b/pt_config/lib/puppet/type/pt_appserver_domain.rb 362 | @@ -35,10 +35,16 @@ module Puppet 363 | 364 | validate do 365 | validate_domain_params(self[:os_user], self[:ps_home_dir]) 366 | - validate_keyvalue_array(self[:feature_settings]) 367 | + if self[:ps_cfg_home_dir].nil? 368 | + self[:ps_cfg_home_dir] = self[:ps_home_dir] 369 | + end 370 | + 371 | + if self[:ensure] == 'present' 372 | + validate_keyvalue_array(self[:feature_settings]) 373 | 374 | - if self[:ensure] == 'present' && self[:db_home_dir].nil? 375 | - fail("db_home_dir attribute should be specified") 376 | + if self[:db_home_dir].nil? 377 | + fail("db_home_dir attribute should be specified") 378 | + end 379 | end 380 | end 381 | 382 | diff --git a/pt_config/lib/puppet/type/pt_appserver_domain_boot.rb b/pt_config/lib/puppet/type/pt_appserver_domain_boot.rb 383 | index 8112e58..c9d6c7f 100644 384 | --- a/pt_config/lib/puppet/type/pt_appserver_domain_boot.rb 385 | +++ b/pt_config/lib/puppet/type/pt_appserver_domain_boot.rb 386 | @@ -48,6 +48,10 @@ module Puppet 387 | parameter :os_user 388 | parameter :ps_home_dir 389 | parameter :ps_cfg_home_dir 390 | + parameter :ps_app_home_dir 391 | + parameter :ps_cust_home_dir 392 | + parameter :service_user 393 | + parameter :service_pwd 394 | 395 | # Basically just a synonym for restarting. Used to respond 396 | # to events. 397 | diff --git a/pt_config/lib/puppet/type/pt_prcs_domain.rb b/pt_config/lib/puppet/type/pt_prcs_domain.rb 398 | index 93cca7a..9f0ce93 100644 399 | --- a/pt_config/lib/puppet/type/pt_prcs_domain.rb 400 | +++ b/pt_config/lib/puppet/type/pt_prcs_domain.rb 401 | @@ -54,7 +54,7 @@ module Puppet 402 | validate do |value| 403 | 404 | prcs_features = 405 | - [ "MSTRSRV", "APPENG", "KIOSK", "DOMAIN_GW", "SERVER_EVENTS" ] 406 | + [ "MSTRSRV", "APPENG", "PPM", "DOMAIN_GW", "SERVER_EVENTS" ] 407 | 408 | value = [value] unless value.is_a? Array 409 | 410 | diff --git a/pt_config/lib/puppet/type/pt_prcs_domain_boot.rb b/pt_config/lib/puppet/type/pt_prcs_domain_boot.rb 411 | index b25185f..041b2a0 100644 412 | --- a/pt_config/lib/puppet/type/pt_prcs_domain_boot.rb 413 | +++ b/pt_config/lib/puppet/type/pt_prcs_domain_boot.rb 414 | @@ -48,6 +48,10 @@ module Puppet 415 | parameter :os_user 416 | parameter :ps_home_dir 417 | parameter :ps_cfg_home_dir 418 | + parameter :ps_app_home_dir 419 | + parameter :ps_cust_home_dir 420 | + parameter :service_user 421 | + parameter :service_pwd 422 | 423 | # Basically just a synonym for restarting. Used to respond 424 | # to events. 425 | diff --git a/pt_config/lib/puppet/type/pt_webserver_domain.rb b/pt_config/lib/puppet/type/pt_webserver_domain.rb 426 | index 24c284f..e666a07 100644 427 | --- a/pt_config/lib/puppet/type/pt_webserver_domain.rb 428 | +++ b/pt_config/lib/puppet/type/pt_webserver_domain.rb 429 | @@ -41,10 +41,13 @@ module Puppet 430 | 431 | validate_webserver_settings_array(ensure_value, self[:webserver_settings]) 432 | 433 | - # make sure atleast one site is specified 434 | - site_list = self[:site_list] 435 | - if site_list.nil? || site_list.empty? 436 | - fail("Atleast one site needs to be specified #{self[:site_list].inspect}") 437 | + # Only verify site_list if not uninstalling 438 | + if ensure_value != "absent" 439 | + # make sure atleast one site is specified 440 | + site_list = self[:site_list] 441 | + if site_list.nil? || site_list.empty? 442 | + fail("Atleast one site needs to be specified #{self[:site_list].inspect}") 443 | + end 444 | end 445 | 446 | # make sure the ps_cfg_home_dir is given 447 | @@ -232,11 +235,11 @@ module Puppet 448 | 449 | profile_name = webprofile_settings_hash[key_profile_name] 450 | # validate to make sure profile value is one of the predefined ones 451 | - valid_profile_names = [ "DEV", "KIOSK", "PROD", "TEST" ] 452 | - if ! valid_profile_names.include?(profile_name) 453 | - fail("Specified profile name '#{profile_name}' is not one of " + 454 | - "valid profile names '#{valid_profile_names.inspect}") 455 | - end 456 | + #valid_profile_names = [ "DEV", "KIOSK", "PROD", "TEST" ] 457 | + #if ! valid_profile_names.include?(profile_name) 458 | + # fail("Specified profile name '#{profile_name}' is not one of " + 459 | + # "valid profile names '#{valid_profile_names.inspect}") 460 | + #end 461 | webprofile_settings_hash[key_profile_user] 462 | profile_user_pwd = webprofile_settings_hash[key_profile_pwd] 463 | if profile_user_pwd.match(/^(?=.*[\w]).{8,}$/).nil? 464 | diff --git a/pt_config/lib/puppet/type/pt_webserver_domain_boot.rb b/pt_config/lib/puppet/type/pt_webserver_domain_boot.rb 465 | index 712859f..5c3ae81 100644 466 | --- a/pt_config/lib/puppet/type/pt_webserver_domain_boot.rb 467 | +++ b/pt_config/lib/puppet/type/pt_webserver_domain_boot.rb 468 | @@ -54,6 +54,8 @@ module Puppet 469 | property :ensure 470 | parameter :domain_name 471 | parameter :os_user 472 | + parameter :service_user 473 | + parameter :service_pwd 474 | parameter :ps_cfg_home_dir 475 | parameter :webserver_settings 476 | 477 | diff --git a/pt_config/lib/puppet/type/shared/service_pwd.rb b/pt_config/lib/puppet/type/shared/service_pwd.rb 478 | new file mode 100644 479 | index 0000000..11d0eff 480 | --- /dev/null 481 | +++ b/pt_config/lib/puppet/type/shared/service_pwd.rb 482 | @@ -0,0 +1,6 @@ 483 | +newparam(:service_pwd) do 484 | + include EasyType 485 | + 486 | + desc "The service pwd." 487 | + 488 | +end 489 | diff --git a/pt_config/lib/puppet/type/shared/service_user.rb b/pt_config/lib/puppet/type/shared/service_user.rb 490 | new file mode 100644 491 | index 0000000..22d14e1 492 | --- /dev/null 493 | +++ b/pt_config/lib/puppet/type/shared/service_user.rb 494 | @@ -0,0 +1,6 @@ 495 | +newparam(:service_user) do 496 | + include EasyType 497 | + 498 | + desc "The service user." 499 | + 500 | +end 501 | diff --git a/pt_deploy/lib/puppet/provider/pt_deploy_tuxedo/deploy_tuxedo.rb b/pt_deploy/lib/puppet/provider/pt_deploy_tuxedo/deploy_tuxedo.rb 502 | index 68278ca..1022360 100644 503 | --- a/pt_deploy/lib/puppet/provider/pt_deploy_tuxedo/deploy_tuxedo.rb 504 | +++ b/pt_deploy/lib/puppet/provider/pt_deploy_tuxedo/deploy_tuxedo.rb 505 | @@ -149,6 +149,18 @@ Puppet::Type.type(:pt_deploy_tuxedo).provide :deploy_tuxedo, 506 | raise Puppet::ExecutionFailure, "Tuxedo home cloning failed, error message: [#{ex.message}]" 507 | end 508 | 509 | + if Facter.value(:osfamily) == 'windows' 510 | + service_user = resource[:service_user] 511 | + service_pwd = resource[:service_pwd] 512 | + if !service_user.nil? && !service_pwd.nil? 513 | + Service.configure( 514 | + :service_name => 'ORACLE ProcMGR V12.2.2.0.0_VS2015', 515 | + :service_type => Service::WIN32_OWN_PROCESS, 516 | + :service_start_name => service_user, 517 | + :password => service_pwd 518 | + ) 519 | + end 520 | + end 521 | # install tuxedo patches if specified 522 | patch_list = resource[:patch_list] 523 | if ! patch_list.nil? 524 | @@ -161,9 +173,8 @@ Puppet::Type.type(:pt_deploy_tuxedo).provide :deploy_tuxedo, 525 | 526 | if Facter.value(:osfamily) == 'windows' 527 | Puppet.debug("Extracting Tuxedo patch on Windows platform") 528 | - 529 | - extract_zip_script = generate_windows_unzip_script(patch, tuxedo_patch_dir) 530 | - system("powershell -File #{extract_zip_script}") 531 | + ENV['JAVA_HOME'] = jdk_location 532 | + system("cd #{tuxedo_patch_dir} && #{jdk_location}\\bin\\jar -xvf #{patch}") 533 | if $? == 0 534 | Puppet.debug("Extraction of Tuxedo patch #{patch} successful") 535 | else 536 | @@ -216,22 +227,23 @@ Puppet::Type.type(:pt_deploy_tuxedo).provide :deploy_tuxedo, 537 | tuxedo_opatch_cmd = "#{tuxedo_home}\\OPatch\\opatch.bat" 538 | 539 | tuxedo_patch_dir = tuxedo_patch_dir.gsub('/', '\\') 540 | - patch_response_file = "#{tuxedo_patch_dir}\\opatch.rsp" 541 | - 542 | - target = open(patch_response_file, 'w') 543 | - target.puts("joe@foo.com") 544 | - target.puts("") 545 | - target.puts("") 546 | - target.puts("") 547 | - target.close() 548 | - File.chmod(0755, patch_response_file) 549 | - 550 | - patch_apply_cmd = "cd #{tuxedo_patch_dir} && #{tuxedo_opatch_cmd} apply #{tuxedo_patch_num} < #{patch_response_file}" 551 | - system(patch_apply_cmd) 552 | - if $? == 0 553 | - Puppet.debug("Tuxedo Patch #{tuxedo_patch_num} install successful") 554 | - else 555 | - Puppet.debug("Tuxedo Patch #{tuxedo_patch_num} install failed") 556 | + 557 | + patch_apply_cmd = "cd #{tuxedo_patch_dir} && #{tuxedo_opatch_cmd} apply #{tuxedo_patch_num} -silent" 558 | + 559 | + begin 560 | + Puppet.debug("Tuxedo patch apply command #{patch_apply_cmd}") 561 | + system("#{patch_apply_cmd}") 562 | + if $? == 0 563 | + Puppet.debug("Tuxedo Patch #{tuxedo_patch_num} install successful") 564 | + else 565 | + raise Puppet::ExecutionFailure, "Tuxedo patch installation failed: #{patch} failed" 566 | + end 567 | + rescue Puppet::ExecutionFailure => e 568 | + Puppet.debug("Tuxedo patch installation failed: #{e.message}") 569 | + raise Puppet::Error, "Installation of tuxedo patch #{patch} failed: #{e.message}" 570 | + ensure 571 | + FileUtils.remove_entry(tuxedo_patch_dir) 572 | + Puppet.debug("Deleted Tuxedo patch installation directory #{tuxedo_patch_dir}") 573 | end 574 | # start the services 575 | Puppet.debug("Starting Tuxedo ProcManager service [#{tuxedo_procmgr_service}]") 576 | @@ -426,6 +438,7 @@ Puppet::Type.type(:pt_deploy_tuxedo).provide :deploy_tuxedo, 577 | # remove the registry entry if present 578 | system("REG DELETE HKEY_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\KEY_#{oracle_home_name} /f >NUL 2>&1") 579 | system("REG DELETE HKEY_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\TUXEDO\\12.2.2.0.0_VS2015 /f >NUL 2>&1") 580 | + system("REG DELETE \"HKEY_LOCAL_MACHINE\\SOFTWARE\\ORACLE\\SALT\\12.2.2.0.0\\for Tuxedo 12.2.2.0.0\" /f >NUL 2>&1") 581 | 582 | # remove services if present 583 | remove_tuxedo_services() 584 | diff --git a/pt_deploy/lib/puppet/provider/pt_deploy_weblogic/deploy_weblogic.rb b/pt_deploy/lib/puppet/provider/pt_deploy_weblogic/deploy_weblogic.rb 585 | index d836173..7548824 100644 586 | --- a/pt_deploy/lib/puppet/provider/pt_deploy_weblogic/deploy_weblogic.rb 587 | +++ b/pt_deploy/lib/puppet/provider/pt_deploy_weblogic/deploy_weblogic.rb 588 | @@ -80,7 +80,9 @@ Puppet::Type.type(:pt_deploy_weblogic).provide :deploy_weblogic, 589 | deploy_user = resource[:deploy_user] 590 | deploy_group = resource[:deploy_user_group] 591 | 592 | + FileUtils.mkdir_p deploy_location 593 | deploy_parent_location = File.dirname(deploy_location) 594 | + Puppet.debug("deploy_location: #{deploy_location}") 595 | weblogic_archive_dir = Dir.mktmpdir(['wl', 'dir'], deploy_parent_location) 596 | FileUtils.chmod(0755, weblogic_archive_dir) 597 | 598 | @@ -205,6 +207,13 @@ Puppet::Type.type(:pt_deploy_weblogic).provide :deploy_weblogic, 599 | 600 | if Facter.value(:osfamily) == 'windows' 601 | Puppet.debug("Extracting WebLogic patch on Windows platform") 602 | + ENV['JAVA_HOME'] = jdk_location 603 | + system("cd #{weblogic_patch_dir} && #{jdk_location}\\bin\\jar -xvf #{patch}") 604 | + if $? == 0 605 | + Puppet.debug("Extraction of WebLogic patch #{patch} successful") 606 | + else 607 | + raise Puppet::ExecutionFailure, "Extraction of WebLogic patch #{patch} failed" 608 | + end 609 | else 610 | Puppet.debug("Extracting WebLogic patch on Non Windows platform") 611 | if Facter.value(:osfamily) == 'AIX' or Facter.value(:osfamily) == 'HP-UX' 612 | @@ -215,29 +224,55 @@ Puppet::Type.type(:pt_deploy_weblogic).provide :deploy_weblogic, 613 | change_ownership(deploy_user, deploy_group, weblogic_patch_dir) 614 | end 615 | begin 616 | - if Facter.value(:osfamily) != 'windows' 617 | - Puppet.debug("Installing WebLogic patch #{patch}") 618 | - ENV['ORACLE_HOME'] = deploy_location 619 | - Puppet.debug('Oracle Home environment variable' + ENV['ORACLE_HOME']) 620 | - 621 | - # get the patch number 622 | - weblogic_patch_num = Dir.entries(weblogic_patch_dir).reject {|f| !File.directory?(f) || f.include?('.')}[0] 623 | - Puppet.debug('Installing WebLogic patch number ' + weblogic_patch_num) 624 | - 625 | - patch_dir = "#{weblogic_patch_dir}/#{weblogic_patch_num}" 626 | - Puppet.debug("Installing Weblogic patch #{weblogic_patch_num} from #{patch_dir}") 627 | + Puppet.debug("Installing WebLogic patch #{patch}") 628 | + ENV['ORACLE_HOME'] = deploy_location 629 | + Puppet.debug('Oracle Home environment variable' + ENV['ORACLE_HOME']) 630 | + # get the patch number 631 | + weblogic_patch_num = Dir.entries(weblogic_patch_dir).reject {|f| f.include?('.')}[0] 632 | + Puppet.debug('Installing WebLogic patch number ' + weblogic_patch_num) 633 | + patch_dir = "#{weblogic_patch_dir}/#{weblogic_patch_num}" 634 | + opatch = Dir.glob("#{patch_dir}/**/opatch*.jar") 635 | + if Facter.value(:osfamily) == 'windows' 636 | + if opatch.empty? 637 | + Puppet.debug("Installing Weblogic patch #{weblogic_patch_num} from #{patch_dir}") 638 | + patch_apply_cmd = "cd #{patch_dir} && #{deploy_location}\\OPatch\\opatch " + \ 639 | + "apply -oh #{deploy_location} -silent -jdk #{jdk_location} -oop" 640 | + else 641 | + Puppet.debug("Installing OPatch patch #{weblogic_patch_num} from #{patch_dir}") 642 | + patch_apply_cmd = "#{jdk_location}\\bin\\java -jar #{patch_dir}\\opatch_generic.jar -silent oracle_home=#{deploy_location}" 643 | + end 644 | + 645 | + patch_apply_cmd = patch_apply_cmd.gsub('/', '\\') 646 | + weblogic_patch_dir = weblogic_patch_dir.gsub('/', '\\') 647 | + Puppet.debug("Weblogic patch apply command #{patch_apply_cmd}") 648 | + system("#{patch_apply_cmd}") 649 | + if $? != 0 650 | + raise Puppet::ExecutionFailure, "Weblogic patch installation failed: #{patch} failed" 651 | + end 652 | + else 653 | + if opatch.empty? 654 | + Puppet.debug("Installing Weblogic patch #{weblogic_patch_num} from #{patch_dir}") 655 | + patch_apply_cmd = "#{cmd_prefix} cd #{patch_dir} && #{deploy_location}/OPatch/opatch " + \ 656 | + "apply -oh #{deploy_location} -silent -jdk #{jdk_location}#{cmd_suffix}" 657 | + else 658 | + Puppet.debug("Installing OPatch patch #{weblogic_patch_num} from #{patch_dir}") 659 | + patch_apply_cmd = "java -jar #{patch_dir}/opatch_generic.jar -silent oracle_home=#{deploy_location}" 660 | + end 661 | 662 | - patch_apply_cmd = "#{cmd_prefix} cd #{patch_dir} && #{deploy_location}/OPatch/opatch " + \ 663 | - " apply -silent -jdk #{jdk_location}#{cmd_suffix}" 664 | Puppet.debug("Weblogic patch apply command #{patch_apply_cmd}") 665 | Puppet::Util::Execution.execute(patch_apply_cmd, :failonfail => true) 666 | - Puppet.debug('Weblogic patch installation successfully') 667 | end 668 | + Puppet.debug('Weblogic patch installation completed successfully') 669 | rescue Puppet::ExecutionFailure => e 670 | Puppet.debug("Weblogic patch installation failed: #{e.message}") 671 | raise Puppet::Error, "Installation of weblogic patch #{patch} failed: #{e.message}" 672 | ensure 673 | + if Facter.value(:osfamily) == 'windows' 674 | + remove_cmd = "cd #{deploy_location} && md empty && robocopy empty #{weblogic_patch_dir} /E /PURGE /NOCOPY /MOVE" 675 | + system(remove_cmd) 676 | + end 677 | FileUtils.remove_entry(weblogic_patch_dir) 678 | + Puppet.debug("Deleted Weblogic patch installation directory #{weblogic_patch_dir}") 679 | end 680 | end 681 | else 682 | diff --git a/pt_deploy/lib/puppet/type/pt_deploy_tuxedo.rb b/pt_deploy/lib/puppet/type/pt_deploy_tuxedo.rb 683 | index d0f556c..2ca2f9a 100644 684 | --- a/pt_deploy/lib/puppet/type/pt_deploy_tuxedo.rb 685 | +++ b/pt_deploy/lib/puppet/type/pt_deploy_tuxedo.rb 686 | @@ -43,7 +43,7 @@ module Puppet 687 | also be provided." 688 | 689 | validate do 690 | - if self[:ensure] == :present 691 | + if self[:ensure] == 'present' 692 | if self[:archive_file].nil? 693 | fail("archive_file attribute should be specified.") 694 | end 695 | @@ -64,7 +64,7 @@ module Puppet 696 | validate_oracle_inventory(inventory_location, 697 | inventory_user, inventory_group) 698 | end 699 | - elsif (self[:ensure] == :absent) and 700 | + elsif (self[:ensure] == 'absent') and 701 | (Facter.value(:osfamily) != 'windows') 702 | if self[:deploy_user].nil? 703 | fail("deploy_user attribute should be specified.") 704 | @@ -102,5 +102,7 @@ module Puppet 705 | parameter :redeploy 706 | parameter :remove 707 | parameter :patch_list 708 | + parameter :service_user 709 | + parameter :service_pwd 710 | end 711 | end 712 | diff --git a/pt_deploy/lib/puppet/type/shared/service_pwd.rb b/pt_deploy/lib/puppet/type/shared/service_pwd.rb 713 | new file mode 100644 714 | index 0000000..11d0eff 715 | --- /dev/null 716 | +++ b/pt_deploy/lib/puppet/type/shared/service_pwd.rb 717 | @@ -0,0 +1,6 @@ 718 | +newparam(:service_pwd) do 719 | + include EasyType 720 | + 721 | + desc "The service pwd." 722 | + 723 | +end 724 | diff --git a/pt_deploy/lib/puppet/type/shared/service_user.rb b/pt_deploy/lib/puppet/type/shared/service_user.rb 725 | new file mode 100644 726 | index 0000000..22d14e1 727 | --- /dev/null 728 | +++ b/pt_deploy/lib/puppet/type/shared/service_user.rb 729 | @@ -0,0 +1,6 @@ 730 | +newparam(:service_user) do 731 | + include EasyType 732 | + 733 | + desc "The service user." 734 | + 735 | +end 736 | diff --git a/pt_profile/manifests/pt_app_deployment.pp b/pt_profile/manifests/pt_app_deployment.pp 737 | index 4307425..d88e705 100644 738 | --- a/pt_profile/manifests/pt_app_deployment.pp 739 | +++ b/pt_profile/manifests/pt_app_deployment.pp 740 | @@ -23,6 +23,7 @@ class pt_profile::pt_app_deployment { 741 | 742 | # Hiera lookups 743 | $ensure = hiera('ensure') 744 | + $remove_default = $ensure ? { 'present' => false, default => true } 745 | if !($ensure in [ 'present', 'absent']) { 746 | fail("Invalid value for 'ensure'. It needs to be either 'present' or 'absent'.") 747 | } 748 | @@ -56,13 +57,7 @@ class pt_profile::pt_app_deployment { 749 | $ps_apphome_location = $ps_apphome_hiera['location'] 750 | notice ("PS App Home location is ${ps_apphome_location}") 751 | 752 | - $ps_apphome_remove_value = $ps_apphome_hiera['remove'] 753 | - if $ps_apphome_remove_value == undef { 754 | - $ps_apphome_remove = true 755 | - } 756 | - else { 757 | - $ps_apphome_remove = str2bool($ps_apphome_remove_value) 758 | - } 759 | + $ps_apphome_remove = any2bool(pick($ps_apphome_hiera['remove'], $remove_default)) 760 | notice ("PS App Home remove flag ${ps_apphome_remove}") 761 | 762 | if $deploy_apphome_only == false { 763 | @@ -75,13 +70,7 @@ class pt_profile::pt_app_deployment { 764 | $pi_home_location = $pi_home_hiera['location'] 765 | notice ("PS App PI Home location is ${pi_home_location}") 766 | 767 | - $pi_home_remove_value = $pi_home_hiera['remove'] 768 | - if $pi_home_remove_value == undef { 769 | - $pi_home_remove = true 770 | - } 771 | - else { 772 | - $pi_home_remove = str2bool($pi_home_remove_value) 773 | - } 774 | + $pi_home_remove = any2bool(pick($pi_home_hiera['remove'], $remove_default)) 775 | } 776 | else { 777 | $pi_home_remove = true 778 | @@ -93,13 +82,7 @@ class pt_profile::pt_app_deployment { 779 | $ps_custhome_location = $ps_custhome_hiera['location'] 780 | notice ("PS Cust Home location is ${ps_custhome_location}") 781 | 782 | - $ps_custhome_remove_value = $ps_custhome_hiera['remove'] 783 | - if $ps_custhome_remove_value == undef { 784 | - $ps_custhome_remove = true 785 | - } 786 | - else { 787 | - $ps_custhome_remove = str2bool($ps_custhome_remove_value) 788 | - } 789 | + $ps_custhome_remove = any2bool(pick($ps_custhome_hiera['remove'], $remove_default)) 790 | } 791 | else { 792 | $ps_custhome_remove = true 793 | diff --git a/pt_profile/manifests/pt_appserver.pp b/pt_profile/manifests/pt_appserver.pp 794 | index c06ab3d..fb42a40 100644 795 | --- a/pt_profile/manifests/pt_appserver.pp 796 | +++ b/pt_profile/manifests/pt_appserver.pp 797 | @@ -81,6 +81,9 @@ class pt_profile::pt_appserver { 798 | $env_settings_array = join_keys_to_values($env_settings, '=') 799 | notify {"AppServer domain ${domain_name} Env settings: ${env_settings_array}\n":} 800 | } 801 | + else { 802 | + $env_settings_array = undef 803 | + } 804 | # get the database platform 805 | $appserver_db_name = $db_settings['db_name'] 806 | $db_platform = $db_settings['db_type'] 807 | @@ -116,7 +119,8 @@ class pt_profile::pt_appserver { 808 | elsif ($db_platform_upper == 'MSSQL') { 809 | if $::osfamily != 'windows' { 810 | fail("${db_platform_upper} database type is not supported for midtier setup on $::osfamily") 811 | - } 812 | + } 813 | + $db_location = undef 814 | } 815 | else { 816 | fail("Application Server domain setup for DB platform ${db_platform_upper} is not supported") 817 | @@ -182,6 +186,41 @@ class pt_profile::pt_appserver { 818 | recreate => $recreate, 819 | require => $appserver_require, 820 | } 821 | + 822 | + if $ensure == present { 823 | + $appserver_custom_file_settings = $appserver_domain_info['custom_file_settings'] 824 | + if $appserver_custom_file_settings { 825 | + $appserver_custom_file_settings.each |$resource, $hash| { 826 | + $path = $hash['path'] 827 | + if $path == undef { 828 | + $path = "${ps_cfg_home_dir}/appserv" 829 | + } 830 | + file { $resource: 831 | + ensure => $hash['ensure'], 832 | + path => $path, 833 | + source => $hash['source'], 834 | + recurse => true, 835 | + force => true, 836 | + require => Pt_appserver_domain[$domain_name] 837 | + } 838 | + } 839 | + } 840 | + 841 | + if $::osfamily == 'windows' { 842 | + $service_registry_settings = $appserver_domain_info['service_registry_settings'] 843 | + if $service_registry_settings { 844 | + $service_registry_settings.each |$resource, $reg_data| { 845 | + registry::value { $resource: 846 | + key => $reg_data['key'], 847 | + value => $reg_data['value'], 848 | + type => $reg_data['type'], 849 | + data => $reg_data['data'], 850 | + } 851 | + } 852 | + } 853 | + } 854 | + } 855 | + 856 | if $setup_services == true { 857 | if ($::kernel == 'Linux') or ($::kernel == 'DISABLEAIX') { 858 | 859 | diff --git a/pt_profile/manifests/pt_domain_boot.pp b/pt_profile/manifests/pt_domain_boot.pp 860 | index 16694ab..3fac3cf 100644 861 | --- a/pt_profile/manifests/pt_domain_boot.pp 862 | +++ b/pt_profile/manifests/pt_domain_boot.pp 863 | @@ -45,6 +45,14 @@ class pt_profile::pt_domain_boot { 864 | $psapphome_location = $psapphome_hiera['location'] 865 | notify {"Domain boot PS APP Home: [${psapphome_location}]\n":} 866 | } 867 | + 868 | + $appserver_service_user = hiera('appserver_service_user', undef) 869 | + $appserver_service_pwd = hiera('appserver_service_pwd', undef) 870 | + $pia_service_user = hiera('pia_service_user', undef) 871 | + $pia_service_pwd = hiera('pia_service_pwd', undef) 872 | + $prcs_service_user = hiera('prcs_service_user', undef) 873 | + $prcs_service_pwd = hiera('prcs_service_pwd', undef) 874 | + 875 | if ($::osfamily == 'windows') and ($env_type == 'fulltier') { 876 | $oracleserver_hiera = hiera('oracle_server') 877 | $oracle_listener_name = $oracleserver_hiera['listener_name'] 878 | @@ -72,12 +80,29 @@ class pt_profile::pt_domain_boot { 879 | 880 | $os_user = $appserver_domain_info['os_user'] 881 | $ps_cfg_home_dir = $appserver_domain_info['ps_cfg_home_dir'] 882 | - 883 | + $ps_cust_home_dir = $appserver_domain_info['ps_cust_home_dir'] 884 | + 885 | + if $ensure == present and $appserver_service_user != undef { 886 | + acl { 'appserver_service_permission' : 887 | + target => $ps_cfg_home_dir, 888 | + permissions => [ 889 | + { 890 | + identity => $appserver_service_user, 891 | + rights => ['full'], 892 | + purge => false 893 | + } 894 | + ], 895 | + } 896 | + } 897 | pt_appserver_domain_boot { $app_domain_name: 898 | ensure => $domain_action, 899 | + ps_app_home_dir => $psapphome_location, 900 | ps_home_dir => $pshome_location, 901 | ps_cfg_home_dir => $ps_cfg_home_dir, 902 | + ps_cust_home_dir => $ps_cust_home_dir, 903 | os_user => $os_user, 904 | + service_user => $appserver_service_user, 905 | + service_pwd => $appserver_service_pwd, 906 | } 907 | if ($::osfamily == 'windows') and ($env_type == 'fulltier') { 908 | $appserver_domain_service = "PsftAppServerDomain${app_domain_name}Service" 909 | @@ -98,12 +123,29 @@ class pt_profile::pt_domain_boot { 910 | 911 | $os_user = $prcs_domain_info['os_user'] 912 | $ps_cfg_home_dir = $prcs_domain_info['ps_cfg_home_dir'] 913 | - 914 | + $ps_cust_home_dir = $prcs_domain_info['ps_cust_home_dir'] 915 | + 916 | + if $ensure == present and $prcs_service_user != undef { 917 | + acl { 'prcs_service_permission' : 918 | + target => $ps_cfg_home_dir, 919 | + permissions => [ 920 | + { 921 | + identity => $prcs_service_user, 922 | + rights => ['full'], 923 | + purge => false 924 | + } 925 | + ], 926 | + } 927 | + } 928 | pt_prcs_domain_boot { $prcs_domain_name: 929 | ensure => $domain_action, 930 | + ps_app_home_dir => $psapphome_location, 931 | ps_home_dir => $pshome_location, 932 | ps_cfg_home_dir => $ps_cfg_home_dir, 933 | + ps_cust_home_dir => $ps_cust_home_dir, 934 | os_user => $os_user, 935 | + service_user => $prcs_service_user, 936 | + service_pwd => $prcs_service_pwd, 937 | } 938 | if ($::osfamily == 'windows') and ($env_type == 'fulltier') { 939 | $prcs_domain_service = "PsftPrcsDomain${prcs_domain_name}Service" 940 | @@ -129,10 +171,23 @@ class pt_profile::pt_domain_boot { 941 | validate_hash($webserver_settings) 942 | $webserver_settings_array = join_keys_to_values($webserver_settings, '=') 943 | 944 | + if $ensure == present and $pia_service_user != undef { 945 | + acl { "${ps_cfg_home_dir}/webserv": 946 | + permissions => [ 947 | + { 948 | + identity => $pia_service_user, 949 | + rights => ['full'], 950 | + purge => false, 951 | + } 952 | + ], 953 | + } 954 | + } 955 | pt_webserver_domain_boot { $pia_domain_name: 956 | ensure => $domain_action, 957 | ps_cfg_home_dir => $ps_cfg_home_dir, 958 | os_user => $os_user, 959 | + service_user => $pia_service_user, 960 | + service_pwd => $pia_service_pwd, 961 | webserver_settings => $webserver_settings_array, 962 | } 963 | } 964 | diff --git a/pt_profile/manifests/pt_oracleserver.pp b/pt_profile/manifests/pt_oracleserver.pp 965 | index 328d13d..44d3b16 100644 966 | --- a/pt_profile/manifests/pt_oracleserver.pp 967 | +++ b/pt_profile/manifests/pt_oracleserver.pp 968 | @@ -23,6 +23,7 @@ class pt_profile::pt_oracleserver { 969 | 970 | # Hiera lookups 971 | $ensure = hiera('ensure') 972 | + $remove_default = $ensure ? { 'present' => false, default => true } 973 | if !($ensure in [ 'present', 'absent']) { 974 | fail("Invalid value for 'ensure'. It needs to be either 'present' or 'absent'.") 975 | } 976 | @@ -65,13 +66,7 @@ class pt_profile::pt_oracleserver { 977 | $oracleserver_location = $oracleserver_hiera['location'] 978 | $oracleserver_listener_port = $oracleserver_hiera['listener_port'] 979 | $oracleserver_listener_name = $oracleserver_hiera['listener_name'] 980 | - $oracleserver_remove = $oracleserver_hiera['remove'] 981 | - if $oracleserver_remove == undef { 982 | - $remove = true 983 | - } 984 | - else { 985 | - $remove = str2bool($oracleserver_remove) 986 | - } 987 | + $oracleserver_remove = any2bool(pick($oracleserver_hiera['remove'], $remove_default)) 988 | 989 | if $ensure == present { 990 | $db_location = hiera('db_location') 991 | diff --git a/pt_profile/manifests/pt_pia.pp b/pt_profile/manifests/pt_pia.pp 992 | index 00aa5f1..4b34c8a 100644 993 | --- a/pt_profile/manifests/pt_pia.pp 994 | +++ b/pt_profile/manifests/pt_pia.pp 995 | @@ -117,6 +117,68 @@ class pt_profile::pt_pia { 996 | site_list => $pia_site_list_array, 997 | recreate => $recreate, 998 | } 999 | + 1000 | + if $ensure == present { 1001 | + $property_files = $pia_domain_info['property_file'] 1002 | + if $property_files { 1003 | + notify {"Applying property file updates..":} 1004 | + $property_files.each |$file, $data| { 1005 | + notify {"Updating property file ${file}":} 1006 | + $defaults = { 1007 | + 'path' => $file, 1008 | + 'section' => '', 1009 | + 'key_val_separator' => '=' 1010 | + } 1011 | + $hash = {"" => $data} 1012 | + create_ini_settings($hash, $defaults) 1013 | + } 1014 | + } 1015 | + 1016 | + $xml_files = $pia_domain_info['xml_file'] 1017 | + if $xml_files { 1018 | + notify {"Applying xml file updates..":} 1019 | + $xml_files.each |$file, $data| { 1020 | + notify {"Updating xml file ${file}":} 1021 | + $data.each |$resource, $hash| { 1022 | + $content = $hash['content'] 1023 | + if $content { 1024 | + xml_fragment { $resource: 1025 | + ensure => $hash['ensure'], 1026 | + path => "${file}", 1027 | + xpath => $hash['xpath'], 1028 | + content => $content 1029 | + } 1030 | + } 1031 | + else { 1032 | + xml_fragment { $resource: 1033 | + ensure => $hash['ensure'], 1034 | + path => "${file}", 1035 | + xpath => $hash['xpath'] 1036 | + } 1037 | + } 1038 | + } 1039 | + } 1040 | + } 1041 | + 1042 | + $pia_custom_file_settings = $pia_domain_info['custom_file_settings'] 1043 | + if $pia_custom_file_settings { 1044 | + notify {"Applying Custom File Settings..":} 1045 | + $pia_custom_file_settings.each |$resource, $hash| { 1046 | + $path = $hash['path'] 1047 | + if $path == undef { 1048 | + $path = "${ps_cfg_home_dir}/webserv/${domain_name}" 1049 | + } 1050 | + file { $resource: 1051 | + ensure => $hash['ensure'], 1052 | + path => $path, 1053 | + source => $hash['source'], 1054 | + recurse => true, 1055 | + force => true 1056 | + } 1057 | + } 1058 | + } 1059 | + } 1060 | + 1061 | if $setup_services == true { 1062 | if ($::kernel == 'Linux') or ($::kernel == 'DISABLEAIX') { 1063 | 1064 | diff --git a/pt_profile/manifests/pt_prcs.pp b/pt_profile/manifests/pt_prcs.pp 1065 | index 52435a0..1bc2675 100644 1066 | --- a/pt_profile/manifests/pt_prcs.pp 1067 | +++ b/pt_profile/manifests/pt_prcs.pp 1068 | @@ -83,6 +83,9 @@ class pt_profile::pt_prcs { 1069 | $env_settings_array = join_keys_to_values($env_settings, '=') 1070 | notify {"PRCS domain ${domain_name} Env settings: ${env_settings_array}\n":} 1071 | } 1072 | + else { 1073 | + $env_settings_array = undef 1074 | + } 1075 | # get the database platform 1076 | $prcs_db_name = $db_settings['db_name'] 1077 | $db_platform = $db_settings['db_type'] 1078 | @@ -119,6 +122,7 @@ class pt_profile::pt_prcs { 1079 | if $::osfamily != 'windows' { 1080 | fail("${db_platform_upper} database type is not supported for midtier setup on $::osfamily") 1081 | } 1082 | + $db_location = undef 1083 | } 1084 | else { 1085 | fail("Process Scheduler domain setup for DB platform ${db_platform_upper} is not supported") 1086 | diff --git a/pt_profile/manifests/pt_psft_environment.pp b/pt_profile/manifests/pt_psft_environment.pp 1087 | index 2a2128b..ef5fbf2 100644 1088 | --- a/pt_profile/manifests/pt_psft_environment.pp 1089 | +++ b/pt_profile/manifests/pt_psft_environment.pp 1090 | @@ -86,9 +86,11 @@ class pt_profile::pt_psft_environment { 1091 | fail("env_type parameter value ${env_type} is not supported for ${pshome_db_type_upper} \ 1092 | database type") 1093 | } 1094 | + $tns_location = undef 1095 | } 1096 | elsif ($pshome_db_type_upper == 'MSSQL') { 1097 | notice ("Database type is MSSQL, nothing to set for the user environment") 1098 | + $tns_location = undef 1099 | } 1100 | else { 1101 | fail("DB platform ${pshome_db_type_upper} is not supported") 1102 | diff --git a/pt_profile/manifests/pt_tools_deployment.pp b/pt_profile/manifests/pt_tools_deployment.pp 1103 | index 6406f4a..081179b 100644 1104 | --- a/pt_profile/manifests/pt_tools_deployment.pp 1105 | +++ b/pt_profile/manifests/pt_tools_deployment.pp 1106 | @@ -23,6 +23,7 @@ class pt_profile::pt_tools_deployment { 1107 | 1108 | ## Hiera lookups 1109 | $ensure = hiera('ensure') 1110 | + $remove_default = $ensure ? { 'present' => false, default => true } 1111 | if !($ensure in [ 'present', 'absent']) { 1112 | fail("Invalid value for 'ensure'. It needs to be either 'present' or 'absent'.") 1113 | } 1114 | @@ -62,6 +63,15 @@ class pt_profile::pt_tools_deployment { 1115 | notice ("Inventory location is ${inventory_location}") 1116 | 1117 | } 1118 | + else { 1119 | + $inventory_location = undef 1120 | + $oracle_install_group_name = undef 1121 | + $oracle_install_user_name = undef 1122 | + $oracleclient_location = undef 1123 | + $oracleclient_remove = undef 1124 | + $tools_install_group_name = undef 1125 | + $tools_install_user_name = undef 1126 | + } 1127 | $deploy_pshome_only = hiera('deploy_pshome_only', false) 1128 | 1129 | $pshome_hiera = hiera('ps_home') 1130 | @@ -69,13 +79,7 @@ class pt_profile::pt_tools_deployment { 1131 | $pshome_location = $pshome_hiera['location'] 1132 | notice ("PS Home location is ${pshome_location}") 1133 | 1134 | - $pshome_remove_value = $pshome_hiera['remove'] 1135 | - if $pshome_remove_value == undef { 1136 | - $pshome_remove = true 1137 | - } 1138 | - else { 1139 | - $pshome_remove = str2bool($pshome_remove_value) 1140 | - } 1141 | + $pshome_remove = any2bool(pick($pshome_hiera['remove'], $remove_default)) 1142 | notice ("PS Home remove is ${pshome_remove}") 1143 | 1144 | if $deploy_pshome_only == false { 1145 | @@ -84,65 +88,45 @@ class pt_profile::pt_tools_deployment { 1146 | if $db_platform == 'ORACLE' { 1147 | $oracleclient_hiera = hiera('oracle_client') 1148 | $oracleclient_location = $oracleclient_hiera['location'] 1149 | - 1150 | - $oracleclient_remove_value = $oracleclient_hiera['remove'] 1151 | - if $oracleclient_remove_value == undef { 1152 | - $oracleclient_remove = true 1153 | - } 1154 | - else { 1155 | - $oracleclient_remove = str2bool($oracleclient_remove_value) 1156 | - } 1157 | + $oracleclient_remove = any2bool(pick($oracleclient_hiera['remove'], $remove_default)) 1158 | notice ("Oracle client remove is ${oracleclient_remove}") 1159 | } 1160 | } 1161 | $jdk_hiera = hiera('jdk') 1162 | $jdk_location = $jdk_hiera['location'] 1163 | - $jdk_remove_value = $jdk_hiera['remove'] 1164 | - if $jdk_remove_value == undef { 1165 | - $jdk_remove = true 1166 | - } 1167 | - else { 1168 | - $jdk_remove = str2bool($jdk_remove_value) 1169 | - } 1170 | + $jdk_remove = any2bool(pick($jdk_hiera['remove'], $remove_default)) 1171 | notice ("JDK remove is ${jdk_remove}") 1172 | 1173 | $weblogic_hiera = hiera('weblogic') 1174 | $weblogic_location = $weblogic_hiera['location'] 1175 | - $weblogic_remove_value = $weblogic_hiera['remove'] 1176 | - if $weblogic_remove_value == undef { 1177 | - $weblogic_remove = true 1178 | - } 1179 | - else { 1180 | - $weblogic_remove = str2bool($weblogic_remove_value) 1181 | - } 1182 | + $weblogic_remove = any2bool(pick($weblogic_hiera['remove'], $remove_default)) 1183 | notice ("Weblogic remove is ${weblogic_remove}") 1184 | 1185 | $tuxedo_hiera = hiera('tuxedo') 1186 | $tuxedo_location = $tuxedo_hiera['location'] 1187 | - $tuxedo_remove_value = $tuxedo_hiera['remove'] 1188 | - if $tuxedo_remove_value == undef { 1189 | - $tuxedo_remove = true 1190 | - } 1191 | - else { 1192 | - $tuxedo_remove = str2bool($tuxedo_remove_value) 1193 | - } 1194 | + $tuxedo_remove = any2bool(pick($tuxedo_hiera['remove'], $remove_default)) 1195 | notice ("Tuxedo remove is ${tuxedo_remove}") 1196 | 1197 | $ohs_hiera = hiera('setup_ohs', false) 1198 | if $ohs_hiera == true { 1199 | $ohs_comp_hiera = hiera('ohs') 1200 | $ohs_location = $ohs_comp_hiera['location'] 1201 | - $ohs_remove_value = $ohs_comp_hiera['remove'] 1202 | - if $ohs_remove_value == undef { 1203 | - $ohs_remove = true 1204 | - } 1205 | - else { 1206 | - $ohs_remove = str2bool($ohs_remove_value) 1207 | - } 1208 | + $ohs_remove = any2bool(pick($ohs_comp_hiera['remove'], $remove_default)) 1209 | notice ("OHS remove is ${ohs_remove}") 1210 | } 1211 | + else { 1212 | + $ohs_location = undef 1213 | + $ohs_remove = undef 1214 | + } 1215 | } 1216 | - $redeploy = hiera('redeploy', false) 1217 | + $redeploy = hiera('redeploy', false) 1218 | + $pshome_redeploy = hiera('pshome_redeploy', false) 1219 | + $oracleclient_redeploy = hiera('oracleclient_redeploy', false) 1220 | + $jdk_redeploy = hiera('jdk_redeploy', false) 1221 | + $weblogic_redeploy = hiera('weblogic_redeploy', false) 1222 | + $tuxedo_redeploy = hiera('tuxedo_redeploy', false) 1223 | + $ohs_redeploy = hiera('ohs_redeploy', false) 1224 | + 1225 | class { '::pt_setup::tools_deployment': 1226 | ensure => $ensure, 1227 | deploy_pshome_only => $deploy_pshome_only, 1228 | @@ -154,17 +138,23 @@ class pt_profile::pt_tools_deployment { 1229 | db_type => $db_type, 1230 | pshome_location => $pshome_location, 1231 | pshome_remove => $pshome_remove, 1232 | + pshome_redeploy => $pshome_redeploy, 1233 | inventory_location => $inventory_location, 1234 | oracleclient_location => $oracleclient_location, 1235 | oracleclient_remove => $oracleclient_remove, 1236 | + oracleclient_redeploy => $oracleclient_redeploy, 1237 | jdk_location => $jdk_location, 1238 | jdk_remove => $jdk_remove, 1239 | + jdk_redeploy => $jdk_redeploy, 1240 | weblogic_location => $weblogic_location, 1241 | weblogic_remove => $weblogic_remove, 1242 | + weblogic_redeploy => $weblogic_redeploy, 1243 | tuxedo_location => $tuxedo_location, 1244 | tuxedo_remove => $tuxedo_remove, 1245 | + tuxedo_redeploy => $tuxedo_redeploy, 1246 | ohs_location => $ohs_location, 1247 | ohs_remove => $ohs_remove, 1248 | + ohs_redeploy => $ohs_redeploy, 1249 | redeploy => $redeploy, 1250 | } 1251 | contain ::pt_setup::tools_deployment 1252 | diff --git a/pt_role/lib/facter/redeploy.rb b/pt_role/lib/facter/redeploy.rb 1253 | new file mode 100644 1254 | index 0000000..dbe08ae 1255 | --- /dev/null 1256 | +++ b/pt_role/lib/facter/redeploy.rb 1257 | @@ -0,0 +1,41 @@ 1258 | +Facter.add(:redeploy) do 1259 | + setcode do 1260 | + 'false' 1261 | + end 1262 | +end 1263 | + 1264 | +Facter.add(:pshome_redeploy) do 1265 | + setcode do 1266 | + 'false' 1267 | + end 1268 | +end 1269 | + 1270 | +Facter.add(:oracleclient_redeploy) do 1271 | + setcode do 1272 | + 'false' 1273 | + end 1274 | +end 1275 | + 1276 | +Facter.add(:jdk_redeploy) do 1277 | + setcode do 1278 | + 'false' 1279 | + end 1280 | +end 1281 | + 1282 | +Facter.add(:weblogic_redeploy) do 1283 | + setcode do 1284 | + 'false' 1285 | + end 1286 | +end 1287 | + 1288 | +Facter.add(:tuxedo_redeploy) do 1289 | + setcode do 1290 | + 'false' 1291 | + end 1292 | +end 1293 | + 1294 | +Facter.add(:ohs_redeploy) do 1295 | + setcode do 1296 | + 'false' 1297 | + end 1298 | +end 1299 | \ No newline at end of file 1300 | diff --git a/pt_setup/manifests/app_deployment.pp b/pt_setup/manifests/app_deployment.pp 1301 | index 5bed44c..9fe946b 100644 1302 | --- a/pt_setup/manifests/app_deployment.pp 1303 | +++ b/pt_setup/manifests/app_deployment.pp 1304 | @@ -47,14 +47,20 @@ class pt_setup::app_deployment ( 1305 | realize ( ::File[$pt_location] ) 1306 | 1307 | # retrieve the archives for each App component 1308 | - $ps_apphome_archive_file = get_matched_file($app_archive_location, $ps_apphome_tag) 1309 | + $archive_files = hiera('archive_files', '') 1310 | + if $archive_files { 1311 | + $ps_apphome_archive_file = $archive_files[$ps_apphome_tag] 1312 | + } 1313 | + if $ps_apphome_archive_file == '' { 1314 | + $ps_apphome_archive_file = get_matched_file($app_archive_location, $ps_apphome_tag) 1315 | + } 1316 | if $ps_apphome_archive_file == '' { 1317 | fail("Unable to locate archive (tgz) file for PS_APP_HOME in ${app_archive_location}") 1318 | } 1319 | } 1320 | $ps_apphome_hiera = hiera('ps_app_home') 1321 | - $ps_apphome_extract_only_hiera = $ps_apphome_hiera['extract_only'] 1322 | - $apphome_extract_only = str2bool($ps_apphome_extract_only_hiera) 1323 | + $ps_apphome_extract_only_hiera = $ps_apphome_hiera['extract_only'] 1324 | + $apphome_extract_only = str2bool($ps_apphome_extract_only_hiera) 1325 | 1326 | notice ("PS Application Home extract only flag: ${apphome_extract_only}") 1327 | $apphome_patches = hiera('apphome_patches', '') 1328 | diff --git a/pt_setup/manifests/tools_deployment.pp b/pt_setup/manifests/tools_deployment.pp 1329 | index cbdb8b4..ffefa34 100644 1330 | --- a/pt_setup/manifests/tools_deployment.pp 1331 | +++ b/pt_setup/manifests/tools_deployment.pp 1332 | @@ -29,17 +29,23 @@ class pt_setup::tools_deployment ( 1333 | $db_type = undef, 1334 | $pshome_location = undef, 1335 | $pshome_remove = true, 1336 | + $pshome_redeploy = false, 1337 | $inventory_location = undef, 1338 | $oracleclient_location = undef, 1339 | $oracleclient_remove = true, 1340 | + $oracleclient_redeploy = false, 1341 | $jdk_location = undef, 1342 | $jdk_remove = true, 1343 | + $jdk_redeploy = false, 1344 | $weblogic_location = undef, 1345 | $weblogic_remove = true, 1346 | + $weblogic_redeploy = false, 1347 | $tuxedo_location = undef, 1348 | $tuxedo_remove = true, 1349 | + $tuxedo_redeploy = false, 1350 | $ohs_location = undef, 1351 | $ohs_remove = true, 1352 | + $ohs_redeploy = false, 1353 | $redeploy = false, 1354 | ) { 1355 | notice ("Applying pt_setup::tools_deployment") 1356 | @@ -52,6 +58,16 @@ class pt_setup::tools_deployment ( 1357 | $ohs_tag = 'ohs' 1358 | $cobol_tag = 'se-cobol' 1359 | $visual_cobol_tag = 'visualcobol' 1360 | + $archive_files = hiera('archive_files', '') 1361 | + $domain_type = hiera('domain_type') 1362 | + $appserver_service_user = hiera('appserver_service_user', undef) 1363 | + $appserver_service_pwd = hiera('appserver_service_pwd', undef) 1364 | + $pia_service_user = hiera('pia_service_user', undef) 1365 | + $pia_service_pwd = hiera('pia_service_pwd', undef) 1366 | + $prcs_service_user = hiera('prcs_service_user', undef) 1367 | + $prcs_service_pwd = hiera('prcs_service_pwd', undef) 1368 | + $tuxedo_service_user = hiera('tuxedo_service_user', undef) 1369 | + $tuxedo_service_pwd = hiera('tuxedo_service_pwd', undef) 1370 | 1371 | if $ensure == present { 1372 | $pt_location = hiera('pt_location') 1373 | @@ -65,7 +81,13 @@ class pt_setup::tools_deployment ( 1374 | realize ( ::File[$db_location] ) 1375 | 1376 | # retrieve the archives for each Tools component 1377 | - $pshome_archive_file = get_matched_file($tools_archive_location, $pshome_tag) 1378 | + 1379 | + if $archive_files { 1380 | + $pshome_archive_file = $archive_files[$pshome_tag] 1381 | + } 1382 | + if $pshome_archive_file == '' { 1383 | + $pshome_archive_file = get_matched_file($tools_archive_location, $pshome_tag) 1384 | + } 1385 | if $pshome_archive_file == '' { 1386 | fail("Unable to locate archive (tgz) file for PS_HOME in ${tools_archive_location}") 1387 | } 1388 | @@ -73,30 +95,56 @@ class pt_setup::tools_deployment ( 1389 | if $deploy_pshome_only == false { 1390 | if $ensure == present { 1391 | if ($::kernel != 'AIX' and $::kernel != 'HP-UX') { 1392 | - $jdk_archive_file = get_matched_file($tools_archive_location, $jdk_tag) 1393 | + if $archive_files { 1394 | + $jdk_archive_file = $archive_files[$jdk_tag] 1395 | + } 1396 | + if $jdk_archive_file == '' { 1397 | + $jdk_archive_file = get_matched_file($tools_archive_location, $jdk_tag) 1398 | + } 1399 | if $jdk_archive_file == '' { 1400 | fail("Unable to locate archive (tgz) file for JDK in ${tools_archive_location}") 1401 | } 1402 | } 1403 | - 1404 | - $weblogic_archive_file = get_matched_file($tools_archive_location, 1405 | + 1406 | + if $archive_files { 1407 | + $weblogic_archive_file = $archive_files[$weblogic_tag] 1408 | + } 1409 | + if $weblogic_archive_file == '' { 1410 | + $weblogic_archive_file = get_matched_file($tools_archive_location, 1411 | $weblogic_tag) 1412 | + } 1413 | if $weblogic_archive_file == '' { 1414 | fail("Unable to locate archive (tgz) file for Weblogic in ${tools_archive_location}") 1415 | } 1416 | - $tuxedo_archive_file = get_matched_file($tools_archive_location, 1417 | + 1418 | + if $archive_files { 1419 | + $tuxedo_archive_file = $archive_files[$tuxedo_tag] 1420 | + } 1421 | + if $tuxedo_archive_file == '' { 1422 | + $tuxedo_archive_file = get_matched_file($tools_archive_location, 1423 | $tuxedo_tag) 1424 | + } 1425 | if $tuxedo_archive_file == '' { 1426 | fail("Unable to locate archive (tgz) file for Tuxedo in ${tools_archive_location}") 1427 | } 1428 | } 1429 | + else { 1430 | + $jdk_archive_file = nil 1431 | + $weblogic_archive_file = nil 1432 | + $tuxedo_archive_file = nil 1433 | + } 1434 | $db_platform = hiera('db_platform') 1435 | if ($oracleclient_location) and ($db_platform == 'ORACLE') { 1436 | $deploy_oracleclient = true 1437 | 1438 | if $ensure == present { 1439 | - $oracleclient_archive_file = get_matched_file($tools_archive_location, 1440 | + if $archive_files { 1441 | + $oracleclient_archive_file = $archive_files[$oracleclient_tag] 1442 | + } 1443 | + if $oracleclient_archive_file == '' { 1444 | + $oracleclient_archive_file = get_matched_file($tools_archive_location, 1445 | $oracleclient_tag) 1446 | + } 1447 | if $oracleclient_archive_file == '' { 1448 | fail("Unable to locate archive (tgz) file for Oracle Client in ${tools_archive_location}") 1449 | } 1450 | @@ -110,6 +158,11 @@ class pt_setup::tools_deployment ( 1451 | notice ("Oracle Client patches do NOT exist") 1452 | $oracleclient_patches_list = undef 1453 | } 1454 | + if ($redeploy == 'true') or ($oracleclient_redeploy == 'true') { 1455 | + $oc_redeploy = true 1456 | + } else { 1457 | + $oc_redeploy = false 1458 | + } 1459 | pt_deploy_oracleclient { $oracleclient_tag: 1460 | ensure => $ensure, 1461 | deploy_user => $oracle_install_user, 1462 | @@ -119,7 +172,7 @@ class pt_setup::tools_deployment ( 1463 | oracle_inventory_location => $inventory_location, 1464 | oracle_inventory_user => $oracle_install_user, 1465 | oracle_inventory_group => $oracle_install_group, 1466 | - redeploy => $redeploy, 1467 | + redeploy => $oc_redeploy, 1468 | remove => $oracleclient_remove, 1469 | patch_list => $oracleclient_patches_list, 1470 | } 1471 | @@ -147,6 +200,11 @@ class pt_setup::tools_deployment ( 1472 | $tools_patches_list = undef 1473 | } 1474 | 1475 | + if ($redeploy == 'true') or ($pshome_redeploy == 'true') { 1476 | + $pt_redeploy = true 1477 | + } else { 1478 | + $pt_redeploy = false 1479 | + } 1480 | # deploy each Tools component 1481 | pt_deploy_pshome { $pshome_tag: 1482 | ensure => $ensure, 1483 | @@ -157,7 +215,7 @@ class pt_setup::tools_deployment ( 1484 | deploy_location => $pshome_location, 1485 | extract_only => $extract_only, 1486 | unicode_db => $unicode_db, 1487 | - redeploy => $redeploy, 1488 | + redeploy => $pt_redeploy, 1489 | remove => $pshome_remove, 1490 | patch_list => $tools_patches_list, 1491 | } 1492 | @@ -179,30 +237,83 @@ class pt_setup::tools_deployment ( 1493 | $jdk_patches_list = undef 1494 | } 1495 | 1496 | + if ($redeploy == 'true') or ($jdk_redeploy == 'true') { 1497 | + $java_redeploy = true 1498 | + } else { 1499 | + $java_redeploy = false 1500 | + } 1501 | pt_deploy_jdk { $jdk_tag: 1502 | ensure => $ensure, 1503 | deploy_user => $tools_install_user, 1504 | deploy_user_group => $tools_install_group, 1505 | archive_file => $jdk_archive_file, 1506 | deploy_location => $jdk_location, 1507 | - redeploy => $redeploy, 1508 | + redeploy => $java_redeploy, 1509 | remove => $jdk_remove, 1510 | patch_list => $jdk_patches_list, 1511 | } 1512 | + # Make sure both service and domain user have access to JDK 1513 | + if $::osfamily == 'windows' and $ensure == present { 1514 | + acl { 'jdk_domain_user' : 1515 | + target => $jdk_location, 1516 | + purge => false, 1517 | + permissions => [ 1518 | + { identity => $::identity[user], rights => ['write','read','execute'] } 1519 | + ], 1520 | + } 1521 | + if $appserver_service_user != undef and $domain_type in [ 'all', 'appserver', 'appbatch'] { 1522 | + acl { 'jdk_app_service' : 1523 | + target => $jdk_location, 1524 | + purge => false, 1525 | + permissions => [ 1526 | + { identity => $appserver_service_user, rights => ['write','read','execute'] } 1527 | + ], 1528 | + } 1529 | + } 1530 | + if $pia_service_user != undef and $domain_type in [ 'all', 'pia'] { 1531 | + acl { 'jdk_pia_service' : 1532 | + target => $jdk_location, 1533 | + purge => false, 1534 | + permissions => [ 1535 | + { identity => $pia_service_user, rights => ['write','read','execute'] } 1536 | + ], 1537 | + } 1538 | + } 1539 | + if $prcs_service_user != undef and $domain_type in [ 'all', 'prcs', 'appbatch'] { 1540 | + acl { 'jdk_prcs_service' : 1541 | + target => $jdk_location, 1542 | + purge => false, 1543 | + permissions => [ 1544 | + { identity => $prcs_service_user, rights => ['write','read','execute'] } 1545 | + ], 1546 | + } 1547 | + } 1548 | + } 1549 | } 1550 | 1551 | # ### Weblogic ### 1552 | - $weblogic_patches = hiera('weblogic_patches', '') 1553 | - if ($weblogic_patches) and ($weblogic_patches != '') { 1554 | - notice ("Weblogic patches do exist") 1555 | - $weblogic_patches_list = values($weblogic_patches) 1556 | + if $domain_type == 'all' or $domain_type == 'pia' { 1557 | + $weblogic_ensure = $ensure 1558 | + $weblogic_patches = hiera('weblogic_patches', '') 1559 | + if ($weblogic_patches) and ($weblogic_patches != '') { 1560 | + notice ("Weblogic patches do exist") 1561 | + $weblogic_patches_list = values($weblogic_patches) 1562 | + } 1563 | + else { 1564 | + notice ("Weblogic patches do NOT exist") 1565 | + $weblogic_patches_list = undef 1566 | + } 1567 | } 1568 | else { 1569 | - notice ("Weblogic patches do NOT exist") 1570 | - $weblogic_patches_list = undef 1571 | + $weblogic_ensure = absent 1572 | + } 1573 | + if ($redeploy == 'true') or ($weblogic_redeploy == 'true') { 1574 | + $wl_redeploy = true 1575 | + } else { 1576 | + $wl_redeploy = false 1577 | } 1578 | pt_deploy_weblogic { $weblogic_tag: 1579 | - ensure => $ensure, 1580 | + ensure => $weblogic_ensure, 1581 | deploy_user => $tools_install_user, 1582 | deploy_user_group => $tools_install_group, 1583 | archive_file => $weblogic_archive_file, 1584 | @@ -211,23 +322,46 @@ class pt_setup::tools_deployment ( 1585 | oracle_inventory_user => $oracle_install_user, 1586 | oracle_inventory_group => $oracle_install_group, 1587 | jdk_location => $jdk_location, 1588 | - redeploy => $redeploy, 1589 | + redeploy => $wl_redeploy, 1590 | remove => $weblogic_remove, 1591 | patch_list => $weblogic_patches_list, 1592 | } 1593 | 1594 | # ### Tuxedo ### 1595 | - $tuxedo_patches = hiera('tuxedo_patches', '') 1596 | - if ($tuxedo_patches) and ($tuxedo_patches != '') { 1597 | - notice ("Tuxedo patches do exist") 1598 | - $tuxedo_patches_list = values($tuxedo_patches) 1599 | + if $::osfamily == 'windows' and $weblogic_ensure == present and $pia_service_user != undef { 1600 | + acl { "$weblogic_location": 1601 | + permissions => [ 1602 | + { 1603 | + identity => $pia_service_user, 1604 | + rights => ['write','read','execute'], 1605 | + purge => false, 1606 | + } 1607 | + ], 1608 | + } 1609 | + } 1610 | + if $domain_type == 'all' or $domain_type != 'pia' { 1611 | + $tuxedo_ensure = $ensure 1612 | + $tuxedo_patches = hiera('tuxedo_patches', '') 1613 | + if ($tuxedo_patches) and ($tuxedo_patches != '') { 1614 | + notice ("Tuxedo patches do exist") 1615 | + $tuxedo_patches_list = values($tuxedo_patches) 1616 | + } 1617 | + else { 1618 | + notice ("Tuxedo patches do NOT exist") 1619 | + $tuxedo_patches_list = undef 1620 | + } 1621 | + 1622 | } 1623 | else { 1624 | - notice ("Tuxedo patches do NOT exist") 1625 | - $tuxedo_patches_list = undef 1626 | + $tuxedo_ensure = absent 1627 | + } 1628 | + if ($redeploy == 'true') or ($tuxedo_redeploy == 'true') { 1629 | + $tux_redeploy = true 1630 | + } else { 1631 | + $tux_redeploy = false 1632 | } 1633 | pt_deploy_tuxedo { $tuxedo_tag: 1634 | - ensure => $ensure, 1635 | + ensure => $tuxedo_ensure, 1636 | deploy_user => $tools_install_user, 1637 | deploy_user_group => $tools_install_group, 1638 | archive_file => $tuxedo_archive_file, 1639 | @@ -235,10 +369,23 @@ class pt_setup::tools_deployment ( 1640 | oracle_inventory_location => $inventory_location, 1641 | oracle_inventory_user => $oracle_install_user, 1642 | oracle_inventory_group => $oracle_install_group, 1643 | - redeploy => $redeploy, 1644 | + redeploy => $tux_redeploy, 1645 | remove => $tuxedo_remove, 1646 | patch_list => $tuxedo_patches_list, 1647 | jdk_location => $jdk_location, 1648 | + service_user => $tuxedo_service_user, 1649 | + service_pwd => $tuxedo_service_pwd 1650 | + } 1651 | + if $::osfamily == 'windows' and $tuxedo_ensure == present and $tuxedo_service_user != undef { 1652 | + acl { "$tuxedo_location": 1653 | + permissions => [ 1654 | + { 1655 | + identity => $tuxedo_service_user, 1656 | + rights => ['write','read','execute'], 1657 | + purge => false, 1658 | + } 1659 | + ], 1660 | + } 1661 | } 1662 | 1663 | # ### Oracle HTTP Server ### 1664 | @@ -252,6 +399,11 @@ class pt_setup::tools_deployment ( 1665 | fail("Unable to locate archive (tgz) file for OHS in ${tools_archive_location}") 1666 | } 1667 | } 1668 | + if ($redeploy == 'true') or ($ohs_redeploy == 'true') { 1669 | + $http_redeploy = true 1670 | + } else { 1671 | + $http_redeploy = false 1672 | + } 1673 | pt_deploy_ohs { $ohs_tag: 1674 | ensure => $ensure, 1675 | deploy_user => $tools_install_user, 1676 | @@ -262,7 +414,7 @@ class pt_setup::tools_deployment ( 1677 | oracle_inventory_user => $oracle_install_user, 1678 | oracle_inventory_group => $oracle_install_group, 1679 | jdk_location => $jdk_location, 1680 | - redeploy => $redeploy, 1681 | + redeploy => $http_redeploy, 1682 | remove => $ohs_remove, 1683 | } 1684 | } 1685 | --------------------------------------------------------------------------------