├── LICENSE
├── README.md
├── 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-8u172-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 Playbook
2 | =========================
3 |
4 | ## Detailed info
5 |
6 | An Ansible Playbook (weblogic-fmw-domain.yml) to install and configure a WebLogic Server 12c with
7 | Oracle Fusion Middleware software for hosting Oracle Fusion Middleware (for example ADF) applications in Redhat Linux 7 (RHEL/CentOS/Oracle Linux) system.
8 | This playbook is for version 12.2.1.3 of WebLogic and Fusion Middleware Infrastructure software.
9 |
10 | Requirements for running the playbook:
11 | - Configure your environment variables in infra-vars.yml.
12 | - Set your passwords in secrets.yml.
13 | - A running Oracle Database for hosting the repositories is required and sys user password for generates the repositories.
14 | - A running RHEL 7 system with minimal installation with network configured. (IP address, hostname etc).
15 | - Download the latest Java 8 jdk and put the file in roles/linux-jdk/files and configure infra-vars.yml with that file name.
16 | - Download the 12.2.1.3 Oracle Fusion Middleware installer from Oracle support and put it in roles/fmw-software/files
17 |
18 | The playbook includes the following Ansible Roles:
19 | - linux-wls: Configures the linux system with required packages, kernel settings etc.
20 | - linux-jdk: Installs Oracle JDK 8.
21 | - fmw-software: Installs Oracle Fusion Middleware Infrastructure software.
22 | - fmw-domain: Creates a Domain with Fusion Middleware support (Enterprise Manager, JRF, etc).
23 | - fmw-managed-server: Creates a managed server for host applications.
24 |
25 | When the playbook finishes execution you can connect to weblogic server using wls12c1.private:7001/console.
26 |
27 | ## Licence
28 |
29 | Forked project. Copyright (c) 2018 Stavros Kalapothas (aka Stevaras) .
30 | It is free software, and may be redistributed under the terms of the GNU Licence.
--------------------------------------------------------------------------------
/ansible.cfg:
--------------------------------------------------------------------------------
1 | [defaults]
2 | hostfile = hosts
3 | host_key_checking = False
--------------------------------------------------------------------------------
/hosts:
--------------------------------------------------------------------------------
1 | weblogic ansible_ssh_host=192.168.56.102 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-8u172-linux-x64.tar.gz'
9 | jdk_folder: '{{ oracle_base }}/jdk1.8.0_172'
10 |
11 | # fmw installer
12 | mw_installer: 'fmw_12.2.1.3.0_infrastructure.jar'
13 |
14 | # database settings for repository
15 | dbserver_name: '192.168.56.102'
16 | dbserver_port: '1521'
17 | #dbserver_service: 'pdborcl.private'
18 | #dbserver_service: 'oradb3.private'
19 | dbserver_service: 'db.oradb3.private'
20 | repository_prefix: 'wls12c2'
21 |
22 | # Domain Name
23 | domain_name: 'adf_domain'
24 |
25 | # Nodemanager and server settings
26 | node_manager_listen_port: '5556'
27 | node_manager_listen_address: 'localhost'
28 | admin_server_hostname: 'localhost'
29 | admin_server_port: '7001'
30 | managed_server_name: 'adfsrv1'
31 | 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.2.1.3
5 | # ==> author: Stavros Kalapothas
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 | become: yes
15 | become_user: '{{ oracle_user }}'
16 | shell: "{{ mw_installer_folder }}/create_repo.sh"
17 |
18 | # ==> Create new domain
19 | - name: copy create domain python script
20 | template: src=create-domain.py dest={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }}
21 | - name: Execute create domain script
22 | become: yes
23 | become_user: '{{ oracle_user }}'
24 | shell: "{{ weblogic_home }}/common/bin/wlst.sh {{ mw_installer_folder }}/create-domain.py"
25 | #sudo_user: '{{ oracle_user }}'
26 |
27 | # ==> Start nodemanager
28 | - name: Create security directoy to Nodemanager Home
29 | file: state=directory path={{ nodemanager_home }}/security owner={{ oracle_user }} group={{ oracle_group }}
30 | - name: Copy DemoIdentity key store to nodemanager home
31 | become: yes
32 | become_user: '{{ oracle_user }}'
33 | #command: 'cp {{ domain_home }}/security/DemoIdentity.jks {{ nodemanager_home }}/security/DemoIdentity.jks'
34 | #command: 'cp /oracle/fmw12.1.3/product/Oracle_Home/wlserver/server/lib/DemoIdentity.jks {{ nodemanager_home }}/security/DemoIdentity.jks {{ domain_home }}/security/'
35 | #command: 'for i in {{ nodemanager_home }}/security/ {{ domain_home }}/security/ ; do cp {{ middleware_home }}/wlserver/server/lib/DemoIdentity.jks $i; done'
36 | #template: src={{ middleware_home }}/wlserver/server/lib/DemoIdentity.jks dest={{ nodemanager_home }}/security/ owner={{ oracle_user }} group={{ oracle_group }}
37 | #template: src={{ middleware_home }}/wlserver/server/lib/DemoIdentity.jks dest={{ domain_home }}/security/ owner={{ oracle_user }} group={{ oracle_group }}
38 | command: '{{ item }}'
39 | with_items:
40 | - cp /oracle/fmw12.1.3/product/Oracle_Home/wlserver/server/lib/DemoIdentity.jks {{ domain_home }}/security/
41 | - cp /oracle/fmw12.1.3/product/Oracle_Home/wlserver/server/lib/DemoIdentity.jks {{ nodemanager_home }}/security/
42 |
43 | #sudo_user: '{{ oracle_user }}'
44 | - name: Copy Nodemanager Properties file
45 | template: src=nodemanager.properties dest={{ nodemanager_home }}/ owner={{ oracle_user }} group={{ oracle_group }}
46 |
47 | # ==> Create startup script for nodemanager
48 | #- name: Copy init.d startup script
49 | # template: src=files/nodemgr dest=/etc/init.d/ mode=0755
50 | - name: Copy nodemanager systemd script
51 | template: src=nodemanager.service dest=/etc/systemd/system/ mode=0664
52 | - name: Enable nodemanager as linux service
53 | command: 'systemctl enable nodemanager'
54 | - name: Start Node Manager
55 | command: 'systemctl start nodemanager'
56 | - name: Waiting for nodemanager to come up
57 | wait_for: port=5556 delay=2 timeout=30
58 |
59 | # ==> Start AdminServer
60 | - name: Create security folder on Admin Server
61 | file: state=directory path={{ domains_home }}/{{ domain_name }}/servers/{{ admin_server_name }}/security owner={{ oracle_user }} group={{ oracle_group }}
62 | - name: Create boot.properties file
63 | template: src=boot.properties dest={{ domains_home }}/{{ domain_name }}/servers/{{ admin_server_name }}/security/ owner={{ oracle_user }} group={{ oracle_group }}
64 | - name: Copy Admin Server start-up script
65 | template: src=start-admin-server.py dest={{ mw_installer_folder }} owner={{ oracle_user }} group={{ oracle_group }} mode=0755
66 | - name: Execute start Admin Server script
67 | #shell: "{{ weblogic_home }}/common/bin/wlst.sh {{ mw_installer_folder }}/start-admin-server.py"
68 | become: yes
69 | become_user: '{{ oracle_user }}'
70 | shell: "{{ domains_home }}/{{ domain_name }}/bin/startWebLogic.sh &"
71 |
72 | #sudo_user: '{{ oracle_user }}'
73 | - name: Wait for Admin Server to startup
74 | wait_for: port={{ admin_server_port }} delay=2 timeout=300
75 |
76 | # ==> Create Environment Variables for Oracle user
77 | #- name: Creates new .bashrc file with system variables
78 | # template: src=.bashrc dest=/home/oracle/.bashrc
79 | - name: Add Oracle Home environment variables
80 | 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_driver='oracle.jdbc.OracleDriver'
7 | data_source_test='SQL SELECT 1 FROM DUAL';
8 |
9 | domain_application_home = '{{ applications_home }}/{{ domain_name }}'
10 | domain_configuration_home = '{{ domains_home }}/{{ domain_name }}'
11 | domain_name = '{{ domain_name }}'
12 | java_home = '{{ jdk_folder }}'
13 | middleware_home = '{{ middleware_home }}'
14 | node_manager_home = '{{ nodemanager_home }}'
15 | weblogic_home = '{{ weblogic_home }}'
16 |
17 | weblogic_template=weblogic_home + '/common/templates/wls/wls.jar';
18 | em_template=middleware_home + '/em/common/templates/wls/oracle.em_wls_template.jar';
19 |
20 | readTemplate(weblogic_template);
21 | setOption('AppDir', domain_application_home);
22 | setOption('DomainName', domain_name);
23 | setOption('OverwriteDomain', 'true');
24 | setOption('JavaHome', java_home);
25 | setOption('ServerStartMode', 'prod');
26 | setOption('NodeManagerType', 'CustomLocationNodeManager');
27 | setOption('NodeManagerHome', node_manager_home);
28 |
29 | cd('/Security/base_domain/User/weblogic');
30 | cmo.setName('{{ weblogic_admin }}');
31 | cmo.setUserPassword('{{ weblogic_admin_pass }}');
32 | cmo.setPassword('{{ weblogic_admin_pass }}');
33 |
34 | cd('/');
35 |
36 | print "SAVE DOMAIN";
37 | writeDomain(domain_configuration_home);
38 | closeTemplate();
39 |
40 | print 'READ DOMAIN';
41 | readDomain(domain_configuration_home);
42 |
43 | print 'ADD TEMPLATES';
44 | #addTemplate(em_template);
45 | #addTemplate(jrf_template);
46 | #addTemplate(coherence_template);
47 | #setOption('AppDir', domain_application_home);
48 |
49 | #connect('{{ weblogic_admin }}','{{ weblogic_admin_pass }}','t3://192.168.56.102:7001')
50 | #jdbcsystemresources = cmo.getJDBCSystemResources();
51 | #for jdbcsystemresource in jdbcsystemresources:
52 | #cd ('/JDBCSystemResource/' + jdbcsystemresource.getName() + '/JdbcResource/' + jdbcsystemresource.getName() + '/JDBCConnectionPoolParams/NO_NAME_0');
53 | #cmo.setInitialCapacity(1);
54 | #cmo.setMaxCapacity(15);
55 | #cmo.setMinCapacity(1);
56 | #cmo.setStatementCacheSize(0);
57 | #cmo.setTestConnectionsOnReserve(java.lang.Boolean('false'));
58 | #cmo.setTestTableName(data_source_test);
59 | #cmo.setConnectionCreationRetryFrequencySeconds(30);
60 | #cd ('/JDBCSystemResource/' + jdbcsystemresource.getName() + '/JdbcResource/' + jdbcsystemresource.getName() + '/JDBCDriverParams/NO_NAME_0');
61 | #cmo.setUrl(data_source_url);
62 | #cmo.setPasswordEncrypted('{{ datasource_password }}');
63 |
64 | #cd ('/JDBCSystemResource/' + jdbcsystemresource.getName() + '/JdbcResource/' + jdbcsystemresource.getName() + '/JDBCDriverParams/NO_NAME_0/Properties/NO_NAME_0/Property/user');
65 | #cmo.setValue(cmo.getValue().replace('DEV',data_source_user_prefix));
66 |
67 | #cd('/');
68 |
69 | jdbcsystemresources = cmo.getJDBCSystemResources()
70 | for jdbcsystemresource in jdbcsystemresources:
71 | cd ('/JDBCSystemResource/' + jdbcsystemresource.getName() + '/JdbcResource/' \
72 | + jdbcsystemresource.getName() + '/JDBCConnectionPoolParams/NO_NAME_0')
73 | cmo.setInitialCapacity(1)
74 | cmo.setMaxCapacity(15)
75 | cmo.setMinCapacity(1)
76 | cmo.setStatementCacheSize(0)
77 | cmo.setTestConnectionsOnReserve(java.lang.Boolean('false'))
78 | cmo.setTestTableName(data_source_test)
79 | cmo.setConnectionCreationRetryFrequencySeconds(30)
80 | cd ('/JDBCSystemResource/' + jdbcsystemresource.getName() + '/JdbcResource/' \
81 | + jdbcsystemresource.getName() + '/JDBCDriverParams/NO_NAME_0')
82 | cmo.setUrl(data_source_url)
83 | cmo.setPasswordEncrypted(data_source_password)
84 | cd ('/JDBCSystemResource/' + jdbcsystemresource.getName() + '/JdbcResource/' \
85 | + jdbcsystemresource.getName() + '/JDBCDriverParams/NO_NAME_0/Properties/NO_NAME_0/Property/user')
86 | cmo.setValue(cmo.getValue().replace('DEV', data_source_user_prefix))
87 |
88 | cd('/')
89 |
90 | cd("/SecurityConfiguration/" + domain_name);
91 | cmo.setNodeManagerUsername('{{ nodemanager_username }}');
92 | cmo.setNodeManagerPasswordEncrypted('{{ nodemanager_password }}');
93 |
94 | cd('/Server/' + '{{ admin_server_name }}');
95 | #set('Enabled', 'True');
96 | set('ListenPort', 7001);
97 | create('{{ admin_server_name }}','SSL');
98 |
99 | cd('SSL/' + '{{ admin_server_name }}');
100 | cmo.setHostnameVerificationIgnored(true);
101 | cmo.setHostnameVerifier(None);
102 | cmo.setTwoWaySSLEnabled(false);
103 | cmo.setClientCertificateEnforced(false);
104 |
105 | cd('/SecurityConfiguration/'+ domain_name +'/Realms/myrealm');
106 | cd('AuthenticationProviders/DefaultAuthenticator');
107 | set('ControlFlag', 'SUFFICIENT');
108 | cd('../../');
109 |
110 | #updateDomain();
111 | closeDomain();
--------------------------------------------------------------------------------
/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=/oracle/fmw12.1.3/config/nodemanagers/adf_domain/nodemanager.domains
2 | #KeyStores=CustomIdentityAndCustomTrust
3 | #KeyStores=DemoIdentityAndDemoTrust
4 | #CustomIdentityKeystoreType=jks
5 | #CustomIdentityKeyStoreFileName=/oracle/fmw12.1.3/config/nodemanagers/adf_domain/security/DemoIdentity.jks
6 | #CustomIdentityKeyStoreFileName=/oracle/fmw12.1.3/product/Oracle_Home/wlserver/server/lib/DemoIdentity.jks
7 | #CustomIdentityKeyStorePassPhrase={AES}Zgn0msgFMjBq5TdV2gImWXefe7DGX79BkjRzBCMY6M0=
8 | #PrivateKeyPassPhrase=password
9 | #CustomIdentityAlias=mykey
10 | #CustomTrustKeyStoreFileName=/oracle/fmw12.1.3/product/Oracle_Home/wlserver/server/lib/DemoTrust.jks
11 | #CustomTrustKeyStorePassPhrase=password
12 | LogLimit=0
13 | PropertiesVersion=12.2.1.3.0
14 | AuthenticationEnabled=true
15 | NodeManagerHome=/oracle/fmw12.1.3/config/nodemanagers/adf_domain
16 | JavaHome=/oracle/fmw12.1.3/jdk1.8.0_172
17 | LogLevel=INFO
18 | DomainsFileEnabled=true
19 | StartScriptName=startWebLogic.sh
20 | ListenAddress=localhost
21 | NativeVersionEnabled=true
22 | ListenPort=5556
23 | LogToStderr=true
24 | SecureListener=true
25 | LogCount=1
26 | StopScriptEnabled=true
27 | QuitEnabled=true
28 | LogAppend=true
29 | StateCheckInterval=500
30 | CrashRecoveryEnabled=true
31 | StartScriptEnabled=true
32 | LogFile=/oracle/fmw12.1.3/config/nodemanagers/adf_domain/nodemanager.log
33 | LogFormatter=weblogic.nodemanager.server.LogFormatter
34 | 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.2.1.3 version
4 | # ==> author: Stavros Kalapothas
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=60
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/Stavros/weblogic-ansible/416d361f6f4b998e1454a57dda505656342d24a7/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.2.1.3
4 | # ==> author: Stavros Kalapothas
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 | become: true
20 | become_user: '{{ oracle_user }}'
--------------------------------------------------------------------------------
/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-8u172-linux-x64.tar.gz.sample:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Stavros/weblogic-ansible/416d361f6f4b998e1454a57dda505656342d24a7/roles/linux-jdk/files/jdk-8u172-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: Stavros Kalapothas
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: Stavros Kalapothas
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'
--------------------------------------------------------------------------------
/weblogic-fmw-domain.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - name: Configure RHEL 7 with WebLogic 12c domain
3 | hosts: all
4 | become: yes
5 | become_user: root
6 | vars_files:
7 | # User defined variables for infrastructure
8 | - infra-vars.yml
9 | - wls-vars.yml
10 | - secrets.yml
11 | roles:
12 | - role: linux-wls
13 | - role: linux-jdk
14 | - role: fmw-software
15 | - role: fmw-domain
16 | - role: fmw-managed-server
17 |
--------------------------------------------------------------------------------
/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 | server_hostname: 'localhost'
--------------------------------------------------------------------------------