Skip to content

Commit b069f97

Browse files
committed
Initial commit
0 parents  commit b069f97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1256
-0
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.DS_Store
2+
*.log
3+
4+
# Inventory
5+
inventory/*
6+
!inventory/default
7+
8+
# Addons
9+
addons/*
10+
!addons/readme.txt
11+
12+
# Roles and more..
13+
roles/fmw/files/*.jar
14+
roles/jdk/files/*.tar.gz
15+
roles/managed/files/*.jks
16+
roles/update/ssl/files/*.jks
17+
roles/deploy/files/*.war
18+
roles/deploy/files/*.ear

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"editor.defaultFormatter": "vscode.git",
3+
"[markdown]": {
4+
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
5+
},
6+
"[yaml]": {
7+
"editor.insertSpaces": true,
8+
"editor.tabSize": 2,
9+
"editor.autoIndent": "none"
10+
},
11+
"markdown.extension.toc.slugifyMode": "gitea",
12+
"markdown.extension.tableFormatter.normalizeIndentation": true,
13+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Sergejs Gračovs (zippo294@icloud.com)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
# Weblogic Cluster provisioning
2+
3+
Repository contains everything to provision a Weblogic Cluster on any RedHat 7+ based system..
4+
5+
- [1. Requirements](#1-requirements)
6+
- [1.1. Proxy requirements](#1-1-proxy-requirements)
7+
- [2. Configuration](#2-configuration)
8+
- [2.1 Installers configuration](#2-1-installers-configuration)
9+
- [3. Testing configuration](#3-testing-configuration)
10+
- [4. Installation](#4-installation)
11+
- [5. Uninstall](#5-uninstall)
12+
- [6. Cluster maintanace tasks](#6-cluster-maintanace-tasks)
13+
14+
<br>
15+
16+
## 1. Requirements
17+
18+
**System requirements**:
19+
- 1 VM with minimums of 2 cpus and 4GB RAM (HDD size is on your preference) for AdminServer
20+
- 1 - ∞ VMs with minimum of 2 cpus and 8GB RAM each (HDD size is on your preference) for Managed Servers
21+
- static IPs on all VMs
22+
- supported linux OS: RedHat/CentOS 7/8, Oracle Linux 7/8, Rocky 8, AlmaLinux 8
23+
24+
**Workstation requirements**:
25+
- [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
26+
27+
**Additional requirements**:
28+
- NFS share for shared domain on all hosts, mounted on: `/u01/oracle`
29+
- [VMs and Workstation requirements](docs/requirements.md)
30+
31+
### 1.1. Proxy requirements
32+
33+
Access to following external resources are required:
34+
35+
- Access to OS repository (yum/apt)
36+
- Access to Python packages (*.python.org, *.pypi.org, *.pythonhosted.org)
37+
- Access to Oracle Java and Middleware installer download (*.oracle.com)
38+
39+
<br>
40+
41+
## 2. Configuration
42+
43+
- Create copy of `inventory/default` directory and name it after your environment, example: `inventory/<environment>`.
44+
- Edit your environment `inventory.ini` file by filling out environment servers configuration values.
45+
- Edit your environment `all.yml` file by filling out environment specific configuration values (also see [2.1 Installers](#21-installers)).
46+
- Edit your environment `all-vault.yml` file by filling out environment specific secrets.
47+
48+
> NOTE: Encrypt the `all-vault.yaml` file using `ansible-vault encrypt inventory/<environment>/group_vars/all/all-vault.yml` and providing secure password.
49+
50+
### 2.1 Installers configuration
51+
52+
> NOTE: Instructions for downloading and configuring installers.
53+
54+
Download [Linux x64 Compressed Archive](https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html) and place `tar.gz` archive to:
55+
56+
```
57+
./roles/jdk/files/jdk-8u371-linux-x64.tar.gz
58+
```
59+
60+
Also set archive name (ex. `jdk-8u371-linux-x64.tar.gz`) as value for variable in your environments [all.yml](inventory/default/group_vars/all/all.yml#L2) file.
61+
62+
```yml
63+
jdk_installer_archive: 'jdk-8u371-linux-x64.tar.gz'
64+
```
65+
66+
Download [Generic Installer for Oracle WebLogic Server 12.2.1.4](https://www.oracle.com/middleware/technologies/weblogic-server-installers-downloads.html), extract archive and place generic `jar` installer to:
67+
68+
```
69+
./roles/wls/files/fmw_12.2.1.4.0_wls_lite_generic.jar
70+
```
71+
72+
Also set installer name (ex. `fmw_12.2.1.4.0_wls_lite_generic.jar`) as value for variable in your environments [all.yml](inventory/default/group_vars/all/all.yml#L5) file.
73+
74+
```yml
75+
fmw_installer: 'fmw_12.2.1.4.0_wls_lite_generic.jar'
76+
```
77+
78+
<br>
79+
80+
## 3. Testing configuration
81+
82+
Before installation you can test connection to your VMs using [check.yml](playbooks/check.yml) playbook.
83+
84+
Simply run:
85+
86+
```shell
87+
ansible-playbook -i inventory/<environment>/inventory.ini playbooks/check.yml --ask-vault-pass
88+
```
89+
90+
Output should look like this:
91+
92+
> NOTE: If playbook ran with no errors, then you are ready to begin installation.
93+
94+
```shell
95+
...
96+
TASK [debug] **********************************************************************
97+
ok: [wl-admin] =>
98+
msg:
99+
- 'os_family: RedHat'
100+
- 'distribution: AlmaLinux'
101+
- 'major_version: 8'
102+
ok: [wl-node-01] =>
103+
msg:
104+
- 'os_family: RedHat'
105+
- 'distribution: AlmaLinux'
106+
- 'major_version: 8'
107+
ok: [wl-node-02] =>
108+
msg:
109+
- 'os_family: RedHat'
110+
- 'distribution: AlmaLinux'
111+
- 'major_version: 8'
112+
...
113+
```
114+
115+
<br>
116+
117+
## 4. Installation
118+
119+
Playbook to install and configure Weblogic cluster.
120+
121+
```shell
122+
ansible-playbook -i inventory/<environment>/inventory.ini playbooks/setup.yml --ask-vault-pass
123+
```
124+
125+
Will configure the cluster based on provided configuration in inventory files.
126+
127+
:exclamation: Weblogic console URL after installation: http://<admin_host_ip>:{{ admin_server_port }}/console
128+
129+
<br>
130+
131+
## 5. Uninstall
132+
133+
Playbook to uninstall Weblogic cluster.
134+
135+
```shell
136+
ansible-playbook -i inventory/<environment>/inventory.ini playbooks/reset.yml
137+
```
138+
139+
Will uninstall the Weblogic cluster and reboot the machines.
140+
141+
## 6. Cluster maintanace tasks
142+
143+
Playbook to update some parts of Cluster or Domain configuration
144+
145+
```shell
146+
ansible-playbook -i inventory/<environment>/inventory.ini playbooks/update.yml -t <tag>
147+
```
148+
149+
Will update specific part of configuration.
150+
151+
Currently available tags:
152+
153+
| Category | File Path | Tag | Description |
154+
|----------|-----------|-----|-------------|
155+
| Update | [playbooks/update.yml](playbooks/update.yml) | `ssl` | Will update Managed server SSL certificate and do SSL reset. |

addons/readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Folder should contain additions (playbooks, roles, etc.) to provision default cluster configuration with new, specific features or configuration.

ansible.cfg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[defaults]
2+
nocows = True
3+
roles_path = ./roles
4+
stdout_callback = yaml
5+
6+
remote_tmp = $HOME/.ansible/tmp
7+
local_tmp = $HOME/.ansible/tmp
8+
timeout = 60
9+
host_key_checking = False
10+
deprecation_warnings = False
11+
log_path = ./ansible.log
12+
13+
[privilege_escalation]
14+
become = True
15+
16+
[ssh_connection]
17+
scp_if_ssh = smart
18+
retries = 3
19+
ssh_args = -o StrictHostKeyChecking=no -o ControlMaster=auto -o ControlPersist=30m -o Compression=yes -o ServerAliveInterval=15s
20+
pipelining = True
21+
control_path = %(directory)s/%%h-%%r

docs/requirements.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# VMs and Workstation requirements
2+
3+
> Requirements for all cluster VMs and administrator workstation.
4+
5+
<hr>
6+
7+
- [1. On VMs](#1-on-vms)
8+
- [1.1 OS user](#1-1-os-user)
9+
- [1.2 Sudoers file](#1-2-sudoers-file)
10+
- [2. On ansible workstation (admin node)](#2-on-ansible-workstation-admin-node)
11+
- [2.1 Generate SSH keys](#2-1-generate-ssh-keys)
12+
- [2.2 SSH folder and file permissions](#2-2-ssh-folder-and-file-permissions)
13+
- [2.3 Setup passwordless SSH](#2-3-setup-passwordless-ssh)
14+
15+
<br>
16+
17+
## 1. On VMs
18+
19+
### 1.1 OS user
20+
21+
Create new OS user for a ansible tasks on all cluster VMs:
22+
23+
Debian/Ubuntu
24+
25+
```shell
26+
sudo adduser ansible
27+
```
28+
29+
RedHat/Rocky
30+
31+
```shell
32+
sudo useradd ansible
33+
```
34+
35+
```shell
36+
sudo passwd ansible
37+
```
38+
39+
<br>
40+
41+
### 1.2 Sudoers file
42+
43+
Add newly created user to sudoers file (for passwordless sudo):
44+
45+
```shell
46+
sudo su -
47+
```
48+
49+
```shell
50+
echo -e "\n# Allow without a password\nansible ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
51+
```
52+
53+
```shell
54+
exit
55+
```
56+
57+
<br>
58+
59+
## 2. On ansible workstation (admin node)
60+
61+
### 2.1 Generate SSH keys
62+
63+
Create required directory
64+
65+
```shell
66+
mkdir -p ~/.ssh/
67+
```
68+
69+
Generate new SSH key:
70+
71+
```shell
72+
ssh-keygen -f ~/.ssh/id_rsa -N ""
73+
```
74+
75+
<br>
76+
77+
### 2.2 SSH folder and file permissions
78+
79+
```shell
80+
chmod 700 ~/.ssh
81+
```
82+
83+
```shell
84+
chmod 644 ~/.ssh/id_rsa.pub
85+
```
86+
87+
```shell
88+
chmod 600 ~/.ssh/id_rsa
89+
```
90+
91+
```shell
92+
chmod 600 ~/.ssh/authorized_keys
93+
```
94+
95+
### 2.3 Setup passwordless SSH
96+
97+
Distribute the SSH public key to all servers:
98+
99+
- use newly created user for ansible tasks:
100+
101+
```shell
102+
ssh-copy-id ansible@127.0.0.11
103+
```
104+
105+
SSH without password
106+
107+
```shell
108+
ssh ansible@127.0.0.11
109+
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# WebLogic secrets
2+
weblogic_admin: 'weblogic'
3+
weblogic_admin_pass: 'welcome1'

0 commit comments

Comments
 (0)