Skip to content

Commit

Permalink
support RedHat AutoWAS setup (#189)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
stevenschader committed Jul 1, 2021
1 parent 5761597 commit ea3effe
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ansible/roles/setup_autowas/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
autowas_url: http://rtpgsa.ibm.com/projects/m/moonstone/drivers/releases/latest.tar.gz
autowas_user: nest
autowas_dir: /home/nest/autowas
gsa_user: 'yourgsauser'
gsa_pass: 'yourgsapass'
83 changes: 83 additions & 0 deletions ansible/roles/setup_autowas/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---

- name: check for RedHat distribution
fail:
msg: Target OS is not RedHat
when: ansible_distribution != "RedHat"

- name: Install RHEL pre-reqs
become: yes
dnf:
name: "{{ packages }}"
state: latest
vars:
packages:
- python2

- name: Install paramiko python package
become: yes
pip:
name: paramiko
args:
executable: /usr/bin/pip2

- name: check if jmeter dir
file:
path: "{{ autowas_dir }}"
state: directory
owner: "{{ autowas_user }}"

- name: get and unarchive autowas gz
unarchive:
src: "{{ autowas_url }}"
dest: "{{ autowas_dir }}"
owner: "{{ autowas_user }}"
remote_src: yes

- name: dot in the AutoWASEnv.sh
lineinfile:
path: '~/.bashrc'
state: present
regexp: '^AutoWASEnv.sh'
line: '. {{ autowas_dir }}/bin/AutoWASEnv.sh '
backup: yes

- name: bin/configure
shell: 'bin/configure'
args:
chdir: '{{ autowas_dir }}'
register: aconfigure

- debug:
msg: '{{ aconfigure.stdout_lines }}'

- name: bin/setupUser
shell: 'bin/setupUser'
args:
chdir: '{{ autowas_dir }}'
register: asetupUser

- debug:
msg: '{{ asetupUser.stdout_lines }}'

- name: configure gsa user creds ( user )
replace:
path: 'autowas/etc/config.user'
regexp: 'FILL_IN_USERNAME'
replace: '{{ gsa_user }}'

- name: configure gsa user creds ( pass )
replace:
path: 'autowas/etc/config.user'
regexp: 'FILL_IN_PASSWORD'
replace: '{{ gsa_pass }}'

- name: bin/ipcServer.py
shell: 'bin/ipcServer.py -cell default -log transcript.txt'
args:
chdir: '{{ autowas_dir }}'
register: aipc

- debug:
msg: '{{ aipc.stdout_lines }}'

1 change: 1 addition & 0 deletions ansible/setup-autowas-play/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/inventory
28 changes: 28 additions & 0 deletions ansible/setup-autowas-play/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Ansible Playbook for configuring AutoWAS Server

## Limitations:

- Current support for:
- RHEL8
- UB20.04 ( future )


## Setting up inventory

- From the `setup-autowas-play` directory copy the sample inventory file at `examples/inventory` to the current directory.

```
cp examples/inventory .
```
- Change the ansible_user in the inventory to match the target user you wish to run AutoWAS server
- Change the autowas_dir to a writable dir ( the play will create if it does not exist )
- Change the GSA credentials in the inventory

## Run playbook


Once you have configured the `inventory` file, run the playbook using:

```
ansible-playbook -i inventory setup-autowas-play
```
8 changes: 8 additions & 0 deletions ansible/setup-autowas-play/examples/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[all]
yourTargethostFQDN

[all:vars]
ansible_user=your_autoWASUser
autowas_dir=/home/your_autoWASUser/autowas
gsa_user=yourGSAid
gsa_pass=yourGSApass
1 change: 1 addition & 0 deletions ansible/setup-autowas-play/roles
6 changes: 6 additions & 0 deletions ansible/setup-autowas-play/setup-autowas-play
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

- hosts: all
roles:
- role: setup_autowas

0 comments on commit ea3effe

Please sign in to comment.