Skip to content

Commit ea3effe

Browse files
support RedHat AutoWAS setup (#189)
* force roles/nestuser/scripts/password_hasher.py to use python2 * fix print to work with python2/3 * ignore runtime json * initial drop WA tWAS registratio * fix choice default * fix pass defaults * syntax * change inventory to hostlist * masked out apikey * more README details * interim liberty config * added store pass * syntax error * added missing updated files * password maint * swizzle use of the dang wa_cert * cleanup extra gizmos * remove useless prints * db2 rhel updated to 8.4 * jmeter fyre rhel updated to 8.4 * ansible debug -vvv * overwrite any password.sh files to ensure getting updated password * issue #183 * space * enhance startServers fla * swizzled new inventory.yml to accomodate tWAS and Liberty * added comment * more version details in inventory.yml * reordered vars and add more comment * new vnc play * add role softlink * simple vnc play - only supports RHEL8 now * README update * RHEL setup AutoWAS play * added check for RedHat * README adjustments
1 parent 5761597 commit ea3effe

File tree

7 files changed

+132
-0
lines changed

7 files changed

+132
-0
lines changed

Diff for: ansible/roles/setup_autowas/defaults/main.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
autowas_url: http://rtpgsa.ibm.com/projects/m/moonstone/drivers/releases/latest.tar.gz
2+
autowas_user: nest
3+
autowas_dir: /home/nest/autowas
4+
gsa_user: 'yourgsauser'
5+
gsa_pass: 'yourgsapass'

Diff for: ansible/roles/setup_autowas/tasks/main.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
3+
- name: check for RedHat distribution
4+
fail:
5+
msg: Target OS is not RedHat
6+
when: ansible_distribution != "RedHat"
7+
8+
- name: Install RHEL pre-reqs
9+
become: yes
10+
dnf:
11+
name: "{{ packages }}"
12+
state: latest
13+
vars:
14+
packages:
15+
- python2
16+
17+
- name: Install paramiko python package
18+
become: yes
19+
pip:
20+
name: paramiko
21+
args:
22+
executable: /usr/bin/pip2
23+
24+
- name: check if jmeter dir
25+
file:
26+
path: "{{ autowas_dir }}"
27+
state: directory
28+
owner: "{{ autowas_user }}"
29+
30+
- name: get and unarchive autowas gz
31+
unarchive:
32+
src: "{{ autowas_url }}"
33+
dest: "{{ autowas_dir }}"
34+
owner: "{{ autowas_user }}"
35+
remote_src: yes
36+
37+
- name: dot in the AutoWASEnv.sh
38+
lineinfile:
39+
path: '~/.bashrc'
40+
state: present
41+
regexp: '^AutoWASEnv.sh'
42+
line: '. {{ autowas_dir }}/bin/AutoWASEnv.sh '
43+
backup: yes
44+
45+
- name: bin/configure
46+
shell: 'bin/configure'
47+
args:
48+
chdir: '{{ autowas_dir }}'
49+
register: aconfigure
50+
51+
- debug:
52+
msg: '{{ aconfigure.stdout_lines }}'
53+
54+
- name: bin/setupUser
55+
shell: 'bin/setupUser'
56+
args:
57+
chdir: '{{ autowas_dir }}'
58+
register: asetupUser
59+
60+
- debug:
61+
msg: '{{ asetupUser.stdout_lines }}'
62+
63+
- name: configure gsa user creds ( user )
64+
replace:
65+
path: 'autowas/etc/config.user'
66+
regexp: 'FILL_IN_USERNAME'
67+
replace: '{{ gsa_user }}'
68+
69+
- name: configure gsa user creds ( pass )
70+
replace:
71+
path: 'autowas/etc/config.user'
72+
regexp: 'FILL_IN_PASSWORD'
73+
replace: '{{ gsa_pass }}'
74+
75+
- name: bin/ipcServer.py
76+
shell: 'bin/ipcServer.py -cell default -log transcript.txt'
77+
args:
78+
chdir: '{{ autowas_dir }}'
79+
register: aipc
80+
81+
- debug:
82+
msg: '{{ aipc.stdout_lines }}'
83+

Diff for: ansible/setup-autowas-play/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/inventory

Diff for: ansible/setup-autowas-play/README.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Ansible Playbook for configuring AutoWAS Server
2+
3+
## Limitations:
4+
5+
- Current support for:
6+
- RHEL8
7+
- UB20.04 ( future )
8+
9+
10+
## Setting up inventory
11+
12+
- From the `setup-autowas-play` directory copy the sample inventory file at `examples/inventory` to the current directory.
13+
14+
```
15+
cp examples/inventory .
16+
```
17+
- Change the ansible_user in the inventory to match the target user you wish to run AutoWAS server
18+
- Change the autowas_dir to a writable dir ( the play will create if it does not exist )
19+
- Change the GSA credentials in the inventory
20+
21+
## Run playbook
22+
23+
24+
Once you have configured the `inventory` file, run the playbook using:
25+
26+
```
27+
ansible-playbook -i inventory setup-autowas-play
28+
```

Diff for: ansible/setup-autowas-play/examples/inventory

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[all]
2+
yourTargethostFQDN
3+
4+
[all:vars]
5+
ansible_user=your_autoWASUser
6+
autowas_dir=/home/your_autoWASUser/autowas
7+
gsa_user=yourGSAid
8+
gsa_pass=yourGSApass

Diff for: ansible/setup-autowas-play/roles

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../roles

Diff for: ansible/setup-autowas-play/setup-autowas-play

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
3+
- hosts: all
4+
roles:
5+
- role: setup_autowas
6+

0 commit comments

Comments
 (0)