diff --git a/molecule/__ihs-v85/converge.yml b/molecule/__ihs-v85/converge.yml new file mode 100644 index 00000000..f0c8be80 --- /dev/null +++ b/molecule/__ihs-v85/converge.yml @@ -0,0 +1,15 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + ihs_version: 8.5.5.20 + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} + + roles: + - iim + - ihs diff --git a/molecule/__ihs-v85/verify.yml b/molecule/__ihs-v85/verify.yml new file mode 100644 index 00000000..959463f0 --- /dev/null +++ b/molecule/__ihs-v85/verify.yml @@ -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" diff --git a/molecule/__ihs-v90/converge.yml b/molecule/__ihs-v90/converge.yml new file mode 100644 index 00000000..99cac1df --- /dev/null +++ b/molecule/__ihs-v90/converge.yml @@ -0,0 +1,15 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + ihs_version: 9.0.5.19 + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} + + roles: + - iim + - ihs diff --git a/molecule/__ihs-v90/verify.yml b/molecule/__ihs-v90/verify.yml new file mode 100644 index 00000000..134ea0f6 --- /dev/null +++ b/molecule/__ihs-v90/verify.yml @@ -0,0 +1,14 @@ +--- +- 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" diff --git a/molecule/__liberty/converge.yml b/molecule/__liberty/converge.yml new file mode 100644 index 00000000..e87cf8bf --- /dev/null +++ b/molecule/__liberty/converge.yml @@ -0,0 +1,15 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + liberty_version: "24.0.0.3" + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} + + roles: + - iim + - liberty diff --git a/molecule/__liberty/verify.yml b/molecule/__liberty/verify.yml new file mode 100644 index 00000000..91157a2b --- /dev/null +++ b/molecule/__liberty/verify.yml @@ -0,0 +1,31 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + # The pre_tasks section is used to perform some tasks before the main tasks run. + # It's a good place for setup tasks or data collection. + pre_tasks: + - name: Check packages + # Assuming 'iim_info' module is part of the 'iim' role or a custom module. + # If it's a custom module, ensure that it's properly located in the 'library' directory inside the role. + iim_info: + iim_path: /opt/IBM/InstallationManager + register: iim_info + - name: Get jvm.options + slurp: + src: /opt/IBM/WebSphere/Liberty/usr/shared/jvm.options + register: jvm_options + + tasks: + - name: Check that the correct packages are installed + # Using 'assert' module to validate conditions. + assert: + that: + - "iim_info.packages | select('match', 'com.ibm.websphere.liberty.ND.*') | list | length > 0" + - "iim_info.packages | select('match', 'com.ibm.java.jdk.v8.*') | list | length > 0" + - name: Check that jvm.options contains the expected content + # Using 'assert' module to check if '-Xmx1024m' is present in 'jvm.options' file. + assert: + that: + - "'-Xmx1024m' in (jvm_options['content'] | b64decode)" \ No newline at end of file diff --git a/molecule/__liberty17/converge.yml b/molecule/__liberty17/converge.yml new file mode 100644 index 00000000..8dcb9284 --- /dev/null +++ b/molecule/__liberty17/converge.yml @@ -0,0 +1,15 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + liberty_version: "24.0.0.3-JDK17" + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} + + roles: + - iim + - liberty diff --git a/molecule/__liberty17/verify.yml b/molecule/__liberty17/verify.yml new file mode 100644 index 00000000..8607f47e --- /dev/null +++ b/molecule/__liberty17/verify.yml @@ -0,0 +1,31 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + # The pre_tasks section is used to perform some tasks before the main tasks run. + # It's a good place for setup tasks or data collection. + pre_tasks: + - name: Check packages + # Assuming 'iim_info' module is part of the 'iim' role or a custom module. + # If it's a custom module, ensure that it's properly located in the 'library' directory inside the role. + iim_info: + iim_path: /opt/IBM/InstallationManager + register: iim_info + - name: Get jvm.options + slurp: + src: /opt/IBM/WebSphere/Liberty/usr/shared/jvm.options + register: jvm_options + + tasks: + - name: Check that the correct packages are installed + # Using 'assert' module to validate conditions. + assert: + that: + - "iim_info.packages | select('match', 'com.ibm.websphere.liberty.ND.*') | list | length > 0" + - "iim_info.packages | select('match', 'com.ibm.java.jdk.v17.*') | list | length > 0" + - name: Check that jvm.options contains the expected content + # Using 'assert' module to check if '-Xmx1024m' is present in 'jvm.options' file. + assert: + that: + - "'-Xmx1024m' in (jvm_options['content'] | b64decode)" \ No newline at end of file diff --git a/molecule/__liberty21/verify.yml b/molecule/__liberty21/verify.yml index 9e2634d6..bc8db5a3 100644 --- a/molecule/__liberty21/verify.yml +++ b/molecule/__liberty21/verify.yml @@ -9,7 +9,7 @@ - name: Check packages # Assuming 'iim_info' module is part of the 'iim' role or a custom module. # If it's a custom module, ensure that it's properly located in the 'library' directory inside the role. - spm-middleware.iim_info: + iim_info: iim_path: /opt/IBM/InstallationManager register: iim_info - name: Get jvm.options diff --git a/molecule/__ohs-v12.1.3/converge.yml b/molecule/__ohs-v12.1.3/converge.yml new file mode 100644 index 00000000..8aca24a5 --- /dev/null +++ b/molecule/__ohs-v12.1.3/converge.yml @@ -0,0 +1,45 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + tasks: + - name: Install python3 + package: + name: python3 + state: present + + - name: Create symlink for python3 + file: + src: /usr/bin/python3 + dest: /usr/local/bin/python + owner: root + group: root + state: link + + - name: pip self-update + pip: + name: pip + executable: pip3 + state: latest + vars: + ansible_python_interpreter: /usr/bin/python3 + + - name: include weblogic + include_role: + name: weblogic + vars: + ansible_python_interpreter: /usr/bin/python3 + weblogic_version: "12.1.3.0.210720" + + - name: include ohs + include_role: + name: ohs + vars: + ansible_python_interpreter: /usr/bin/python3 + ohs_version: 12.1.3.0.200412 + vars: + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} diff --git a/molecule/__ohs-v12.1.3/verify.yml b/molecule/__ohs-v12.1.3/verify.yml new file mode 100644 index 00000000..99f1e3f0 --- /dev/null +++ b/molecule/__ohs-v12.1.3/verify.yml @@ -0,0 +1,51 @@ +--- +- name: Verify + hosts: all + + pre_tasks: + - name: include vars + include_vars: "../../roles/ohs/vars/v12.1.3.0.200412.yml" + + - name: include default + include_vars: "../../roles/ohs/defaults/main.yml" + + - name: Check opatch version + shell: "grep {{ opatch_version }} {{ ohs_home }}/OPatch/version.txt" + ignore_errors: True + register: opatch_version_flag + when: opatch_version is defined + + - name: Check Shell File Exists + stat: + path: "{{ profiled_path }}/ohs.sh" + register: shell + + - name: Check Profile File Exists + stat: + path: /opt/.profile + register: profile + + - name: Check Domain Created + shell: "grep ohs_{{ ansible_hostname }} {{ ohs_home }}/domain-registry.xml" + ignore_errors: True + register: domain_created + when: opatch_version is defined + + tasks: + - name: Check Patch Number Matched + assert: + that: opatch_version_flag.rc == 0 + when: opatch_version is defined + + - name: Check that shell exists + assert: + that: shell.stat.exists + + - name: Check that profile exists + assert: + that: profile.stat.exists + + - name: Check Domain Created + assert: + that: domain_created.rc == 0 + when: opatch_version is defined diff --git a/molecule/__ohs-v12.2.1.4/converge.yml b/molecule/__ohs-v12.2.1.4/converge.yml new file mode 100644 index 00000000..84bfcf5b --- /dev/null +++ b/molecule/__ohs-v12.2.1.4/converge.yml @@ -0,0 +1,44 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + tasks: + - name: Install python3 + package: + name: python3 + state: present + + - name: Create symlink for python3 + file: + src: /usr/bin/python3 + dest: /usr/local/bin/python + owner: root + group: root + state: link + + - name: pip self-update + pip: + name: pip + executable: pip3 + state: latest + vars: + ansible_python_interpreter: /usr/bin/python3 + + - name: include weblogic + include_role: + name: weblogic + vars: + ansible_python_interpreter: /usr/bin/python3 + weblogic_version: "14.1.1.0.240328" + + - name: include ohs + include_role: + name: ohs + vars: + ansible_python_interpreter: /usr/bin/python3 + vars: + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} diff --git a/molecule/__ohs-v12.2.1.4/verify.yml b/molecule/__ohs-v12.2.1.4/verify.yml new file mode 100644 index 00000000..01131206 --- /dev/null +++ b/molecule/__ohs-v12.2.1.4/verify.yml @@ -0,0 +1,51 @@ +--- +- name: Verify + hosts: all + + pre_tasks: + - name: include vars + include_vars: "../../roles/ohs/vars/v12.2.1.4.240115.yml" + + - name: include default + include_vars: "../../roles/ohs/defaults/main.yml" + + - name: Check opatch version + shell: "grep {{ opatch_version }} {{ ohs_home }}/OPatch/version.txt" + ignore_errors: True + register: opatch_version_flag + when: opatch_version is defined + + - name: Check Shell File Exists + stat: + path: "{{ profiled_path }}/ohs.sh" + register: shell + + - name: Check Profile File Exists + stat: + path: /opt/.profile + register: profile + + - name: Check Domain Created + shell: "grep ohs_{{ ansible_hostname }} {{ ohs_home }}/domain-registry.xml" + ignore_errors: True + register: domain_created + when: opatch_version is defined + + tasks: + - name: Check Patch Number Matched + assert: + that: opatch_version_flag.rc == 0 + when: opatch_version is defined + + - name: Check that shell exists + assert: + that: shell.stat.exists + + - name: Check that profile exists + assert: + that: profile.stat.exists + + - name: Check Domain Created + assert: + that: domain_created.rc == 0 + when: opatch_version is defined diff --git a/molecule/__ohs-v12.2.1/converge.yml b/molecule/__ohs-v12.2.1/converge.yml new file mode 100644 index 00000000..42898a02 --- /dev/null +++ b/molecule/__ohs-v12.2.1/converge.yml @@ -0,0 +1,44 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + tasks: + - name: Install python3 + package: + name: python3 + state: present + + - name: Create symlink for python3 + file: + src: /usr/bin/python3 + dest: /usr/local/bin/python + owner: root + group: root + state: link + + - name: pip self-update + pip: + name: pip + executable: pip3 + state: latest + vars: + ansible_python_interpreter: /usr/bin/python3 + + - name: include weblogic + include_role: + name: weblogic + vars: + ansible_python_interpreter: /usr/bin/python3 + weblogic_version: "12.1.3.0.210720" + + - name: include ohs + include_role: + name: ohs + vars: + ansible_python_interpreter: /usr/bin/python3 + vars: + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} diff --git a/molecule/__ohs-v12.2.1/verify.yml b/molecule/__ohs-v12.2.1/verify.yml new file mode 100644 index 00000000..fdf0acb5 --- /dev/null +++ b/molecule/__ohs-v12.2.1/verify.yml @@ -0,0 +1,51 @@ +--- +- name: Verify + hosts: all + + pre_tasks: + - name: include vars + include_vars: "../../roles/ohs/vars/v12.2.1.4.210324.yml" + + - name: include default + include_vars: "../../roles/ohs/defaults/main.yml" + + - name: Check opatch version + shell: "grep {{ opatch_version }} {{ ohs_home }}/OPatch/version.txt" + ignore_errors: True + register: opatch_version_flag + when: opatch_version is defined + + - name: Check Shell File Exists + stat: + path: "{{ profiled_path }}/ohs.sh" + register: shell + + - name: Check Profile File Exists + stat: + path: /opt/.profile + register: profile + + - name: Check Domain Created + shell: "grep ohs_{{ ansible_hostname }} {{ ohs_home }}/domain-registry.xml" + ignore_errors: True + register: domain_created + when: opatch_version is defined + + tasks: + - name: Check Patch Number Matched + assert: + that: opatch_version_flag.rc == 0 + when: opatch_version is defined + + - name: Check that shell exists + assert: + that: shell.stat.exists + + - name: Check that profile exists + assert: + that: profile.stat.exists + + - name: Check Domain Created + assert: + that: domain_created.rc == 0 + when: opatch_version is defined diff --git a/molecule/__oracle-v12cR1/converge.yml b/molecule/__oracle-v12cR1/converge.yml new file mode 100644 index 00000000..2a7de5d3 --- /dev/null +++ b/molecule/__oracle-v12cR1/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + oracle_version: 12.1.0.2.220118 + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} + + roles: + - oracle diff --git a/molecule/__oracle-v12cR1/verify.yml b/molecule/__oracle-v12cR1/verify.yml new file mode 100644 index 00000000..b052dec6 --- /dev/null +++ b/molecule/__oracle-v12cR1/verify.yml @@ -0,0 +1,77 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + vars: + oracle_home: /opt/oracle/product/12c/dbhome_1 + oracle_sid: orcl + patch_number: 33477199 + + pre_tasks: + - name: Check if DB exists + stat: + path: /opt/oracle/oradata/orcl + register: db_dir + + - name: Check Bootstrap Files + stat: + path: /opt/Props/Bootstrap.properties + register: bootstrap_properties + + - name: Check if correct version installed + become: yes + become_user: oracle + shell: "$ORACLE_HOME/OPatch/opatch lspatches | grep -i {{ patch_number }}" + register: oracle_version_status + changed_when: False + ignore_errors: True + environment: + ORACLE_HOME: "{{ oracle_home }}" + ORACLE_SID: "{{ oracle_sid }}" + + - name: Check if DB Configured + become: yes + become_user: oracle + shell: "echo \"SELECT USERNAME FROM DBA_USERS WHERE USERNAME='CURAM';\" | $ORACLE_HOME/bin/sqlplus / as sysdba | grep -i curam" + register: db_config_status + changed_when: False + ignore_errors: True + environment: + ORACLE_HOME: "{{ oracle_home }}" + ORACLE_SID: "{{ oracle_sid }}" + + - name: Check if start script exists + stat: + path: /home/oracle/scripts/start_all.sh + register: start_script + + - name: Check if stop script exists + stat: + path: /home/oracle/scripts/stop_all.sh + register: stop_script + + tasks: + - name: Check that db_inst.rsp exists + assert: + that: db_dir.stat.exists + + - name: Check that Bootstrap.properties exists + assert: + that: bootstrap_properties.stat.exists + + - name: Verify correct version installed + assert: + that: oracle_version_status.rc == 0 + + - name: Check db is configured + assert: + that: db_config_status.rc == 0 + + - name: Verify that start script exists + assert: + that: start_script.stat.exists + + - name: Verify that stop script exists + assert: + that: stop_script.stat.exists diff --git a/molecule/__oracle-v12cR2/converge.yml b/molecule/__oracle-v12cR2/converge.yml new file mode 100644 index 00000000..ed8a0880 --- /dev/null +++ b/molecule/__oracle-v12cR2/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + oracle_version: 12.2.0.1.220118 + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} + + roles: + - oracle diff --git a/molecule/__oracle-v12cR2/verify.yml b/molecule/__oracle-v12cR2/verify.yml new file mode 100644 index 00000000..d3fe84a7 --- /dev/null +++ b/molecule/__oracle-v12cR2/verify.yml @@ -0,0 +1,77 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + vars: + oracle_home: /opt/oracle/product/12c/dbhome_1 + oracle_sid: orcl + patch_number: 33587128 + + pre_tasks: + - name: Check if DB exists + stat: + path: /opt/oracle/oradata/orcl + register: db_dir + + - name: Check Bootstrap Files + stat: + path: /opt/Props/Bootstrap.properties + register: bootstrap_properties + + - name: Check if correct version installed + become: yes + become_user: oracle + shell: "$ORACLE_HOME/OPatch/opatch lspatches | grep -i {{ patch_number }}" + register: oracle_version_status + changed_when: False + ignore_errors: True + environment: + ORACLE_HOME: "{{ oracle_home }}" + ORACLE_SID: "{{ oracle_sid }}" + + - name: Check if DB Configured + become: yes + become_user: oracle + shell: "echo \"SELECT USERNAME FROM DBA_USERS WHERE USERNAME='CURAM';\" | $ORACLE_HOME/bin/sqlplus / as sysdba | grep -i curam" + register: db_config_status + changed_when: False + ignore_errors: True + environment: + ORACLE_HOME: "{{ oracle_home }}" + ORACLE_SID: "{{ oracle_sid }}" + + - name: Check if start script exists + stat: + path: /home/oracle/scripts/start_all.sh + register: start_script + + - name: Check if stop script exists + stat: + path: /home/oracle/scripts/stop_all.sh + register: stop_script + + tasks: + - name: Check that db_inst.rsp exists + assert: + that: db_dir.stat.exists + + - name: Check that Bootstrap.properties exists + assert: + that: bootstrap_properties.stat.exists + + - name: Verify correct version installed + assert: + that: oracle_version_status.rc == 0 + + - name: Check db is configured + assert: + that: db_config_status.rc == 0 + + - name: Verify that start script exists + assert: + that: start_script.stat.exists + + - name: Verify that stop script exists + assert: + that: stop_script.stat.exists diff --git a/molecule/__oracle-v19c/converge.yml b/molecule/__oracle-v19c/converge.yml new file mode 100644 index 00000000..d39cf74f --- /dev/null +++ b/molecule/__oracle-v19c/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + oracle_version: 19.23.0.0.0 + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} + + roles: + - oracle diff --git a/molecule/__oracle-v19c/verify.yml b/molecule/__oracle-v19c/verify.yml new file mode 100644 index 00000000..3d16dbf9 --- /dev/null +++ b/molecule/__oracle-v19c/verify.yml @@ -0,0 +1,94 @@ +--- +# This is an example playbook to execute Ansible tests. + +- name: Verify + hosts: all + vars: + oracle_home: /opt/oracle/product/19c/dbhome_1 + oracle_sid: orcl + oracle_version: 19.23.0.0.0 + + pre_tasks: + - name: Check if DB exists + stat: + path: /opt/oracle/oradata/ORCL + register: db_dir + + - name: Check Bootstrap Files + stat: + path: /opt/Props/Bootstrap.properties + register: bootstrap_properties + + - name: Check if correct version installed + become: yes + become_user: oracle + shell: "echo 'SELECT * FROM v$version;' | $ORACLE_HOME/bin/sqlplus / as sysdba | grep -i {{ oracle_version }}" + register: oracle_version_status + changed_when: False + ignore_errors: True + environment: + ORACLE_HOME: "{{ oracle_home }}" + ORACLE_SID: "{{ oracle_sid }}" + + - name: Check if DB Configured + become: yes + become_user: oracle + shell: "echo 'SELECT USERNAME FROM DBA_USERS;' | $ORACLE_HOME/bin/sqlplus / as sysdba | grep CURAM" + register: db_config_status + changed_when: False + ignore_errors: True + environment: + ORACLE_HOME: "{{ oracle_home }}" + ORACLE_SID: "{{ oracle_sid }}" + + - name: Check if start script exists + stat: + path: /home/oracle/scripts/start_all.sh + register: start_script + + - name: Check if stop script exists + stat: + path: /home/oracle/scripts/stop_all.sh + register: stop_script + + tasks: + - name: Check that db_inst.rsp exists + assert: + that: db_dir.stat.exists + + - name: Check that Bootstrap.properties exists + assert: + that: bootstrap_properties.stat.exists + + - name: Verify correct version installed + assert: + that: oracle_version_status.rc == 0 + + - name: Check db is configured + assert: + that: db_config_status.rc == 0 + + - name: Verify that start script exists + assert: + that: start_script.stat.exists + + - name: Verify that stop script exists + assert: + that: stop_script.stat.exists + + - name: Check if service file exists + stat: + path: /etc/systemd/system/oracle.service + register: service_file + + - name: Check if all /etc/oratab entries end with 'Y' + shell: "grep -v '^#' /etc/oratab | awk -F':' '{print $NF}' | grep -vx 'Y'" + register: oratab_check + ignore_errors: true + + - name: Assert all entries end with 'Y' + assert: + that: + - oratab_check.stdout == "" + success_msg: "All /etc/oratab entries correctly end with 'Y'." + fail_msg: "Some /etc/oratab entries do not end with 'Y'." diff --git a/molecule/__weblogic-v12.1/converge.yml b/molecule/__weblogic-v12.1/converge.yml new file mode 100644 index 00000000..bff2fecc --- /dev/null +++ b/molecule/__weblogic-v12.1/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + weblogic_version: "12.1.3.0.210720" + # weblogic_installer_path: /opt/IBM/weblogic/WLS + download_url: "{{ lookup('env','ARTIFACTORY_URL') }}/{{ lookup('env','ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: {'X-JFrog-Art-Api': "{{ lookup('env','ARTIFACTORY_TOKEN' )}}"} + roles: + - weblogic diff --git a/molecule/__weblogic-v12.1/verify.yml b/molecule/__weblogic-v12.1/verify.yml new file mode 100644 index 00000000..d4e2a445 --- /dev/null +++ b/molecule/__weblogic-v12.1/verify.yml @@ -0,0 +1,45 @@ +--- +- name: Verify + hosts: all + pre_tasks: + - name: include defaults + include_vars: "../../roles/weblogic/defaults/main.yml" + - name: include vars + include_vars: "../../roles/weblogic/vars/v12.1.3.0.210720.yml" + - stat: + path: /opt/Props/AppServer.properties + register: boot_props + - name: Slurp profile.d + slurp: + src: /opt/profile.d/weblogic.sh + register: env_oracle_sh + - name: Slurp registry.xml + slurp: + src: /home/oracle/Oracle/Middleware/Oracle_Home/inventory/registry.xml + register: registry_xml + - name: Check OPatch version + shell: "grep {{ opatch_version }} {{ weblogic_home }}/OPatch/version.txt" + ignore_errors: True + register: opatch_version_flag + when: opatch_version is defined + - name: Check if patched with correct patch + become: yes + become_user: "{{ weblogic_user }}" + shell: "{{ weblogic_home }}/OPatch/opatch lspatches | grep -i {{ patch_number }}" + changed_when: False + when: patch_number is defined + + tasks: + - name: Check that AppServer.properties exists + assert: + that: boot_props.stat.exists + - name: Check that environment file has been created correctly + assert: + that: "{{ 'MW_HOME=/home/oracle/Oracle/Middleware/Oracle_Home' in (env_oracle_sh['content'] | b64decode) }}" + - name: Check Weblogic Installed + assert: + that: "{{ 'distribution status=\"installed\" name=\"WebLogic Server\"' in (registry_xml['content'] | b64decode) }}" + - name: Check OPatch version + assert: + that: opatch_version_flag.rc == 0 + when: opatch_version is defined diff --git a/molecule/__weblogic-v12.2/converge.yml b/molecule/__weblogic-v12.2/converge.yml new file mode 100644 index 00000000..c91ac871 --- /dev/null +++ b/molecule/__weblogic-v12.2/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + weblogic_version: "12.2.1.4.210716" + # weblogic_installer_path: /opt/IBM/weblogic/WLS + download_url: "{{ lookup('env','ARTIFACTORY_URL') }}/{{ lookup('env','ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: {'X-JFrog-Art-Api': "{{ lookup('env','ARTIFACTORY_TOKEN' )}}"} + roles: + - weblogic diff --git a/molecule/__weblogic-v12.2/verify.yml b/molecule/__weblogic-v12.2/verify.yml new file mode 100644 index 00000000..c7bf7a63 --- /dev/null +++ b/molecule/__weblogic-v12.2/verify.yml @@ -0,0 +1,45 @@ +--- +- name: Verify + hosts: all + pre_tasks: + - name: include defaults + include_vars: "../../roles/weblogic/defaults/main.yml" + - name: include vars + include_vars: "../../roles/weblogic/vars/v12.2.1.4.210716.yml" + - stat: + path: /opt/Props/AppServer.properties + register: boot_props + - name: Slurp profile.d + slurp: + src: /opt/profile.d/weblogic.sh + register: env_oracle_sh + - name: Slurp registry.xml + slurp: + src: /home/oracle/Oracle/Middleware/Oracle_Home/inventory/registry.xml + register: registry_xml + - name: Check OPatch version + shell: "grep {{ opatch_version }} {{ weblogic_home }}/OPatch/version.txt" + ignore_errors: True + register: opatch_version_flag + when: opatch_version is defined + - name: Check if patched with correct patch + become: yes + become_user: "{{ weblogic_user }}" + shell: "{{ weblogic_home }}/OPatch/opatch lspatches | grep -i {{ patch_number }}" + changed_when: False + when: patch_number is defined + + tasks: + - name: Check that AppServer.properties exists + assert: + that: boot_props.stat.exists + - name: Check that environment file has been created correctly + assert: + that: "{{ 'MW_HOME=/home/oracle/Oracle/Middleware/Oracle_Home' in (env_oracle_sh['content'] | b64decode) }}" + - name: Check Weblogic Installed + assert: + that: "{{ 'distribution status=\"installed\" name=\"WebLogic Server\"' in (registry_xml['content'] | b64decode) }}" + - name: Check OPatch version + assert: + that: opatch_version_flag.rc == 0 + when: opatch_version is defined diff --git a/molecule/__weblogic-v14.1/converge.yml b/molecule/__weblogic-v14.1/converge.yml new file mode 100644 index 00000000..83783918 --- /dev/null +++ b/molecule/__weblogic-v14.1/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + weblogic_version: "14.1.1.0.240328" + # weblogic_installer_path: /opt/IBM/weblogic/WLS + download_url: "{{ lookup('env','ARTIFACTORY_URL') }}/{{ lookup('env','ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: {'X-JFrog-Art-Api': "{{ lookup('env','ARTIFACTORY_TOKEN' )}}"} + roles: + - weblogic diff --git a/molecule/__weblogic-v14.1/verify.yml b/molecule/__weblogic-v14.1/verify.yml new file mode 100644 index 00000000..3bd87904 --- /dev/null +++ b/molecule/__weblogic-v14.1/verify.yml @@ -0,0 +1,44 @@ +--- +- name: Verify + hosts: all + pre_tasks: + - name: include defaults + include_vars: "../../roles/weblogic/defaults/main.yml" + - name: include vars + include_vars: "../../roles/weblogic/vars/v14.1.1.0.240328.yml" + - stat: + path: /opt/Props/AppServer.properties + register: boot_props + - name: Slurp profile.d + slurp: + src: /opt/profile.d/weblogic.sh + register: env_oracle_sh + - name: Slurp registry.xml + slurp: + src: /home/oracle/Oracle/Middleware/Oracle_Home/inventory/registry.xml + register: registry_xml + - name: Check OPatch version + shell: "grep {{ opatch_version }} {{ weblogic_home }}/OPatch/version.txt" + ignore_errors: True + register: opatch_version_flag + when: opatch_version is defined + - name: Check if patched with correct patch + become: yes + become_user: "{{ weblogic_user }}" + shell: "{{ weblogic_home }}/OPatch/opatch lspatches | grep -i {{ patch_number }}" + changed_when: False + when: patch_number is defined + tasks: + - name: Check that AppServer.properties exists + assert: + that: boot_props.stat.exists + - name: Check that environment file has been created correctly + assert: + that: "{{ 'MW_HOME=/home/oracle/Oracle/Middleware/Oracle_Home' in (env_oracle_sh['content'] | b64decode) }}" + - name: Check Weblogic Installed + assert: + that: "{{ 'distribution status=\"installed\" name=\"WebLogic Server\"' in (registry_xml['content'] | b64decode) }}" + - name: Check OPatch version + assert: + that: opatch_version_flag.rc == 0 + when: opatch_version is defined diff --git a/molecule/__websphere-v85/converge.yml b/molecule/__websphere-v85/converge.yml new file mode 100644 index 00000000..27e298dd --- /dev/null +++ b/molecule/__websphere-v85/converge.yml @@ -0,0 +1,15 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + websphere_version: 8.5.5.20 + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} + + roles: + - iim + - websphere diff --git a/molecule/__websphere-v85/verify.yml b/molecule/__websphere-v85/verify.yml new file mode 100644 index 00000000..a8b49dc1 --- /dev/null +++ b/molecule/__websphere-v85/verify.yml @@ -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) }}" diff --git a/molecule/__websphere-v90/converge.yml b/molecule/__websphere-v90/converge.yml new file mode 100644 index 00000000..91192c6f --- /dev/null +++ b/molecule/__websphere-v90/converge.yml @@ -0,0 +1,17 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + vars: + iim_agent_version: 1.9.2008.20240227_0018 + iim_install_path: /opt/IBM/InstallationManager + websphere_version: 9.0.5.19 + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} + + roles: + - iim + - websphere diff --git a/molecule/__websphere-v90/verify.yml b/molecule/__websphere-v90/verify.yml new file mode 100644 index 00000000..d7e0950f --- /dev/null +++ b/molecule/__websphere-v90/verify.yml @@ -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: + - "{{ '-Xmx1600m' 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) }}" diff --git a/molecule/_resources/Dockerfile.j2 b/molecule/_resources/Dockerfile.j2 new file mode 100644 index 00000000..47886241 --- /dev/null +++ b/molecule/_resources/Dockerfile.j2 @@ -0,0 +1,26 @@ +# Molecule managed + +{% if item.registry is defined %} +FROM {{ item.registry.url }}/{{ item.image }} +{% else %} +FROM --platform=linux/amd64 {{ 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 findutils which unzip zip procps python3-libselinux && dnf clean all; \ + elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash findutils which unzip zip procps && 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 \ No newline at end of file diff --git a/molecule/db21145/converge.yml b/molecule/db21145/converge.yml new file mode 100644 index 00000000..31600a38 --- /dev/null +++ b/molecule/db21145/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + roles: + - db2 + + vars: + db2_version: "11.1.4.5" + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} diff --git a/molecule/db21145/molecule.yml b/molecule/db21145/molecule.yml new file mode 100644 index 00000000..e266c3fe --- /dev/null +++ b/molecule/db21145/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: centos-7 + image: dokken/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: ./converge.yml + verify: ./verify.yml diff --git a/molecule/db21145/verify.yml b/molecule/db21145/verify.yml new file mode 100644 index 00000000..b7b83031 --- /dev/null +++ b/molecule/db21145/verify.yml @@ -0,0 +1,22 @@ +--- +- name: Verify + hosts: all + pre_tasks: + - stat: "path=/opt/Props/Bootstrap.properties" + register: boot_props + - command: "db2level" + become: true + become_user: "db2admin" + become_method: sudo + become_flags: "-i" + register: db2level_cmd + + tasks: + - name: Check that Bootstrap.properties exists + assert: + that: boot_props.stat.exists + - name: Check that the db2level command is working + assert: + that: + - db2level_cmd.rc == 0 + - "'v11.1' in db2level_cmd.stdout" diff --git a/molecule/db21146/converge.yml b/molecule/db21146/converge.yml new file mode 100644 index 00000000..4f25d54f --- /dev/null +++ b/molecule/db21146/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + roles: + - db2 + + vars: + db2_version: "11.1.4.6" + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} diff --git a/molecule/db21146/molecule.yml b/molecule/db21146/molecule.yml new file mode 100644 index 00000000..5d0d3713 --- /dev/null +++ b/molecule/db21146/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux8 + image: rockylinux: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: ./converge.yml + verify: ./verify.yml diff --git a/molecule/db21146/verify.yml b/molecule/db21146/verify.yml new file mode 100644 index 00000000..b7b83031 --- /dev/null +++ b/molecule/db21146/verify.yml @@ -0,0 +1,22 @@ +--- +- name: Verify + hosts: all + pre_tasks: + - stat: "path=/opt/Props/Bootstrap.properties" + register: boot_props + - command: "db2level" + become: true + become_user: "db2admin" + become_method: sudo + become_flags: "-i" + register: db2level_cmd + + tasks: + - name: Check that Bootstrap.properties exists + assert: + that: boot_props.stat.exists + - name: Check that the db2level command is working + assert: + that: + - db2level_cmd.rc == 0 + - "'v11.1' in db2level_cmd.stdout" diff --git a/molecule/db21157/converge.yml b/molecule/db21157/converge.yml new file mode 100644 index 00000000..7a66f289 --- /dev/null +++ b/molecule/db21157/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + roles: + - db2 + + vars: + db2_version: "11.5.7.0" + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} diff --git a/molecule/db21157/molecule.yml b/molecule/db21157/molecule.yml new file mode 100644 index 00000000..5d0d3713 --- /dev/null +++ b/molecule/db21157/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux8 + image: rockylinux: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: ./converge.yml + verify: ./verify.yml diff --git a/molecule/db21157/verify.yml b/molecule/db21157/verify.yml new file mode 100644 index 00000000..b7ca9a49 --- /dev/null +++ b/molecule/db21157/verify.yml @@ -0,0 +1,22 @@ +--- +- name: Verify + hosts: all + pre_tasks: + - stat: "path=/opt/Props/Bootstrap.properties" + register: boot_props + - command: "db2level" + become: true + become_user: "db2admin" + become_method: sudo + become_flags: "-i" + register: db2level_cmd + + tasks: + - name: Check that Bootstrap.properties exists + assert: + that: boot_props.stat.exists + - name: Check that the db2level command is working + assert: + that: + - db2level_cmd.rc == 0 + - "'v11.5.7' in db2level_cmd.stdout" diff --git a/molecule/db21158/converge.yml b/molecule/db21158/converge.yml new file mode 100644 index 00000000..7c08c601 --- /dev/null +++ b/molecule/db21158/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + roles: + - db2 + + vars: + db2_version: "11.5.8.0" + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} diff --git a/molecule/db21158/molecule.yml b/molecule/db21158/molecule.yml new file mode 100644 index 00000000..5d0d3713 --- /dev/null +++ b/molecule/db21158/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux8 + image: rockylinux: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: ./converge.yml + verify: ./verify.yml diff --git a/molecule/db21158/verify.yml b/molecule/db21158/verify.yml new file mode 100644 index 00000000..f2704d4c --- /dev/null +++ b/molecule/db21158/verify.yml @@ -0,0 +1,22 @@ +--- +- name: Verify + hosts: all + pre_tasks: + - stat: "path=/opt/Props/Bootstrap.properties" + register: boot_props + - command: "db2level" + become: true + become_user: "db2admin" + become_method: sudo + become_flags: "-i" + register: db2level_cmd + + tasks: + - name: Check that Bootstrap.properties exists + assert: + that: boot_props.stat.exists + - name: Check that the db2level command is working + assert: + that: + - db2level_cmd.rc == 0 + - "'v11.5.8' in db2level_cmd.stdout" diff --git a/molecule/db21159/converge.yml b/molecule/db21159/converge.yml new file mode 100644 index 00000000..1ee1c30d --- /dev/null +++ b/molecule/db21159/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + roles: + - db2 + + vars: + db2_version: "11.5.9.0" + download_url: "{{ lookup('env', 'ARTIFACTORY_URL') }}/{{ lookup('env', 'ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: { 'X-JFrog-Art-Api': "{{ lookup('env', 'ARTIFACTORY_TOKEN') }}"} diff --git a/molecule/db21159/molecule.yml b/molecule/db21159/molecule.yml new file mode 100644 index 00000000..5d0d3713 --- /dev/null +++ b/molecule/db21159/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux8 + image: rockylinux: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: ./converge.yml + verify: ./verify.yml diff --git a/molecule/db21159/verify.yml b/molecule/db21159/verify.yml new file mode 100644 index 00000000..777fd9e3 --- /dev/null +++ b/molecule/db21159/verify.yml @@ -0,0 +1,22 @@ +--- +- name: Verify + hosts: all + pre_tasks: + - stat: "path=/opt/Props/Bootstrap.properties" + register: boot_props + - command: "db2level" + become: true + become_user: "db2admin" + become_method: sudo + become_flags: "-i" + register: db2level_cmd + + tasks: + - name: Check that Bootstrap.properties exists + assert: + that: boot_props.stat.exists + - name: Check that the db2level command is working + assert: + that: + - db2level_cmd.rc == 0 + - "'v11.5.9' in db2level_cmd.stdout" diff --git a/molecule/ihs-v90-rockylinux8/molecule.yml b/molecule/ihs-v90-rockylinux8/molecule.yml new file mode 100644 index 00000000..405ea714 --- /dev/null +++ b/molecule/ihs-v90-rockylinux8/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux-8 + image: rockylinux: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 diff --git a/molecule/iim-191-centos-8/molecule.yml b/molecule/iim-191-centos-8/molecule.yml new file mode 100644 index 00000000..6ea53375 --- /dev/null +++ b/molecule/iim-191-centos-8/molecule.yml @@ -0,0 +1,33 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux8 + image: rockylinux: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: ./converge.yml diff --git a/molecule/iim-191-rockylinux8/converge.yml b/molecule/iim-191-rockylinux8/converge.yml new file mode 100644 index 00000000..e0566aee --- /dev/null +++ b/molecule/iim-191-rockylinux8/converge.yml @@ -0,0 +1,14 @@ +--- +- name: Converge + hosts: all + + collections: + - merative.spm_middleware + + roles: + - iim + + vars: + iim_agent_version: 1.9.2008.20240227_0018 + download_url: "{{ lookup('env','ARTIFACTORY_URL') }}/{{ lookup('env','ARTIFACTORY_REPO') }}/SoftwareInstallers" + download_header: {'X-JFrog-Art-Api': "{{ lookup('env','ARTIFACTORY_TOKEN' )}}"} diff --git a/molecule/iim-191-rockylinux8/molecule.yml b/molecule/iim-191-rockylinux8/molecule.yml new file mode 100644 index 00000000..6ea53375 --- /dev/null +++ b/molecule/iim-191-rockylinux8/molecule.yml @@ -0,0 +1,33 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux8 + image: rockylinux: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: ./converge.yml diff --git a/molecule/liberty-jdk17-rockylinux8/molecule.yml b/molecule/liberty-jdk17-rockylinux8/molecule.yml new file mode 100644 index 00000000..10084fb9 --- /dev/null +++ b/molecule/liberty-jdk17-rockylinux8/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux8 + image: rockylinux: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: ../__liberty17/converge.yml + verify: ../__liberty17/verify.yml diff --git a/molecule/liberty-rockylinux8/molecule.yml b/molecule/liberty-rockylinux8/molecule.yml new file mode 100644 index 00000000..caaa185e --- /dev/null +++ b/molecule/liberty-rockylinux8/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux8 + image: rockylinux: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: ../__liberty/converge.yml + verify: ../__liberty/verify.yml diff --git a/molecule/ohs-v12.2.1.4-rockylinux8/molecule.yml b/molecule/ohs-v12.2.1.4-rockylinux8/molecule.yml new file mode 100644 index 00000000..5f704c71 --- /dev/null +++ b/molecule/ohs-v12.2.1.4-rockylinux8/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux8 + image: rockylinux: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: ../__ohs-v12.2.1.4/converge.yml + verify: ../__ohs-v12.2.1.4/verify.yml diff --git a/molecule/oracle19c-rockylinux8/molecule.yml b/molecule/oracle19c-rockylinux8/molecule.yml new file mode 100644 index 00000000..ee400b4c --- /dev/null +++ b/molecule/oracle19c-rockylinux8/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux8 + image: rockylinux: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: ../__oracle-v19c/converge.yml + verify: ../__oracle-v19c/verify.yml diff --git a/molecule/weblogic-rockylinux8/molecule.yml b/molecule/weblogic-rockylinux8/molecule.yml new file mode 100644 index 00000000..0b72b3c7 --- /dev/null +++ b/molecule/weblogic-rockylinux8/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rockylinux8 + image: rockylinux: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: ../__weblogic-v14.1/converge.yml + verify: ../__weblogic-v14.1/verify.yml diff --git a/molecule/websphere-v90-rockylinux8/molecule.yml b/molecule/websphere-v90-rockylinux8/molecule.yml new file mode 100644 index 00000000..d2346975 --- /dev/null +++ b/molecule/websphere-v90-rockylinux8/molecule.yml @@ -0,0 +1,34 @@ +--- +driver: + name: docker + provider: + name: docker + +lint: | + set -e + yamllint . + +platforms: + - name: rocky-8 + image: rockylinux: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: ../__websphere-v90/converge.yml + verify: ../__websphere-v90/verify.yml