├── LICENSE ├── README.md ├── Vagrantfile ├── ansible.cfg ├── hosts ├── infra-vars.yml ├── roles ├── fmw-domain │ ├── tasks │ │ └── main.yml │ └── templates │ │ ├── .bashrc │ │ ├── boot.properties │ │ ├── create-domain.py │ │ ├── create_repo.sh │ │ ├── nodemanager.properties │ │ ├── nodemanager.service │ │ ├── passwords.txt │ │ └── start-admin-server.py ├── fmw-managed-server │ ├── tasks │ │ └── main.yml │ └── templates │ │ ├── boot.properties │ │ ├── create-managed.py │ │ └── start-managed-server.py ├── fmw-software │ ├── files │ │ └── fmw_12.1.3.0.0_infrastructure.jar.sample │ ├── tasks │ │ └── main.yml │ └── templates │ │ ├── oraInst.loc │ │ └── silent-weblogic.txt ├── linux-jdk │ ├── files │ │ └── jdk-7u85-linux-x64.tar.gz.sample │ └── tasks │ │ └── main.yml └── linux-wls │ ├── tasks │ └── main.yml │ ├── templates │ └── oracle-limits.sh │ └── vars │ └── main.yml ├── secrets.yml ├── weblogic-fmw-domain.yml └── wls-vars.yml /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # weblogic-ansible 2 | 3 | An Ansible Playbook (weblogic-fmw-domain.yml) for install and configure a WebLogic server 12c with 4 | Oracle Fusion Middleware software for hosting Oracle Fusion Middleware (for example ADF) applications in Redhat Linux 7 (RHEL/CentOS/Oracle Linux) system. 5 | This playbook is for version 12.1.3 of WebLogic and Fusion Middleware Infrastructure software. 6 | 7 | Requirements for running the playbook: 8 | - Configure your environment variables in infra-vars.yml. 9 | - Set your passwords in secrets.yml. 10 | - A running Oracle Database for hosting the repositories is required and sys user password for generates the repositories. 11 | - A running RHEL 7 system with minimal installation with network configured. (IP address, hostname etc). 12 | - Download the latest Java 7 jdk and put the file in roles/linux-jdk/files and configure infra-vars.yml with that file name. 13 | - Download the 12.1.3 Oracle Fusion Middleware installer from Oracle support and put it in roles/fmw-software/files 14 | 15 | The playbook includes the following Ansible Roles: 16 | - linux-wls: Configures the linux system with required packages, kernel settings etc. 17 | - linux-jdk: Installs Oracle JDK 7. 18 | - fmw-software: Installs Oracle Fusion Middleware Infrastructure software. 19 | - fmw-domain: Creates a Domain with Fusion Middleware support (Enterprise Manager, JRF, etc). 20 | - fmw-managed-server: Creates a managed server for host applications. 21 | 22 | For test the playbook you can download Vagrant and Virtual Box and then run: 23 | - $ vagrant plugin install vagrant-hostmanager 24 | - $ vagrant up 25 | 26 | vagrant will provision vm with ansible playbook automatically 27 | 28 | When the playbook finishes execution you can connect to weblogic server using wls12c1.private:7001/console. 29 | 30 | For execute it alone use the following command 31 | - $ ansible-playbook weblogic-fmw-domain.yml 32 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # All Vagrant configuration is done below. The "2" in Vagrant.configure 5 | # configures the configuration version (we support older styles for 6 | # backwards compatibility). Please don't change it unless you know what 7 | # you're doing. 8 | Vagrant.configure(2) do |config| 9 | # The most common configuration options are documented and commented below. 10 | # For a complete reference, please see the online documentation at 11 | # https://docs.vagrantup.com. 12 | 13 | # Every Vagrant development environment requires a box. You can search for 14 | # boxes at https://atlas.hashicorp.com/search. 15 | config.vm.box = "boxcutter/centos71" 16 | 17 | # Disable automatic box update checking. If you disable this, then 18 | # boxes will only be checked for updates when the user runs 19 | # `vagrant box outdated`. This is not recommended. 20 | # config.vm.box_check_update = false 21 | 22 | config.vm.network "private_network", ip: "192.168.56.12" 23 | config.vm.hostname = "wls12c1.private" 24 | 25 | config.hostmanager.enabled = true 26 | config.hostmanager.ignore_private_ip = false 27 | 28 | 29 | # Create a forwarded port mapping which allows access to a specific port 30 | # within the machine from a port on the host machine. In the example below, 31 | # accessing "localhost:8080" will access port 80 on the guest machine. 32 | # config.vm.network "forwarded_port", guest: 80, host: 8080 33 | # config.vm.define 'wls12c1' do |node| 34 | #config.hostmanager.manage_host = true 35 | # config.hostmanager.include_offline = false 36 | # Create a private network, which allows host-only access to the machine 37 | # using a specific IP. 38 | # config.vm.network "private_network", ip: "192.168.33.10" 39 | # node.vm.hostname = "wls12c1.private" 40 | # node.vm.network "private_network", ip: "192.168.56.12" 41 | # end 42 | # Create a public network, which generally matched to bridged network. 43 | # Bridged networks make the machine appear as another physical device on 44 | # your network. 45 | # config.vm.network "public_network" 46 | 47 | # Share an additional folder to the guest VM. The first argument is 48 | # the path on the host to the actual folder. The second argument is 49 | # the path on the guest to mount the folder. And the optional third 50 | # argument is a set of non-required options. 51 | # config.vm.synced_folder "../data", "/vagrant_data" 52 | 53 | # Provider-specific configuration so you can fine-tune various 54 | # backing providers for Vagrant. These expose provider-specific options. 55 | # Example for VirtualBox: 56 | # 57 | # config.vm.provider "virtualbox" do |vb| 58 | # # Display the VirtualBox GUI when booting the machine 59 | # vb.gui = true 60 | # 61 | # # Customize the amount of memory on the VM: 62 | # vb.memory = "1024" 63 | # end 64 | # 65 | # View the documentation for the provider you are using for more 66 | # information on available options. 67 | config.vm.provider "virtualbox" do |vb| 68 | vb.memory = "4096" 69 | vb.cpus = 2 70 | vb.name = "Weblogic12c-1" 71 | end 72 | # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies 73 | # such as FTP and Heroku are also available. See the documentation at 74 | # https://docs.vagrantup.com/v2/push/atlas.html for more information. 75 | # config.push.define "atlas" do |push| 76 | # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" 77 | # end 78 | 79 | # Enable provisioning with a shell script. Additional provisioners such as 80 | # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the 81 | # documentation for more information about their specific syntax and use. 82 | # config.vm.provision "shell", inline: <<-SHELL 83 | # sudo apt-get update 84 | config.vm.provision "ansible" do |ansible| 85 | ansible.playbook = "weblogic-fmw-domain.yml" 86 | ansible.inventory_path = "./hosts" 87 | ansible.limit = 'all' 88 | #ansible.groups = { 89 | # "group1" => ["weblogic"] 90 | # } 91 | end 92 | end 93 | -------------------------------------------------------------------------------- /ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | hostfile = hosts 3 | remote_user = vagrant 4 | private_key_file = .vagrant/machines/default/virtualbox/private_key 5 | host_key_checking = False 6 | -------------------------------------------------------------------------------- /hosts: -------------------------------------------------------------------------------- 1 | weblogic ansible_ssh_host=192.168.56.12 ansible_ssh_port=22 2 | -------------------------------------------------------------------------------- /infra-vars.yml: -------------------------------------------------------------------------------- 1 | # Oracle os user and group 2 | oracle_user: 'oracle' 3 | oracle_group: 'oinstall' 4 | # Software and configuration main directory 5 | oracle_base: '/oracle/fmw12.1.3' 6 | 7 | # JDK installer and target folder 8 | jdk_installation_archive: 'jdk-7u85-linux-x64.tar.gz' 9 | jdk_folder: '{{ oracle_base }}/jdk1.7.0_85' 10 | 11 | # fmw installer 12 | mw_installer: 'fmw_12.1.3.0.0_infrastructure.jar' 13 | 14 | # database settings for repository 15 | dbserver_name: '192.168.56.11' 16 | dbserver_port: '1521' 17 | dbserver_service: 'pdborcl.private' 18 | repository_prefix: 'wls12c2' 19 | 20 | # Domain Name 21 | domain_name: 'adf_domain' 22 | 23 | # Nodemanager and server settings 24 | node_manager_listen_port: '5556' 25 | node_manager_listen_address: 'localhost' 26 | admin_server_hostname: 'localhost' 27 | admin_server_port: '7001' 28 | managed_server_name: 'adfsrv1' 29 | managed_server_port: '7003' -------------------------------------------------------------------------------- /roles/fmw-domain/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # ==> Main Tasks for fmw-domain Role 3 | # ==> Creates a Domain with Fussion Middleware Infra software 4 | # ==> Compatible with 12.1.3 5 | # ==> author: Christos Vezalis 6 | ################################################################################ 7 | 8 | # ==> Create Repository in Database 9 | - name: password response file for repository creation 10 | template: src=passwords.txt dest={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }} 11 | - name: copy create repository script 12 | template: src=create_repo.sh dest={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }} mode=0755 13 | - name: execute create repository script 14 | shell: "{{ mw_installer_folder }}/create_repo.sh" 15 | 16 | # ==> Create new domain 17 | - name: copy create domain python script 18 | template: src=create-domain.py dest={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }} 19 | - name: Execute create domain script 20 | shell: "{{ weblogic_home }}/common/bin/wlst.sh {{ mw_installer_folder }}/create-domain.py" 21 | sudo_user: '{{ oracle_user }}' 22 | 23 | # ==> Start nodemanager 24 | - name: Create security directoy to Nodemanager Home 25 | file: state=directory path={{ nodemanager_home }}/security owner={{ oracle_user }} group={{ oracle_group }} 26 | - name: Copy DemoIdentity key store to nodemanager home 27 | command: 'cp {{ domain_home }}/security/DemoIdentity.jks {{ nodemanager_home }}/security/DemoIdentity.jks' 28 | sudo_user: '{{ oracle_user }}' 29 | - name: Copy Nodemanager Properties file 30 | template: src=nodemanager.properties dest={{ nodemanager_home }}/ owner={{ oracle_user }} group={{ oracle_group }} 31 | 32 | # ==> Create startup script for nodemanager 33 | #- name: Copy init.d startup script 34 | # template: src=files/nodemgr dest=/etc/init.d/ mode=0755 35 | - name: Copy nodemanager systemd script 36 | template: src=nodemanager.service dest=/etc/systemd/system/ mode=0664 37 | - name: Enable nodemanager as linux service 38 | command: 'systemctl enable nodemanager' 39 | - name: Start Node Manager 40 | command: 'systemctl start nodemanager' 41 | - name: Waiting for nodemanager to come up 42 | wait_for: port=5556 delay=2 timeout=30 43 | 44 | # ==> Start AdminServer 45 | - name: Create security folder on Admin Server 46 | file: state=directory path={{ domains_home }}/{{ domain_name }}/servers/{{ admin_server_name }}/security owner={{ oracle_user }} group={{ oracle_group }} 47 | - name: Create boot.properties file 48 | template: src=boot.properties dest={{ domains_home }}/{{ domain_name }}/servers/{{ admin_server_name }}/security/ owner={{ oracle_user }} group={{ oracle_group }} 49 | - name: Copy Admin Server start-up script 50 | template: src=start-admin-server.py dest={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }} mode=0755 51 | - name: Execute start Admin Server script 52 | shell: "{{ weblogic_home }}/common/bin/wlst.sh {{ mw_installer_folder }}/start-admin-server.py" 53 | sudo_user: '{{ oracle_user }}' 54 | - name: Wait for Admin Server to startup 55 | wait_for: port={{ admin_server_port }} delay=2 timeout=60 56 | 57 | # ==> Create Environment Variables for Oracle user 58 | #- name: Creates new .bashrc file with system variables 59 | # template: src=.bashrc dest=/home/oracle/.bashrc 60 | - name: Add Oracle Home environment variables 61 | lineinfile: dest='/home/{{ oracle_user }}/.bashrc' line='export ORACLE_HOME={{ middleware_home }}' -------------------------------------------------------------------------------- /roles/fmw-domain/templates/.bashrc: -------------------------------------------------------------------------------- 1 | if [ -f /etc/bashrc ]; then 2 | . /etc/bashrc 3 | fi 4 | 5 | export DOMAINS_HOME={{ domains_home }} 6 | export APPLICATIONS_HOME={{ applications_home }} 7 | -------------------------------------------------------------------------------- /roles/fmw-domain/templates/boot.properties: -------------------------------------------------------------------------------- 1 | username={{ weblogic_admin }} 2 | password={{ weblogic_admin_pass }} 3 | -------------------------------------------------------------------------------- /roles/fmw-domain/templates/create-domain.py: -------------------------------------------------------------------------------- 1 | db_server_name = '{{ dbserver_name }}' 2 | db_server_port = '{{ dbserver_port }}' 3 | db_service = '{{ dbserver_service }}' 4 | data_source_url='jdbc:oracle:thin:@//' + db_server_name + ':' + db_server_port + '/' + db_service; 5 | data_source_user_prefix= '{{ repository_prefix }}' 6 | data_source_test='SQL SELECT 1 FROM DUAL'; 7 | 8 | domain_application_home = '{{ applications_home }}/{{ domain_name }}' 9 | domain_configuration_home = '{{ domains_home }}/{{ domain_name }}' 10 | domain_name = '{{ domain_name }}' 11 | java_home = '{{ jdk_folder }}' 12 | middleware_home = '{{ middleware_home }}' 13 | node_manager_home = '{{ nodemanager_home }}' 14 | weblogic_home = '{{ weblogic_home }}' 15 | 16 | weblogic_template=weblogic_home + '/common/templates/wls/wls.jar'; 17 | em_template=middleware_home + '/em/common/templates/wls/oracle.em_wls_template_12.1.3.jar'; 18 | 19 | readTemplate(weblogic_template); 20 | setOption('DomainName', domain_name); 21 | setOption('OverwriteDomain', 'true'); 22 | setOption('JavaHome', java_home); 23 | setOption('ServerStartMode', 'prod'); 24 | setOption('NodeManagerType', 'CustomLocationNodeManager'); 25 | setOption('NodeManagerHome', node_manager_home); 26 | cd('/Security/base_domain/User/weblogic'); 27 | cmo.setName('{{ weblogic_admin }}'); 28 | cmo.setUserPassword('{{ weblogic_admin_pass }}'); 29 | cd('/'); 30 | 31 | print "SAVE DOMAIN"; 32 | writeDomain(domain_configuration_home); 33 | closeTemplate(); 34 | 35 | print 'READ DOMAIN'; 36 | readDomain(domain_configuration_home); 37 | 38 | print 'ADD TEMPLATES'; 39 | addTemplate(em_template); 40 | #addTemplate(jrf_template); 41 | #addTemplate(coherence_template); 42 | setOption('AppDir', domain_application_home); 43 | 44 | jdbcsystemresources = cmo.getJDBCSystemResources(); 45 | for jdbcsystemresource in jdbcsystemresources: 46 | cd ('/JDBCSystemResource/' + jdbcsystemresource.getName() + '/JdbcResource/' + jdbcsystemresource.getName() + '/JDBCConnectionPoolParams/NO_NAME_0'); 47 | cmo.setInitialCapacity(1); 48 | cmo.setMaxCapacity(15); 49 | cmo.setMinCapacity(1); 50 | cmo.setStatementCacheSize(0); 51 | cmo.setTestConnectionsOnReserve(java.lang.Boolean('false')); 52 | cmo.setTestTableName(data_source_test); 53 | cmo.setConnectionCreationRetryFrequencySeconds(30); 54 | cd ('/JDBCSystemResource/' + jdbcsystemresource.getName() + '/JdbcResource/' + jdbcsystemresource.getName() + '/JDBCDriverParams/NO_NAME_0'); 55 | cmo.setUrl(data_source_url); 56 | cmo.setPasswordEncrypted('{{ datasource_password }}'); 57 | 58 | cd ('/JDBCSystemResource/' + jdbcsystemresource.getName() + '/JdbcResource/' + jdbcsystemresource.getName() + '/JDBCDriverParams/NO_NAME_0/Properties/NO_NAME_0/Property/user'); 59 | cmo.setValue(cmo.getValue().replace('DEV',data_source_user_prefix)); 60 | cd('/'); 61 | 62 | cd("/SecurityConfiguration/" + domain_name); 63 | cmo.setNodeManagerUsername('{{ nodemanager_username }}'); 64 | cmo.setNodeManagerPasswordEncrypted('{{ nodemanager_password }}'); 65 | 66 | cd('/Server/' + '{{ admin_server_name }}'); 67 | create('{{ admin_server_name }}','SSL'); 68 | cd('SSL/' + '{{ admin_server_name }}'); 69 | cmo.setHostnameVerificationIgnored(true); 70 | cmo.setHostnameVerifier(None); 71 | cmo.setTwoWaySSLEnabled(false); 72 | cmo.setClientCertificateEnforced(false); 73 | 74 | cd('/SecurityConfiguration/'+ domain_name +'/Realms/myrealm'); 75 | cd('AuthenticationProviders/DefaultAuthenticator'); 76 | set('ControlFlag', 'SUFFICIENT'); 77 | cd('../../'); 78 | 79 | updateDomain(); 80 | closeDomain(); 81 | -------------------------------------------------------------------------------- /roles/fmw-domain/templates/create_repo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPT=$(readlink -f $0) 4 | SCRIPT_PATH=$(dirname $SCRIPT) 5 | 6 | JAVA_HOME={{ jdk_folder }} 7 | export JAVA_HOME 8 | 9 | {{ middleware_home }}/oracle_common/bin/rcu -silent -createRepository -databaseType ORACLE -connectString {{ dbserver_name }}:{{ dbserver_port }}:{{ dbserver_service }} -dbUser sys -dbRole SYSDBA -schemaPrefix {{ repository_prefix }} -useSamePasswordForAllSchemaUsers true -component IAU -component IAU_APPEND -component IAU_VIEWER -component OPSS -component STB -component MDS -f < {{ mw_installer_folder }}/passwords.txt -------------------------------------------------------------------------------- /roles/fmw-domain/templates/nodemanager.properties: -------------------------------------------------------------------------------- 1 | DomainsFile={{ nodemanager_home }}/nodemanager.domains 2 | LogLimit=0 3 | PropertiesVersion=12.1.3 4 | AuthenticationEnabled=true 5 | NodeManagerHome={{ nodemanager_home }} 6 | JavaHome={{ jdk_folder }} 7 | LogLevel=INFO 8 | DomainsFileEnabled=true 9 | StartScriptName=startWebLogic.sh 10 | ListenAddress={{ node_manager_listen_address }} 11 | NativeVersionEnabled=true 12 | ListenPort={{ node_manager_listen_port }} 13 | LogToStderr=true 14 | SecureListener=true 15 | LogCount=1 16 | StopScriptEnabled=true 17 | QuitEnabled=true 18 | LogAppend=true 19 | StateCheckInterval=500 20 | CrashRecoveryEnabled=true 21 | StartScriptEnabled=true 22 | LogFile={{ nodemanager_home }}/nodemanager.log 23 | LogFormatter=weblogic.nodemanager.server.LogFormatter 24 | ListenBacklog=50 -------------------------------------------------------------------------------- /roles/fmw-domain/templates/nodemanager.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Node Manager controls the WebLogic Server runtime lifecycle 3 | After=network.target 4 | 5 | [Service] 6 | User={{ oracle_user }} 7 | Group={{ oracle_group }} 8 | Type=simple 9 | ExecStart={{ domain_home }}/bin/startNodeManager.sh >/dev/null 2>/dev/null & 10 | ExecStop={{ domain_home }}/bin/stopNodeManager.sh >/dev/null 2>/dev/null & 11 | PIDFile={{ nodemanager_home }}/nodemanager.process.id 12 | Restart=on-failure 13 | RestartSec=1 14 | 15 | [Install] 16 | WantedBy=default.target -------------------------------------------------------------------------------- /roles/fmw-domain/templates/passwords.txt: -------------------------------------------------------------------------------- 1 | {{ sysdba_passwd }} 2 | {{ datasource_password }} -------------------------------------------------------------------------------- /roles/fmw-domain/templates/start-admin-server.py: -------------------------------------------------------------------------------- 1 | nmConnect('{{ nodemanager_username }}', '{{ nodemanager_password }}', '{{ node_manager_listen_address }}', '{{ node_manager_listen_port }}', '{{ domain_name }}'); 2 | 3 | nmStart('{{ admin_server_name }}'); 4 | 5 | nmDisconnect(); 6 | -------------------------------------------------------------------------------- /roles/fmw-managed-server/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # ==> tasks for fmw-managed-server Role. Creates a managed server in an existing 3 | # ==> Fussion Middleware domain on a weblogic server. Supports 12.1.3 version 4 | # ==> author: Christos Vezalis 5 | # ############################################################################## 6 | 7 | # ==> Create managed server on Domain 8 | - name: Copy create managed server script 9 | template: src=create-managed.py dest={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }} 10 | - name: Execute create managed server script 11 | shell: '{{ weblogic_home }}/common/bin/wlst.sh {{ mw_installer_folder }}/create-managed.py' 12 | sudo_user: '{{ oracle_user }}' 13 | 14 | # ==> Start managed server 15 | - name: Create security folder for managed server 16 | file: state=directory path={{ domains_home }}/{{ domain_name }}/servers/{{ managed_server_name }}/security owner={{ oracle_user }} group={{ oracle_group }} 17 | - name: Create boot properties file for managed server 18 | template: src=boot.properties dest={{ domain_home }}/servers/{{ managed_server_name }}/security/ owner={{ oracle_user }} group={{ oracle_group }} 19 | - name: Copy Start Managed Server Script 20 | template: src=start-managed-server.py dest={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }} 21 | - name: Start Managed Server 22 | shell: "{{ weblogic_home }}/common/bin/wlst.sh {{ mw_installer_folder }}/start-managed-server.py" 23 | sudo_user: '{{ oracle_user }}' 24 | - name: Wait for Managed Server to startup 25 | wait_for: host={{ server_hostname }} port={{ managed_server_port }} delay=2 timeout=30 26 | -------------------------------------------------------------------------------- /roles/fmw-managed-server/templates/boot.properties: -------------------------------------------------------------------------------- 1 | username={{ weblogic_admin }} 2 | password={{ weblogic_admin_pass }} 3 | -------------------------------------------------------------------------------- /roles/fmw-managed-server/templates/create-managed.py: -------------------------------------------------------------------------------- 1 | ADMIN_SERVER_URL = 't3://' + '{{ admin_server_hostname }}' + ':' + '{{ admin_server_port }}'; 2 | 3 | connect('{{ weblogic_admin }}', '{{ weblogic_admin_pass }}', ADMIN_SERVER_URL); 4 | 5 | edit(); 6 | startEdit(); 7 | 8 | cd('/') 9 | cmo.createMachine('{{ server_hostname }}') 10 | 11 | cd('/Machines/' + '{{ server_hostname }}' + '/NodeManager/' + '{{ server_hostname }}') 12 | cmo.setListenAddress('{{ node_manager_listen_address }}') 13 | 14 | cd('/') 15 | cmo.createServer('{{ managed_server_name }}') 16 | 17 | cd('/Servers/' + '{{ managed_server_name }}') 18 | cmo.setListenAddress('{{ server_hostname }}') 19 | cmo.setListenPort({{ managed_server_port }}) 20 | cmo.setMachine(getMBean('/Machines/' + '{{ server_hostname }}')) 21 | applyJRF(target='{{ managed_server_name }}', domainDir='{{ domain_home }}'); 22 | 23 | # applyJRF wil call save and activate 24 | #save(); 25 | #activate(block='true'); 26 | disconnect(); 27 | -------------------------------------------------------------------------------- /roles/fmw-managed-server/templates/start-managed-server.py: -------------------------------------------------------------------------------- 1 | connect('{{ weblogic_admin }}', '{{ weblogic_admin_pass }}') 2 | start('{{ managed_server_name }}') 3 | 4 | #nmConnect('{{ nodemanager_username }}', '{{ nodemanager_password }}', '{{ node_manager_listen_address }}', '{{ node_manager_listen_port }}', '{{ domain_name }}'); 5 | #nmStart('{{ managed_server_name }}'); 6 | #nmDisconnect(); -------------------------------------------------------------------------------- /roles/fmw-software/files/fmw_12.1.3.0.0_infrastructure.jar.sample: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cvezalis/weblogic-ansible/e849ced4313ce32178d5d33a72ec4acb1253d3a4/roles/fmw-software/files/fmw_12.1.3.0.0_infrastructure.jar.sample -------------------------------------------------------------------------------- /roles/fmw-software/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # ==> Tasks for install Oracle Fussion Middleware Infrastructure software 3 | # ==> to a RHEL 7 system. Supports version 12.1.3 4 | # ==> author: Christos Vezalis 5 | ################################################################################ 6 | 7 | # ==> Install Fussion Middleware Infrastructure 8 | - name: Create installer directory 9 | file: state=directory path={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }} 10 | - name: Copy Middleware Installer 11 | copy: src={{ mw_installer }} dest={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }} 12 | - name: Copy file for silent installation 13 | template: src=silent-weblogic.txt dest={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }} 14 | - name: Copy OraInst.loc 15 | template: src=oraInst.loc dest={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }} 16 | - name: execute Weblogic installer 17 | command: "{{ jdk_folder }}/bin/java -Xms1024m -Xmx1024m -jar {{ mw_installer_folder }}/{{ mw_installer }} -silent -responseFile {{ mw_installer_folder }}/silent-weblogic.txt -invPtrLoc {{ mw_installer_folder }}/oraInst.loc" 18 | sudo_user: '{{ oracle_user }}' 19 | -------------------------------------------------------------------------------- /roles/fmw-software/templates/oraInst.loc: -------------------------------------------------------------------------------- 1 | inventory_loc={{ oracle_base }} 2 | inst_group={{ oracle_group }} -------------------------------------------------------------------------------- /roles/fmw-software/templates/silent-weblogic.txt: -------------------------------------------------------------------------------- 1 | [ENGINE] 2 | 3 | #DO NOT CHANGE THIS. 4 | Response File Version=1.0.0.0.0 5 | 6 | [GENERIC] 7 | 8 | #The oracle home location. This can be an existing Oracle Home or a new Oracle Home 9 | ORACLE_HOME={{ middleware_home }} 10 | 11 | #Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence, Complete with Examples. 12 | INSTALL_TYPE=Fusion Middleware Infrastructure 13 | 14 | #Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name. 15 | MYORACLESUPPORT_USERNAME= 16 | 17 | #Provide the My Oracle Support Password 18 | MYORACLESUPPORT_PASSWORD= 19 | 20 | #Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration 21 | DECLINE_SECURITY_UPDATES=true 22 | 23 | #Set this to true if My Oracle Support Password is specified 24 | SECURITY_UPDATES_VIA_MYORACLESUPPORT=false 25 | 26 | #Provide the Proxy Host 27 | PROXY_HOST= 28 | 29 | #Provide the Proxy Port 30 | PROXY_PORT= 31 | 32 | #Provide the Proxy Username 33 | PROXY_USER= 34 | 35 | #Provide the Proxy Password 36 | PROXY_PWD= 37 | 38 | #Type String (URL format) Indicates the OCM Repeater URL which should be of the format [scheme[Http/Https]]://[repeater host]:[repeater port] 39 | COLLECTOR_SUPPORTHUB_URL= 40 | -------------------------------------------------------------------------------- /roles/linux-jdk/files/jdk-7u85-linux-x64.tar.gz.sample: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cvezalis/weblogic-ansible/e849ced4313ce32178d5d33a72ec4acb1253d3a4/roles/linux-jdk/files/jdk-7u85-linux-x64.tar.gz.sample -------------------------------------------------------------------------------- /roles/linux-jdk/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # ==> tasks for linux-jdk Role that installs JDK in a RHEL 7 system 3 | # ==> author: Christos Vezalis 4 | ################################################################################ 5 | 6 | # ==> Install JDK 7 | - name: Copy jdk archive to host 8 | copy: src={{ jdk_installation_archive }} dest=~/{{ jdk_installation_archive }} 9 | args: 10 | force: no 11 | - name: Extract JDK archive 12 | command: 'tar -xf ~/{{ jdk_installation_archive }} -C {{ oracle_base }}' 13 | args: 14 | creates: "{{ jdk_folder }}" 15 | - name: Change ownership of jdk folder 16 | file: path="{{ jdk_folder }}" owner={{ oracle_user }} group={{ oracle_group }} recurse=yes 17 | - name: Change entropy device for java 18 | command: "sed -i.bak 's/urandom/.\\/urandom/' {{ jdk_folder }}/jre/lib/security/java.security" 19 | - name: Add JAVA_HOME environment variariables in bashrc 20 | lineinfile: dest='/home/{{ oracle_user }}/.bashrc' line='export JAVA_HOME={{ jdk_folder }}' 21 | - name: Add Java bin folder to path in bashrc 22 | lineinfile: dest='/home/{{ oracle_user }}/.bashrc' line='export PATH=$PATH:$JAVA_HOME/bin' 23 | -------------------------------------------------------------------------------- /roles/linux-wls/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # ==> Tasks for linux-wls Role for configure a RHEL 7 system with requirements 3 | # ==> for Fusion Middleware infrastructrure installation. Supports version 12.1.3 4 | # ==> author: Christos Vezalis 5 | ################################################################################ 6 | 7 | # ==> Configure Linux 8 | - name: Install required libraries 9 | yum: name={{ item }} state=present 10 | with_items: packages_list 11 | - name: Disable SELinux 12 | selinux: state=disabled 13 | - name: Disable Firewall Deamon (firewalld) 14 | service: name=firewalld state=stopped enabled=no 15 | - name: Change kernel parameters 16 | sysctl: name="{{ item.key }}" value="{{ item.value }}" state=present 17 | with_dict: kernel_params 18 | 19 | # ==> Create user and groups 20 | - name: Create groups 21 | group: name={{ oracle_group }} state=present 22 | - name: Create user 23 | user: name={{ oracle_user }} groups={{ oracle_group }} password={{ oracle_os_user_pass }} 24 | 25 | # ==> Add open file and process limits for oracle user 26 | - name: Add soft limit number of open files 27 | lineinfile: dest=/etc/security/limits.conf line='{{ oracle_user }} soft nofile {{ soft_no_file }}' 28 | - name: Add hard limit for number of open files 29 | lineinfile: dest=/etc/security/limits.conf line='{{ oracle_user }} hard nofile {{ hard_no_file }}' 30 | - name: Add soft limit for number of processes 31 | lineinfile: dest=/etc/security/limits.conf line='{{ oracle_user }} soft nproc {{ soft_nproc }}' 32 | - name: Add hard limit for number of processes 33 | lineinfile: dest=/etc/security/limits.conf line='{{ oracle_user }} hard nproc {{ hard_nproc }}' 34 | - name: Create a shell profile with file and process limits for oracle user 35 | template: src=oracle-limits.sh dest=/etc/profile.d/ 36 | 37 | # ==> Create Base Directories 38 | - name: Create Oracle Home directory 39 | file: state=directory path={{ middleware_home }} owner={{ oracle_user }} group={{ oracle_group }} 40 | - name: Create Domain Home directory 41 | file: state=directory path={{ domains_home }} owner={{ oracle_user }} group={{ oracle_group }} 42 | - name: Create Applications Home directory 43 | file: state=directory path={{ applications_home }} owner={{ oracle_user }} group={{ oracle_group }} 44 | -------------------------------------------------------------------------------- /roles/linux-wls/templates/oracle-limits.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $USER = "{{ oracle_user }}" ]; then 4 | if [ $SHELL = "/bin/ksh" ]; then 5 | ulimit -p {{ hard_nproc }} 6 | ulimit -n {{ hard_no_file }} 7 | else 8 | ulimit -u {{ hard_nproc }} -n {{ hard_no_file }} 9 | fi 10 | fi -------------------------------------------------------------------------------- /roles/linux-wls/vars/main.yml: -------------------------------------------------------------------------------- 1 | packages_list: 2 | - 'binutils' 3 | - 'compat-libcap1' 4 | - 'compat-libstdc++-33.x86_64' 5 | - 'gcc.x86_64' 6 | - 'gcc-c++.x86_64' 7 | - 'glibc.x86_64' 8 | - 'glibc-devel.x86_64' 9 | - 'libaio.x86_64' 10 | - 'libaio-devel.x86_64' 11 | - 'libgcc.x86_64' 12 | - 'libstdc++.x86_64' 13 | - 'libstdc++-devel.x86_64' 14 | - 'ksh' 15 | - 'make' 16 | - 'sysstat' 17 | kernel_params: 18 | kernel.shmmax: 2147483648 19 | kernel.shmall: 524288 20 | net.core.rmem_max: 16777216 21 | net.core.wmem_max: 16777216 22 | net.ipv4.tcp_rmem: 4096 87380 16777216 23 | net.ipv4.tcp_wmem: 4096 65536 16777216 24 | vm.swappiness: 10 25 | vm.dirty_background_ratio: 5 26 | vm.dirty_ratio: 10 27 | fs.file-max: 262144 28 | net.ipv4.tcp_keepalive_time: 300 29 | net.ipv4.tcp_keepalive_intvl: 60 30 | net.ipv4.tcp_keepalive_probes: 10 31 | soft_no_file: 4096 32 | hard_no_file: 65536 33 | soft_nproc: 2047 34 | hard_nproc: 16384 -------------------------------------------------------------------------------- /secrets.yml: -------------------------------------------------------------------------------- 1 | datasource_password: 'oracle' 2 | nodemanager_password: 'welcome1' 3 | weblogic_admin_pass: 'welcome1' 4 | oracle_os_user_pass: '$6$P7jw3OaWKdR$tRSRPjTey.SPqhyLBxOKbm9k21MEYF6jHDUH2O03RPvISDVnkGqWNg1W6iJqZhqD3ErbdJZqUEuNnEuoAWHWO/' 5 | sysdba_passwd: 'oracle' 6 | datasource_password: 'oracle' 7 | -------------------------------------------------------------------------------- /weblogic-fmw-domain.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - name: Configure RHEL 7 with WebLogic 12c domain 3 | hosts: weblogic 4 | sudo: True 5 | vars_files: 6 | # User defined variables for infrastructure 7 | - infra-vars.yml 8 | - wls-vars.yml 9 | - secrets.yml 10 | roles: 11 | - role: linux-wls 12 | - role: linux-jdk 13 | - role: fmw-software 14 | - role: fmw-domain 15 | - role: fmw-managed-server 16 | pre_tasks: 17 | # ==> Fix hosts file. Remove hostname from local loop. A workaround for vagrant 18 | # adding hostname to local loop 19 | - name: fix host file 127.0.0.1 entry 20 | lineinfile: dest=/etc/hosts regexp='^127\.0\.0\.1' line='127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4' owner=root group=root mode=0644 21 | -------------------------------------------------------------------------------- /wls-vars.yml: -------------------------------------------------------------------------------- 1 | # Common paths and names 2 | middleware_home: '{{ oracle_base }}/product/Oracle_Home' 3 | middleware_common_home: '{{ middleware_home }}/oracle_common' 4 | domains_home: '{{ oracle_base }}/config/Domains' 5 | applications_home: '{{ oracle_base }}/config/applications' 6 | mw_installer_folder: '{{ oracle_base }}/installer' 7 | domain_home: '{{ domains_home }}/{{ domain_name }}' 8 | nodemanager_home: '{{ oracle_base }}/config/nodemanagers/{{ domain_name }}' 9 | weblogic_home: '{{ middleware_home }}/wlserver' 10 | nodemanager_username: 'weblogic' 11 | weblogic_admin: 'weblogic' 12 | admin_server_name: 'AdminServer' 13 | server_hostname: '{{ ansible_fqdn }}' 14 | --------------------------------------------------------------------------------