Skip to content

Commit

Permalink
Add websphere and IHS roles (#12)
Browse files Browse the repository at this point in the history
* websphere role cleaned

* test

* add iim to websphere install script

* Update downloadInstaller.sh

* fix iim install/extract path

* Update linux_common.yml

* Update linux_common.yml

* tmp_dir gone

* Revert "tmp_dir gone"

This reverts commit ef6a527.

* Revert "Update linux_common.yml"

This reverts commit 0e5ee28.

* Revert "Update linux_common.yml"

This reverts commit 89889d5.

* Revert "fix iim install/extract path"

This reverts commit b430be5.

* Update v90_base_install.yml

* Update downloadInstaller.sh

* Update v90_base_install.yml

* Update v90_base_install.yml

* remove extra premature cleanup

* init ihs

* update travis

* add test

* fix lint issue

* Fixes to downloadInstaller.sh

* Also copy IHS fix pack installers to remote.

* Add back in AppServer.properties template

* Reintroduce missing task.

* Switch Extract IHS plugins to remote_src no.

* Add debug code to see if files are present.

* Update v90_fixpack_install.yml

* Update v90_fixpack_install.yml

* Update v90_fixpack_install.yml

* Update v90_fixpack_install.yml

* clean duplicates

* Remove comments and add clean up to main.yml

* move cleanup

* cleanup more comments

* cleanup

* update README to v9...8 vars

* Update main.yml

* update default/readme to 5...8 for websphere also

Co-authored-by: Roman Muntean <[email protected]>
Co-authored-by: Jien Huang <[email protected]>
Co-authored-by: martin-cummins <[email protected]>
  • Loading branch information
4 people authored Sep 27, 2021
1 parent 1cbbf08 commit aa30d06
Show file tree
Hide file tree
Showing 57 changed files with 2,051 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ env:
- ANSIBLE_GALAXY_SERVER_IBM_URL=https://galaxy.ansible.com/
# ANSIBLE_GALAXY_SERVER_IBM_TOKEN is set using secure environment variables
matrix:
- SCENARIO=websphere-v90-centos-8
- SCENARIO=websphere-v85-centos-7
- SCENARIO=db2-111-centos-7
- SCENARIO=db2-115-centos-8
- SCENARIO=iim-191-centos-8

- SCENARIO=iim-191-centos-8
- SCENARIO=ihs-v90-centos-8
- SCENARIO=ihs-v80-centos-7
stage: Molecule Tests

before_script:
Expand Down
4 changes: 3 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace: ibm
name: spm_middleware

# The version of the collection. Must be compatible with semantic versioning
version: 1.0.5
version: 1.0.6

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down Expand Up @@ -39,4 +39,6 @@ build_ignore:
- molecule
- skeleton_role
- tests
- runLint.sh
- tagAndPublish.sh
- scripts
12 changes: 12 additions & 0 deletions molecule/__ihs-v85/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- name: Converge
hosts: all

collections:
- ibm.spm_middleware

vars:
ihs_version: 8.5.5.17
roles:
- iim
- ihs
15 changes: 15 additions & 0 deletions molecule/__ihs-v85/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: Verify
hosts: all
pre_tasks:
- name: Check packages
iim_info:
iim_path: /opt/IBM/InstallationManager
register: iim_info

tasks:
- name: Check that the correct packages are installed
assert:
that:
- "iim_info.packages | \
select('match', 'com.ibm.websphere.IHS.v85.*') | list | length > 0"
13 changes: 13 additions & 0 deletions molecule/__ihs-v90/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: Converge
hosts: all

collections:
- wh_spm.middleware

vars:
ihs_version: 9.0.5.8

roles:
- iim
- ihs
17 changes: 17 additions & 0 deletions molecule/__ihs-v90/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
# This is an example playbook to execute Ansible tests.

- name: Verify
hosts: all
pre_tasks:
- name: Check packages
iim_info:
iim_path: /opt/IBM/InstallationManager
register: iim_info

tasks:
- name: Check that the correct packages are installed
assert:
that:
- "iim_info.packages | \
select('match', 'com.ibm.websphere.IHS.v90.*') | list | length > 0"
13 changes: 13 additions & 0 deletions molecule/__websphere-v85/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: Converge
hosts: all

collections:
- ibm.spm_middleware

vars:
websphere_version: 8.5.5.17

roles:
- iim
- websphere
38 changes: 38 additions & 0 deletions molecule/__websphere-v85/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
- name: Verify
hosts: all
pre_tasks:
- name: Check packages
iim_info:
iim_path: /opt/IBM/InstallationManager
register: iim_info

- name: Slurp JspBatchCompiler.sh
slurp:
src: /opt/IBM/WebSphere/AppServer/bin/JspBatchCompiler.sh
register: jsp_compiler_sh

- name: Slurp websphere.sh
slurp:
src: /opt/profile.d/websphere.sh
register: env_websphere_sh

tasks:
- name: Check that the correct packages are installed
assert:
that:
- "iim_info.packages | \
select('match', 'com.ibm.websphere.ND.v85.*') | list | length > 0"

- name: Check that JspBatchCompiler has been patched
assert:
that:
- "{{ '-Xmx1024m' in (jsp_compiler_sh['content'] | b64decode) }}"

- name: Check that environment file has been created correctly
assert:
that:
- "{{ 'WAS_HOME=/opt/IBM/WebSphere/AppServer' \
in (env_websphere_sh['content'] | b64decode) }}"
- "{{ 'JAVA_HOME=$WAS_HOME/java\n' \
in (env_websphere_sh['content'] | b64decode) }}"
13 changes: 13 additions & 0 deletions molecule/__websphere-v90/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: Converge
hosts: all

collections:
- ibm.spm_middleware

vars:
websphere_version: 9.0.5.8

roles:
- iim
- websphere
40 changes: 40 additions & 0 deletions molecule/__websphere-v90/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
- name: Verify
hosts: all
pre_tasks:
- name: Check packages
iim_info:
iim_path: /opt/IBM/InstallationManager
register: iim_info

- name: Slurp JspBatchCompiler.sh
slurp:
src: /opt/IBM/WebSphere/AppServer/bin/JspBatchCompiler.sh
register: jsp_compiler_sh

- name: Slurp websphere.sh
slurp:
src: /opt/profile.d/websphere.sh
register: env_websphere_sh

tasks:
- name: Check that the correct packages are installed
assert:
that:
- "iim_info.packages | \
select('match', 'com.ibm.websphere.ND.v90.*') | list | length > 0"
- "iim_info.packages | \
select('match', 'com.ibm.java.jdk.v8.*') | list | length > 0"

- name: Check that JspBatchCompiler has been patched
assert:
that:
- "{{ '-Xmx1024m' in (jsp_compiler_sh['content'] | b64decode) }}"

- name: Check that environment file has been created correctly
assert:
that:
- "{{ 'WAS_HOME=/opt/IBM/WebSphere/AppServer' \
in (env_websphere_sh['content'] | b64decode) }}"
- "{{ 'JAVA_HOME=$WAS_HOME/java/8.0\n' \
in (env_websphere_sh['content'] | b64decode) }}"
26 changes: 26 additions & 0 deletions molecule/_resources/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python3 python3-pip sudo python3-devel python3-dnf bash python3-libselinux && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi

# Create `ansible` user with sudo permissions and membership in `DEPLOY_GROUP`
ENV ANSIBLE_USER=ansible DEPLOY_GROUP=deployer
RUN set -xe \
&& if [ $(getent group wheel) ]; then export SUDO_GROUP=wheel; fi \
&& if [ $(getent group sudo) ]; then export SUDO_GROUP=sudo; fi \
&& groupadd -r ${ANSIBLE_USER} \
&& groupadd -r ${DEPLOY_GROUP} \
&& useradd -m -g ${ANSIBLE_USER} ${ANSIBLE_USER} \
&& usermod -aG ${SUDO_GROUP} ${ANSIBLE_USER} \
&& usermod -aG ${DEPLOY_GROUP} ${ANSIBLE_USER} \
&& sed -i "/^%${SUDO_GROUP}/s/ALL\$/NOPASSWD:ALL/g" /etc/sudoers
4 changes: 2 additions & 2 deletions molecule/db2-111-centos-7/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ platforms:
- name: centos-7
image: centos:7
dockerfile: ../_resources/Dockerfile.j2
pre_build_image: False
privileged: True
pre_build_image: false
privileged: true
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
Expand Down
2 changes: 1 addition & 1 deletion molecule/db2-111-centos-7/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- stat: "path=/opt/Props/Bootstrap.properties"
register: boot_props
- command: "db2level"
become: yes
become: true
become_user: "db2admin"
become_method: sudo
become_flags: "-i"
Expand Down
4 changes: 2 additions & 2 deletions molecule/db2-115-centos-8/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ platforms:
- name: centos-8
image: centos:8
dockerfile: ../_resources/Dockerfile.j2
pre_build_image: False
privileged: True
pre_build_image: false
privileged: true
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
Expand Down
2 changes: 1 addition & 1 deletion molecule/db2-115-centos-8/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- stat: "path=/opt/Props/Bootstrap.properties"
register: boot_props
- command: "db2level"
become: yes
become: true
become_user: "db2admin"
become_method: sudo
become_flags: "-i"
Expand Down
4 changes: 2 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ platforms:
- name: centos-8
image: centos:8
dockerfile: ../_resources/Dockerfile.j2
pre_build_image: False
privileged: True
pre_build_image: false
privileged: true
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/lib/systemd/systemd"
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- stat: "path=/opt/Props/Bootstrap.properties"
register: boot_props
- command: "db2level"
become: yes
become: true
become_user: "db2admin"
become_method: sudo
become_flags: "-i"
Expand Down
34 changes: 34 additions & 0 deletions molecule/ihs-v80-centos-7/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
driver:
name: docker
provider:
name: docker

lint: |
set -e
yamllint .
platforms:
- name: centos-7
image: centos:7
dockerfile: ../_resources/Dockerfile.j2
pre_build_image: false
privileged: true
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
environment:
container: docker

provisioner:
name: ansible
log: true
config_options:
defaults:
stderr_callback: debug
stdout_callback: debug
env:
ANSIBLE_FORCE_COLOR: 'true'
playbooks:
converge: ../__ihs-v85/converge.yml
verify: ../__ihs-v85/verify.yml
34 changes: 34 additions & 0 deletions molecule/ihs-v90-centos-8/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
driver:
name: docker
provider:
name: docker

lint: |
set -e
yamllint .
platforms:
- name: centos-8
image: centos:8
dockerfile: ../_resources/Dockerfile.j2
pre_build_image: false
privileged: true
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
environment:
container: docker

provisioner:
name: ansible
log: true
config_options:
defaults:
stderr_callback: debug
stdout_callback: debug
env:
ANSIBLE_FORCE_COLOR: 'true'
playbooks:
converge: ../__ihs-v90/converge.yml
verify: ../__ihs-v90/verify.yml
4 changes: 2 additions & 2 deletions molecule/iim-191-centos-8/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ platforms:
- name: centos-8
image: centos:8
dockerfile: ../_resources/Dockerfile.j2
pre_build_image: False
privileged: True
pre_build_image: false
privileged: true
volume_mounts:
- "/sys/fs/cgroup:/sys/fs/cgroup:rw"
command: "/usr/sbin/init"
Expand Down
Loading

0 comments on commit aa30d06

Please sign in to comment.