Skip to content

Commit 163eceb

Browse files
NEST OSCert - Windoze support (#237)
* daytrader3 * ear * rename ear * getNameFromIdFromId error * add datasource * db2 debug * it works * webserver name * daytrader tuning * jython args * args * fine tuning * wsadminlib pre-req * start cluster * syncall * add cluster parm * debug * debug * moved the tuning to it's own role * instana retention allows /mnt with 2TB not to fill up over time * better kill twas * remove dup createDatasource * twas_cell copy db2jars to targets * moved db2jar put * propogate plugin-cfg.kdb * pluginkey syntax * python3 tWAS SIB drop tables * mode 755 * datasourceHelperClassname * fix v90 package string * fix extension * v90 packages * twas90 alterations * sdk8 chagnes * twas90 install template * py->yml * wsadminlib.py dest * common daytrader role and files * roles->role * removed symlink due to ansible-galaxy * separate daytrader resource config and application * remove readme * daytrader7 app install * print debug * admin role issue still not working * unintall previous app on re-runs * use wsadminlib function to delete app * move ihsplugin to common role * missing defaults * complete the gen propagate function * java/jmeter forceReplace * java/jmeter forceReplace - helps update existing * missing = * jenkins debug * -vvv debug * bool * indent * indent * create dir * forceReplace.sh script * intial windoze ibm im install debug * add CYGWIN_NT-10.0-20348 * windoze uninstall im debug * windoze check * ihs windoze install path trick * re-enable no log to mask sensitive info * sync * sync * move actual shared config file later in process * sync with external updates * podman for jmeter containers * podman in jmeter play
1 parent 26b3a2f commit 163eceb

File tree

15 files changed

+80
-22
lines changed

15 files changed

+80
-22
lines changed

Diff for: ansible/request-rhel-jmeter-fyre-play/jmeter-play.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
---
22

3+
- hosts: all
4+
vars:
5+
- ansible_user: root
6+
roles:
7+
- role: podman
8+
39
- hosts: all
410
vars:
511
- ansible_user: "{{ jmeterUser }}"
@@ -8,4 +14,3 @@
814
roles:
915
- role: jmeter_java
1016
- role: jmeter
11-

Diff for: ansible/request-rhel-jmeter-fyre-play/request-rhel-jmeter-fyre-play.yml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- role: jmeter_prereqs
1414
- role: nestuser
1515
- role: timezone
16+
- role: podman
1617

1718
- hosts: jmeter
1819
vars:

Diff for: ansible/roles/fyrevm_provision/tasks/fyrevm_provision.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,4 @@
146146
args: "{{ extra_props| default(omit) }}"
147147
no_log: True
148148
changed_when: false
149-
when: "fyre_addAnsibleHost|bool == false"
149+
when: "fyre_addAnsibleHost|bool == false"

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

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
im_driver: 'f5102145.01'
33
twas_release: 'WAS90' # WAS855
44
install_base: '/home/nest'
5+
# trick the template to install onto windoze via cygwin
6+
install_base_win: ''
57
daily_or_test: 'test'
68
http_dir: 'HTTPServer'
79
plugin_dir: 'Plugins'

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

+2
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ im_archive_driver_version: '1916'
33
im_archive_driver: '1.9.1006.20210614_1906'
44
im_archive: 'https://rtpgsa.ibm.com/gsa/rtpgsa/home/w/a/wasngi/web/public/NGI/IM/recommended/drivers/{{ im_archive_driver_version }}/ga'
55
install_base: '/home/nest'
6+
# trick the template to install onto windoze via cygwin
7+
install_base_win: ''
68
shared_dir: 'IM-shared'

Diff for: ansible/roles/ibm_installation_manager/tasks/ibm_installation_manager.yml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- ansible_system == 'Linux'
2323
- set_fact:
2424
archive_name_match: 'agent.installer.win32.win32.x86_64_{{ im_archive_driver }}.zip'
25+
install_base_win: 'c:\cygwin'
2526
when:
2627
- ansible_architecture == 'x86_64'
2728
- ansible_system == 'Windows' or 'CYG' in ansible_system

Diff for: ansible/roles/ibm_installation_manager/templates/ibm_im_responsefile.xml.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<agent-input>
33
<server>
4-
<repository location='{{ install_base }}/im_install' temporary='true'/>
4+
<repository location='{{ install_base_win}}{{ install_base }}/im_install' temporary='true'/>
55
</server>
6-
<profile kind='self' installLocation='{{ install_base }}/IM' id='IBM Installation Manager'>
7-
<data key='eclipseLocation' value='{{ install_base }}/IM'/>
6+
<profile kind='self' installLocation='{{ install_base_win}}{{ install_base }}/IM' id='IBM Installation Manager'>
7+
<data key='eclipseLocation' value='{{ install_base_win}}{{ install_base }}/IM'/>
88
<data key='cic.selector.nl' value='ja,es,ru,en,fr,zh_TW,pl,el,de,cs,zh_HK,ko,hu,pt_BR,tr,it,da,zh'/>
99
</profile>
1010
<install>

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ cic_selector_os:
1010
AIX: 'aix'
1111
Linux: 'linux'
1212
Windows: 'win32'
13-
ZOS: 'zos'
13+
CYGWIN_NT-10.0-20348: 'win32' # hard coded to a specific cygwin version
14+
ZOS: 'zos'

Diff for: ansible/roles/im_cleanup_http_liberty_im/tasks/im_cleanup_http_liberty_im.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,23 @@
5050
debug:
5151
msg: "{{ uninstallOutput.stdout_lines }}"
5252

53-
- name: uninstall ibm installation manager
53+
# windoze /cygdrive/c/Users/Administrator/AppData/Roaming/IBM/Installation Manager/uninstall/userinstc
54+
# ansible_user: Administrator
55+
- name: uninstall Windoze ibm installation manager
56+
ignore_errors: true
57+
shell: "~/AppData/Roaming/IBM/Installation Manager/uninstall/userinstc"
58+
register: uninstallOutput
59+
failed_when: ( uninstallOutput.rc not in [ 0, 1 ] )
60+
when:
61+
- ansible_system == 'Windows' or 'CYG' in ansible_system
62+
63+
- name: uninstall *nix ibm installation manager
5464
ignore_errors: true
5565
shell: "~/var/ibm/InstallationManager/uninstall/uninstallc"
5666
register: uninstallOutput
5767
failed_when: ( uninstallOutput.rc not in [ 0, 1 ] )
68+
when:
69+
- ansible_system != 'Windows' and 'CYG' not in ansible_system
5870

5971
- name: uninstallAll output
6072
debug:

Diff for: ansible/roles/im_install_http_plugin/tasks/im_install_http_plugin.yml

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
path: "{{ install_base }}/IM/eclipse/tools/imcl"
1313
register: isimcl
1414
failed_when: isimcl.stat.exists == False
15+
16+
- set_fact:
17+
install_base_win: 'c:\cygwin'
18+
when:
19+
- ansible_architecture == 'x86_64'
20+
- ansible_system == 'Windows' or 'CYG' in ansible_system
1521

1622
- name: copy ihs_plugin.xml template
1723
template:

Diff for: ansible/roles/im_install_http_plugin/templates/im_http_plugin_WAS90.xml.j2

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<agent-input>
33
<variables>
4-
<variable name='sharedLocation' value='{{ install_base }}/{{ shared_dir }}'/>
4+
<variable name='sharedLocation' value='{{ install_base_win }}{{ install_base }}/{{ shared_dir }}'/>
55
</variables>
66
<server>
77
<repository location='https://rtpgsa.ibm.com/gsa/rtpgsa/projects/w/was.build/botp/{{ twas_release }}.IM/{{ daily_or_test }}/{{ im_driver }}.linux/linux/zipper/repository/'/>
88
</server>
9-
<profile id='IBM HTTP Server' installLocation='{{ install_base }}/{{ http_dir }}'>
9+
<profile id='IBM HTTP Server' installLocation='{{ install_base_win }}{{ install_base }}/{{ http_dir }}'>
1010
<data key='cic.selector.arch' value='{{ cic_selector_arch[ansible_architecture] }}'/>
1111
<data key='cic.selector.os' value='{{ cic_selector_os[ansible_system] }}'/>
1212
<data key='user.ihs.allowNonRootSilentInstall' value='true'/>
@@ -23,7 +23,7 @@
2323
<!-- IBM SDK, Java Technology Edition, Version 8 8.0.7.0 -->
2424
<offering profile='IBM HTTP Server' id='{{ im_http_java_package }}' features='com.ibm.sdk.8'/>
2525
</install>
26-
<profile id='Web Server Plug-ins for IBM WebSphere Application Server' installLocation='{{ install_base }}/{{ plugin_dir }}'>
26+
<profile id='Web Server Plug-ins for IBM WebSphere Application Server' installLocation='{{ install_base_win }}{{ install_base }}/{{ plugin_dir }}'>
2727
<data key='cic.selector.arch' value='{{ cic_selector_arch[ansible_architecture] }}'/>
2828
<data key='cic.selector.os' value='{{ cic_selector_os[ansible_system] }}'/>
2929
</profile>
@@ -33,7 +33,7 @@
3333
<!-- IBM SDK, Java Technology Edition, Version 8 8.0.7.0 -->
3434
<offering profile='Web Server Plug-ins for IBM WebSphere Application Server' id='{{ im_plugin_java_package }}' features='com.ibm.sdk.8'/>
3535
</install>
36-
<profile id='WebSphere Customization Toolbox' installLocation='{{ install_base }}/{{ wct_dir }}'>
36+
<profile id='WebSphere Customization Toolbox' installLocation='{{ install_base_win }}{{ install_base }}/{{ wct_dir }}'>
3737
<data key='cic.selector.arch' value='{{ cic_selector_arch[ansible_architecture] }}'/>
3838
<data key='cic.selector.os' value='{{ cic_selector_os[ansible_system] }}'/>
3939
</profile>

Diff for: ansible/roles/podman/tasks/RedHat.8.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
# specific OS supports wildcards, if preceded with @ its a group
3+
# if the db is corrupt, this can fix it: rpm --rebuilddb
4+
- name: dnf update
5+
become: yes
6+
dnf:
7+
name: '*'
8+
state: latest
9+
10+
- name: install packages
11+
become: yes
12+
dnf:
13+
name: "{{ packages }}"
14+
state: present
15+
vars:
16+
packages:
17+
- 'podman'

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

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
- include_tasks: "{{ ansible_distribution }}.{{ ansible_distribution_major_version }}.yml"
3+
when:
4+
- ansible_system == 'Linux'

Diff for: ansible/roles/was_automation_register/scripts/configuretWasUsageMetering.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#------------------------------------------------------------------------------------
22
# configuretWasUsageMetering.py - configure tWAS server with usage metering feature
3-
# https://www.ibm.com/docs/en/ws-automation?topic=vulnerabilities-adding-websphere-application-server-server#cf-t-add-was__wsascript
3+
# https://www.ibm.com/docs/en/ws-automation?topic=monitoring-registering-websphere-application-server-traditional-servers
44
#------------------------------------------------------------------------------------
55
#
66
# This script configures a traditional WebSphere Application Server with the usage
@@ -176,8 +176,7 @@ def configuretWasUsageMetering(url, apiKey, sslRef, trustStoreName, trustStorePa
176176
#-------------------------------------------------------------
177177
if len(certAlias) == 0:
178178
# use default certificate alias if it is not specified
179-
# NOTE: the alias is stored in all lower case even if it has CAPS.....
180-
certAlias = "meteringalias".lower()
179+
certAlias = "meteringalias"
181180
print "Using default certificate alias: " + certAlias
182181

183182
# delete certificate if it exists in keystore
@@ -187,9 +186,8 @@ def configuretWasUsageMetering(url, apiKey, sslRef, trustStoreName, trustStorePa
187186
start = cert.find("alias")
188187
end = cert.find("] [version")
189188
alias = cert[start+6:end]
190-
print "checking signer: " + alias
191189
if alias == certAlias.lower():
192-
print "Deleting signer: " + alias
190+
print "Deleting existing certificate ... " + alias
193191
AdminTask.deleteSignerCertificate(['-keyStoreName', trustStoreName, '-certificateAlias', alias ])
194192

195193
# retrieve new certificate from api-usagemetering-host and port
@@ -1090,7 +1088,7 @@ def _splitlist(s):
10901088
if len(url) > 0:
10911089
print " url: " + url
10921090
if len(apiKey) > 0:
1093-
print " apiKey: " + "********" #### [email protected] - do not echo sensitive info
1091+
print " apiKey: " + "********"
10941092
if len(sslRef) > 0:
10951093
print " sslRef: " + sslRef
10961094
if len(trustStoreName) > 0:
@@ -1113,3 +1111,5 @@ def _splitlist(s):
11131111
configuretWasUsageMetering(url, apiKey, sslRef, trustStoreName, trustStorePassword, certAlias, nodeName, serverName, clusterName, startServers, namespace)
11141112

11151113
#endIf
1114+
1115+

Diff for: ansible/roles/was_automation_register/tasks/liberty.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
liberty_usr_dir: "{{ usr_dir[usr_dir_index|int:usr_dir_len|int] }}"
4040
liberty_shared_config: "{{ usr_dir[usr_dir_index|int:usr_dir_len|int] }}/shared/config"
4141

42+
- name: ensure the liberty shared directory exists
43+
file:
44+
path: "{{ item }}"
45+
state: directory
46+
with_items:
47+
- "{{ liberty_shared_config }}"
48+
4249
- name: remove existing config
4350
file:
4451
path: "{{ item }}"
@@ -58,11 +65,6 @@
5865
command: "{{ wa_target_path }}/{{ securityUtility_bin.stdout_lines[0] }} encode {{ wa_keystore_pass }}"
5966
register: xor # DO NOT CHANGE THIS NAME. ITS used in templates/was-usage-metering.xml.j2
6067

61-
- name: Generate config files
62-
template:
63-
src: was-usage-metering.xml.j2
64-
dest: "{{ liberty_shared_config }}/was-usage-metering.xml"
65-
6668
- name: find the keytool
6769
command: "find . -name keytool"
6870
args:
@@ -86,6 +88,11 @@
8688
chdir: "{{ liberty_shared_config }}"
8789
register: import_cert
8890

91+
- name: Generate config files
92+
template:
93+
src: was-usage-metering.xml.j2
94+
dest: "{{ liberty_shared_config }}/was-usage-metering.xml"
95+
8996
- name: add new config into the servers server.xml file
9097
lineinfile:
9198
path: "{{ liberty_usr_dir }}/servers/{{ item }}/server.xml"

0 commit comments

Comments
 (0)