From 35589d4677974bfa9da7695cc36758a254f0ae29 Mon Sep 17 00:00:00 2001 From: Amir Mofasser Date: Thu, 5 Nov 2015 08:52:59 +0100 Subject: [PATCH 1/4] Initial commit --- .gitignore | 2 + library/ibmim.py | 65 +++++++++++++++++++++++++ library/ibmwas.py | 88 +++++++++++++++++++++++++++++++++ library/liberty_server.py | 58 ++++++++++++++++++++++ library/profile_dmgr.py | 81 +++++++++++++++++++++++++++++++ library/profile_liberty.py | 55 +++++++++++++++++++++ library/profile_nodeagent.py | 94 ++++++++++++++++++++++++++++++++++++ library/server.py | 65 +++++++++++++++++++++++++ library/wsadmin.py | 54 +++++++++++++++++++++ 9 files changed, 562 insertions(+) create mode 100644 .gitignore create mode 100644 library/ibmim.py create mode 100644 library/ibmwas.py create mode 100644 library/liberty_server.py create mode 100644 library/profile_dmgr.py create mode 100644 library/profile_liberty.py create mode 100644 library/profile_nodeagent.py create mode 100644 library/server.py create mode 100644 library/wsadmin.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96378a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_store +*.swp diff --git a/library/ibmim.py b/library/ibmim.py new file mode 100644 index 0000000..995f756 --- /dev/null +++ b/library/ibmim.py @@ -0,0 +1,65 @@ +#!/usr/bin/python + +# +# Author: Amir Mofasser +# +# This is an Anible module. Installs/Uninstall IBM Installation Manager +# + +import os +import subprocess +import platform +import datetime + +def main(): + + # Read arguments + module = AnsibleModule( + argument_spec = dict( + state = dict(default='present', choices=['present', 'abcent']), + src = dict(required=True), + dest = dict(required=False), + logdir = dict(required=False) + ) + ) + + state = module.params['state'] + src = module.params['src'] + dest = module.params['dest'] + logdir = module.params['logdir'] + + if state == 'present': + + # Check if paths are valid + if not os.path.exists(src+"/install"): + module.fail_json(msg=src+"/install not found") + if not os.path.exists(logdir): + if not os.listdir(logdir): + os.makedirs(logdir) + + logfile = platform.node() + "_ibmim_" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S") + ".xml" + child = subprocess.Popen([src+"/install -acceptLicense --launcher.ini "+src+"/silent-install.ini -log " + logdir+"/"+logfile], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + module.fail_json(msg="IBM IM installation failed", stderr=stderr_value, stdout=stdout_value) + + # Module finished + module.exit_json(changed=True, msg="IBM IM installed successfully") + + if state == 'abcent': + uninstall_dir = "/var/ibm/InstallationManager/uninstall/uninstallc" + if not os.path.exists("/var/ibm/InstallationManager/uninstall/uninstallc"): + module.fail_json(msg=uninstall_dir + " does not exist") + child = subprocess.Popen([uninstall_dir], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + module.fail_json(msg="IBM IM uninstall failed", stderr=stderr_value, stdout=stdout_value) + + # Module finished + module.exit_json(changed=True, msg="IBM IM uninstalled successfully", stdout=stdout_value) + + +# import module snippets +from ansible.module_utils.basic import * +if __name__ == '__main__': + main() diff --git a/library/ibmwas.py b/library/ibmwas.py new file mode 100644 index 0000000..1aaddcf --- /dev/null +++ b/library/ibmwas.py @@ -0,0 +1,88 @@ +#!/usr/bin/python + +# +# Author: Amir Mofasser +# +# This is an Ansible module. Installs/Uninstall IBM WebSphere Application Server Binaries +# +# $IM_INSTALL_DIR/eclipse/tools/imcl install com.ibm.websphere.ND.v85 +# -repositories $ND_REPO_DIR +# -installationDirectory $ND_INSTALL_DIR +# -sharedResourcesDirectory $IM_SHARED_INSTALL_DIR +# -acceptLicense -showProgress + +import os +import subprocess +import platform +import datetime +import shutil + +def main(): + + # WAS offerings + offerings = [ + 'com.ibm.websphere.ND.v85', + 'com.ibm.websphere.IHS.v85', + 'com.ibm.websphere.PLG.v85', + 'com.ibm.websphere.WCT.v85', + 'com.ibm.websphere.liberty.IBMJAVA.v70', + 'com.ibm.websphere.liberty.v85' + ] + + # Read arguments + module = AnsibleModule( + argument_spec = dict( + state = dict(default='present', choices=['present', 'abcent']), + ibmim = dict(required=True), + dest = dict(required=True), + im_shared = dict(required=False), + repo = dict(required=False), + offering = dict(default='com.ibm.websphere.ND.v85', choices=offerings), + ihs_port = dict(default=8080), + logdir = dict(required=False) + ) + ) + + state = module.params['state'] + ibmim = module.params['ibmim'] + dest = module.params['dest'] + im_shared = module.params['im_shared'] + repo = module.params['repo'] + ihs_port = module.params['ihs_port'] + offering = module.params['offering'] + logdir = module.params['logdir'] + + # Check if paths are valid + if not os.path.exists(ibmim+"/eclipse"): + module.fail_json(msg=ibmim+"/eclipse not found") + + # Installation + if state == 'present': + child = subprocess.Popen([ibmim+"/eclipse/tools/imcl install " + offering + " -repositories " + repo + " -installationDirectory " + dest + " -sharedResourcesDirectory " + im_shared + " -acceptLicense -showProgress -properties user.ihs.httpPort=" + str(ihs_port)], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + module.fail_json(msg="WAS ND install failed", stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg="WAS ND installed successfully", stdout=stdout_value) + + # Uninstall + if state == 'abcent': + if not os.path.exists(logdir): + if not os.listdir(logdir): + os.makedirs(logdir) + logfile = platform.node() + "_wasnd_" + datetime.datetime.now().strftime("%Y%m%d-%H%M%S") + ".xml" + child = subprocess.Popen([ibmim+"/eclipse/IBMIM --launcher.ini " + ibmim + "/eclipse/silent-install.ini -input " + dest + "/uninstall/uninstall.xml -log " + logdir+"/"+logfile], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + module.fail_json(msg="WAS ND uninstall failed", stdout=stdout_value, stderr=stderr_value) + + # Remove AppServer dir forcefully so that it doesn't prevents us from + # reinstalling. + shutil.rmtree(dest, ignore_errors=False, onerror=None) + + module.exit_json(changed=True, msg="WAS ND uninstalled successfully", stdout=stdout_value) + +# import module snippets +from ansible.module_utils.basic import * +if __name__ == '__main__': + main() diff --git a/library/liberty_server.py b/library/liberty_server.py new file mode 100644 index 0000000..f6135c4 --- /dev/null +++ b/library/liberty_server.py @@ -0,0 +1,58 @@ +#!/usr/bin/python + +# +# Author: Amir Mofasser +# +# This is an Ansible module. Start/Stop a liberty server +# +# $LIBERTY_SERVER_DIR/server stop +# $LIBERTY_SERVER_DIR/server start +# + +import os +import subprocess +import platform +import datetime + +def main(): + + # Read arguments + module = AnsibleModule( + argument_spec = dict( + state = dict(default='started', choices=['started', 'stopped']), + name = dict(required=True), + libertydir = dict(required=True) + ) + ) + + state = module.params['state'] + name = module.params['name'] + libertydir = module.params['libertydir'] + + # Check if paths are valid + if not os.path.exists(libertydir): + module.fail_json(msg=libertydir+" does not exists") + + if state == 'stopped': + child = subprocess.Popen([libertydir+"/bin/server stop " + name], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + if not stderr_value.find("is not running") < 0: + module.fail_json(msg=name + " stop failed", stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg=name + " stopped successfully", stdout=stdout_value) + + if state == 'started': + child = subprocess.Popen([libertydir+"/bin/server start " + name], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + if not stderr_value.find("is running with process") < 0: + module.fail_json(msg=name + " start failed", stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg=name + " started successfully", stdout=stdout_value) + + +# import module snippets +from ansible.module_utils.basic import * +if __name__ == '__main__': + main() diff --git a/library/profile_dmgr.py b/library/profile_dmgr.py new file mode 100644 index 0000000..2eb600e --- /dev/null +++ b/library/profile_dmgr.py @@ -0,0 +1,81 @@ +#!/usr/bin/python + +# +# Author: Amir Mofasser +# +# This is an Ansible module. Creates a WAS Deployment Manager profile +# +# $WAS_INSTALL_DIR/bin/manageprofiles.sh -create +# -profileName $name +# -profilePath $WAS_INSTALL_DIR/profiles/$name +# -templatePath $WAS_INSTALL_DIR/profileTemplates/management +# -cellName $CELL_NAME +# -hostName $HOST_NAME +# -nodeName $NODE_NAME +# -enableAdminSecurity true +# -adminUserName $ADMIN_USER +# -adminPassword $ADMIN_PASS + +import os +import subprocess +import platform +import datetime + +def main(): + + # Read arguments + module = AnsibleModule( + argument_spec = dict( + state = dict(default='present', choices=['present', 'abcent']), + wasdir = dict(required=True), + name = dict(required=True), + cell_name = dict(required=False), + host_name = dict(required=False), + node_name = dict(required=False), + username = dict(required=False), + password = dict(required=False) + ) + ) + + state = module.params['state'] + wasdir = module.params['wasdir'] + name = module.params['name'] + cell_name = module.params['cell_name'] + host_name = module.params['host_name'] + node_name = module.params['node_name'] + username = module.params['username'] + password = module.params['password'] + + # Check if paths are valid + if not os.path.exists(wasdir): + module.fail_json(msg=wasdir+" does not exists") + + # Create a profile + if state == 'present': + child = subprocess.Popen([wasdir+"/bin/manageprofiles.sh -create -profileName " + name + " -profilePath " + wasdir+"/profiles/"+name + " -templatePath " + wasdir+"/profileTemplates/management -cellName " + cell_name + " -hostName " + host_name + " -nodeName " + node_name + " -enableAdminSecurity true -adminUserName " + username + " -adminPassword " + password], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + module.fail_json(msg="Dmgr profile creation failed", stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg=name + " profile created successfully", stdout=stdout_value) + + # Remove a profile + if state == 'abcent': + child = subprocess.Popen([wasdir+"/bin/manageprofiles.sh -delete -profileName " + name], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + # manageprofiles.sh -delete will fail if the profile does not exist. + # But creation of a profile with the same name will also fail if + # the directory is not empty. So we better remove the dir forcefully. + if not stdout_value.find("INSTCONFFAILED") < 0: + shutil.rmtree(wasdir+"/profiles/"+name, ignore_errors=False, onerror=None) + else: + module.fail_json(msg="Dmgr profile removal failed", stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg=name + " profile removed successfully", stdout=stdout_value, stderr=stderr_value) + + +# import module snippets +from ansible.module_utils.basic import * +if __name__ == '__main__': + main() diff --git a/library/profile_liberty.py b/library/profile_liberty.py new file mode 100644 index 0000000..8ed0dac --- /dev/null +++ b/library/profile_liberty.py @@ -0,0 +1,55 @@ +#!/usr/bin/python + +# +# Author: Amir Mofasser +# +# This is an Ansible module. Creates a Liberty server +# +# server create server_name +# + +import os +import subprocess + +def main(): + + # Read arguments + module = AnsibleModule( + argument_spec = dict( + state = dict(default='present', choices=['present', 'abcent']), + libertydir = dict(required=True), + name = dict(required=True), + ) + ) + + state = module.params['state'] + libertydir = module.params['libertydir'] + name = module.params['name'] + + # Check if paths are valid + if not os.path.exists(libertydir): + module.fail_json(msg=libertydir+" does not exists") + + # Create a profile + if state == 'present': + child = subprocess.Popen([libertydir+"/bin/server create " + name], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + module.fail_json(msg="Failed to create liberty server " + name, stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg=name + " server created successfully", stdout=stdout_value) + + # Remove a profile + if state == 'abcent': + child = subprocess.Popen(["rm -rf " + libertydir+"/usr/servers/" + name], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + module.fail_json(msg="Dmgr profile removal failed", stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg=name + " server removed successfully", stdout=stdout_value, stderr=stderr_value) + + +# import module snippets +from ansible.module_utils.basic import * +if __name__ == '__main__': + main() diff --git a/library/profile_nodeagent.py b/library/profile_nodeagent.py new file mode 100644 index 0000000..7d3c910 --- /dev/null +++ b/library/profile_nodeagent.py @@ -0,0 +1,94 @@ +#!/usr/bin/python + +# +# Author: Amir Mofasser +# +# This is an Ansible module. Creates a WAS Node Agent profile +# ./manageprofiles.sh -create +# -profileName appsrv02 +# -profilePath /var/apps/was7/profiles/appsrv02 +# -templatePath /var/apps/was7/profileTemplates/managed +# -cellName appsrv02node02 +# -hostName appsrv02.webspheretools.com +# -nodeName appsrv02node02 +# -enableAdminSecurity true +# -adminUserName wasadmin +# -adminPassword wasadmin + + +import os +import subprocess +import platform +import datetime + +def main(): + + # Read arguments + module = AnsibleModule( + argument_spec = dict( + state = dict(default='present', choices=['present', 'abcent']), + wasdir = dict(required=True), + name = dict(required=True), + cell_name = dict(required=False), + host_name = dict(required=False), + node_name = dict(required=False), + username = dict(required=False), + password = dict(required=False), + dmgr_host = dict(required=False), + dmgr_port = dict(required=False), + federate = dict(required=False, choices=BOOLEANS) + ) + ) + + state = module.params['state'] + wasdir = module.params['wasdir'] + name = module.params['name'] + cell_name = module.params['cell_name'] + host_name = module.params['host_name'] + node_name = module.params['node_name'] + username = module.params['username'] + password = module.params['password'] + dmgr_host = module.params['dmgr_host'] + dmgr_port = module.params['dmgr_port'] + federate = module.params['federate'] + + # Check if paths are valid + if not os.path.exists(wasdir): + module.fail_json(msg=wasdir+" does not exists") + + # Create a profile + if state == 'present': + child = subprocess.Popen([wasdir+"/bin/manageprofiles.sh -create -profileName " + name + " -profilePath " + wasdir+"/profiles/"+name + " -templatePath " + wasdir+"/profileTemplates/managed -cellName " + cell_name + " -hostName " + host_name + " -nodeName " + node_name + " -enableAdminSecurity true -adminUserName " + username + " -adminPassword " + password], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + module.fail_json(msg="Dmgr profile creation failed", stdout=stdout_value, stderr=stderr_value) + + if federate: + # Federate the node + child = subprocess.Popen([wasdir+"/bin/addNode.sh " + dmgr_host + " " + dmgr_port + " -conntype SOAP -username " + username + " -password " + password + " -profileName " + name], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + module.fail_json(msg="Node federation failed", stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg=name + " profile created successfully", stdout=stdout_value) + + # Remove a profile + if state == 'abcent': + child = subprocess.Popen([wasdir+"/bin/manageprofiles.sh -delete -profileName " + name], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + # manageprofiles.sh -delete will fail if the profile does not exist. + # But creation of a profile with the same name will also fail if + # the directory is not empty. So we better remove the dir forcefully. + if not stdout_value.find("INSTCONFFAILED") < 0: + shutil.rmtree(wasdir+"/profiles/"+name, ignore_errors=False, onerror=None) + else: + module.fail_json(msg="Dmgr profile removal failed", stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg=name + " profile removed successfully", stdout=stdout_value, stderr=stderr_value) + + +# import module snippets +from ansible.module_utils.basic import * +if __name__ == '__main__': + main() diff --git a/library/server.py b/library/server.py new file mode 100644 index 0000000..b89209c --- /dev/null +++ b/library/server.py @@ -0,0 +1,65 @@ +#!/usr/bin/python + +# +# Author: Amir Mofasser +# +# Stop/Start an Application Server +# +# $IM_INSTALL_DIR/eclipse/tools/imcl install com.ibm.websphere.ND.v85 +# -repositories $ND_REPO_DIR +# -installationDirectory $ND_INSTALL_DIR +# -sharedResourcesDirectory $IM_SHARED_INSTALL_DIR +# -acceptLicense -showProgress + +import os +import subprocess +import platform +import datetime + +def main(): + + # Read arguments + module = AnsibleModule( + argument_spec = dict( + state = dict(default='started', choices=['started', 'stopped']), + name = dict(required=True), + username = dict(required=True), + password = dict(required=True), + wasdir = dict(required=True) + ) + ) + + state = module.params['state'] + name = module.params['name'] + username = module.params['username'] + password = module.params['password'] + wasdir = module.params['wasdir'] + + # Check if paths are valid + if not os.path.exists(wasdir): + module.fail_json(msg=wasdir+" does not exists") + + # Stop server + if state == 'stopped': + child = subprocess.Popen([wasdir+"/bin/stopServer.sh " + name + " -profileName " + name + " -username " + username + " -password " + password], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + if not stderr_value.find("appears to be stopped") < 0: + module.fail_json(msg=name + " stop failed", stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg=name + " stopped successfully", stdout=stdout_value) + + # Start server + if state == 'started': + child = subprocess.Popen([wasdir+"/bin/startServer.sh " + name + " -profileName " + name + " -username " + username + " -password " + password], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + module.fail_json(msg=name + " start failed", stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg=name + " started successfully", stdout=stdout_value) + + +# import module snippets +from ansible.module_utils.basic import * +if __name__ == '__main__': + main() diff --git a/library/wsadmin.py b/library/wsadmin.py new file mode 100644 index 0000000..ea33b10 --- /dev/null +++ b/library/wsadmin.py @@ -0,0 +1,54 @@ +#!/usr/bin/python + +# Run a wsadmin script. +# +# DO NOT USE THIS MODULE. UNDER DEVELOPMENT +# +# wsadmin.sh -lang jython +# -conntype SOAP +# -host +# -port +# -username +# -password +# -f ... + +import os +import subprocess +import platform +import datetime + +def main(): + + # Read arguments + module = AnsibleModule( + argument_spec = dict( + params = dict(required=True), + host = dict(default='localhost', required=False), + port = dict(default='8879', required=False), + username = dict(required=False), + password = dict(required=False), + script = dict(required=True) + ) + ) + + params = module.params['params'] + host = module.params['host'] + port = module.params['port'] + username = module.params['username'] + password = module.params['password'] + script = module.params['script'] + + # Run wsadmin command server + if state == 'stopped': + child = subprocess.Popen([wasdir+"/bin/wsadmin.sh -lang jython -conntype SOAP -host "+host+" -port "+port+" -username " + username + " -password " + password " -f "+script+" "+params], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout_value, stderr_value = child.communicate() + if child.returncode != 0: + module.fail_json(msg="Failed executing wsadmin script: " + ¨script, stdout=stdout_value, stderr=stderr_value) + + module.exit_json(changed=True, msg="Script executed successfully: " + scrpit, stdout=stdout_value) + + +# import module snippets +from ansible.module_utils.basic import * +if __name__ == '__main__': + main() From 9501d6754d88b7192c55480c469585a156a87dcf Mon Sep 17 00:00:00 2001 From: Amir Mofasser Date: Thu, 5 Nov 2015 08:53:52 +0100 Subject: [PATCH 2/4] Initial Commit - 2 --- library/ibmim.py | 0 library/ibmwas.py | 0 library/liberty_server.py | 0 library/profile_dmgr.py | 0 library/profile_liberty.py | 0 library/profile_nodeagent.py | 0 library/server.py | 0 library/wsadmin.py | 0 8 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 library/ibmim.py mode change 100644 => 100755 library/ibmwas.py mode change 100644 => 100755 library/liberty_server.py mode change 100644 => 100755 library/profile_dmgr.py mode change 100644 => 100755 library/profile_liberty.py mode change 100644 => 100755 library/profile_nodeagent.py mode change 100644 => 100755 library/server.py mode change 100644 => 100755 library/wsadmin.py diff --git a/library/ibmim.py b/library/ibmim.py old mode 100644 new mode 100755 diff --git a/library/ibmwas.py b/library/ibmwas.py old mode 100644 new mode 100755 diff --git a/library/liberty_server.py b/library/liberty_server.py old mode 100644 new mode 100755 diff --git a/library/profile_dmgr.py b/library/profile_dmgr.py old mode 100644 new mode 100755 diff --git a/library/profile_liberty.py b/library/profile_liberty.py old mode 100644 new mode 100755 diff --git a/library/profile_nodeagent.py b/library/profile_nodeagent.py old mode 100644 new mode 100755 diff --git a/library/server.py b/library/server.py old mode 100644 new mode 100755 diff --git a/library/wsadmin.py b/library/wsadmin.py old mode 100644 new mode 100755 From 164ecd1fb2333fa04a410245939e0e2fb0dffb51 Mon Sep 17 00:00:00 2001 From: Amir Mofasser Date: Thu, 5 Nov 2015 08:57:39 +0100 Subject: [PATCH 3/4] N/A --- library/ibmim.py | 0 library/ibmwas.py | 0 library/liberty_server.py | 0 library/profile_dmgr.py | 0 library/profile_liberty.py | 0 library/profile_nodeagent.py | 0 library/server.py | 0 library/wsadmin.py | 0 8 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 library/ibmim.py mode change 100755 => 100644 library/ibmwas.py mode change 100755 => 100644 library/liberty_server.py mode change 100755 => 100644 library/profile_dmgr.py mode change 100755 => 100644 library/profile_liberty.py mode change 100755 => 100644 library/profile_nodeagent.py mode change 100755 => 100644 library/server.py mode change 100755 => 100644 library/wsadmin.py diff --git a/library/ibmim.py b/library/ibmim.py old mode 100755 new mode 100644 diff --git a/library/ibmwas.py b/library/ibmwas.py old mode 100755 new mode 100644 diff --git a/library/liberty_server.py b/library/liberty_server.py old mode 100755 new mode 100644 diff --git a/library/profile_dmgr.py b/library/profile_dmgr.py old mode 100755 new mode 100644 diff --git a/library/profile_liberty.py b/library/profile_liberty.py old mode 100755 new mode 100644 diff --git a/library/profile_nodeagent.py b/library/profile_nodeagent.py old mode 100755 new mode 100644 diff --git a/library/server.py b/library/server.py old mode 100755 new mode 100644 diff --git a/library/wsadmin.py b/library/wsadmin.py old mode 100755 new mode 100644 From 8a67096dec17131d0d5b29f8643e2a15d8a0c97f Mon Sep 17 00:00:00 2001 From: Amir Mofasser Date: Thu, 5 Nov 2015 10:50:20 +0100 Subject: [PATCH 4/4] Updated readme for release v.1.0.0 --- README.md | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b0db4c..23accd1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,115 @@ -# ansible-websphere -Ansible modules for WebSphere Application Server +# README + +## ibmim.py +This module installs or uninstalls IBM Installation Manager. +#### Options +| Parameter | Required | Default | Choices | Comments | +|:---------|:--------|:---------|:---------|:---------| +| state | true | N/A | present, abcent | present=install, abcent=uninstall | +| src | true | N/A | N/A | Path to installation files for Installation Manager | +| dest | false | N/A | /opt/IBM/InstallationManager | Path to desired installation directory of Installation Manager | +| logdir | false | N/A | N/A | Path and file name of installation log file | +``` +# Example: +# Install: +ibmim: state=present src=/some/dir/install/ logdir=/tmp/im_install.log +# Uninstall +ibmim: state=abcent dest=/opt/IBM/InstallationManager +``` + +## ibmwas.py +This module installs or uninstalls IBM WebSphere products using Installation Manager. +#### Options +| Parameter | Required | Default | Choices | Comments | +|:---------|:--------|:---------|:---------|:---------| +| state | true | present | present, abcent | present=install,abcent=uninstall | +| ibmim | true | N/A | N/A | Path to installation directory of Installation Manager | +| dest | true | N/A | N/A | Path to destination installation directory | +| im_shared | true | N/A | N/A | Path to Installation Manager shared resources folder | +| repo | true | N/A | N/A | URL or path to the installation repository used by Installation Manager to install WebSphere products | +| offering | true | com.ibm.websphere.ND.v85 | N/A | Name of the offering which you want to install | + +``` +# Example: +# Install: +ibmwas: state=present ibmim=/opt/IBM/InstallationManager/ dest=/usr/local/WebSphere/AppServer im_shared=/usr/local/WebSphere/IMShared repo=http://example.com/was-repo/ offering=com.ibm.websphere.ND.v85 +# Uninstall: +ibmwas: state=abcent ibmim=/opt/IBM/InstallationManager dest=/usr/local/WebSphere/AppServer/ +``` + +## liberty_server.py +This module start os stops a Liberty Profile server +#### Options +| Parameter | Required | Default | Choices | Comments | +|:---------|:--------|:---------|:---------|:---------| +| state | true | started | started, stopped | N/A | +| name | true | N/A | N/A | Name of the app server | +| libertydir | true | N/A | N/A | Path to binary files of the application server | +``` +# Example: +# Start: +liberty_server: state=started libertydir=/usr/local/WebSphere/Liberty/ name=my-server-01 +# Stop: +liberty_server: state=stopped libertydir=/usr/local/WebSphere/Liberty/ name=my-server-01 +``` + +## profile_dmgr.py +This module creates or removes a WebSphere Application Server Deployment Manager profile. Requires a Network Deployment installation. +#### Options +| Parameter | Required | Default | Choices | Comments | +|:---------|:--------|:---------|:---------|:---------| +| state | true | present | present,abcent | present=create,abcent=remove | +| wasdir | true | N/A | N/A | Path to installation location of WAS | +| name | true | N/A | N/A | Name of the profile | +| cell_name | true | N/A | N/A | Name of the cell | +| host_name | true | N/A | N/A | Host Name | +| node_name | true | N/A | N/A | Node name of this profile | +| username | true | N/A | N/A | Administrative user name | +| password | true | N/A | N/A | Administrative user password | +``` +# Example: +# Create: +profile_dmgr: state=present wasdir=/usr/local/WebSphere/AppServer/ name=dmgr cell_name=devCell host_name=localhost node_name=devcell-dmgr username=admin password=allyourbasearebelongtous +# Remove: +profile_dmgr: state=abcent wasdir=/usr/local/WebSphere/AppServer/ name=dmgr +``` + +## profile_liberty.py +This module creates or removes a Liberty Profile server runtime +#### Options +| Parameter | Required | Default | Choices | Comments | +|:---------|:--------|:---------|:---------|:---------| +| state | true | present | present,abcent | present=create,abcent=remove | +| libertydir | true | N/A | N/A | Path to install location of Liberty Profile binaries | +| name | true | N/A | N/A | Name of the server which is to be created/removed | +``` +# Example: +# Create: +profile_liberty: state=present libertydir=/usr/local/WebSphere/Liberty/ name=server01 +# Remove +profile_liberty: state=abcent libertydir=/usr/local/WebSphere/Liberty/ name=server01 +``` + +## profile_nodeagent.py +This module creates or removes a WebSphere Application Server Node Agent profile. Requires a Network Deployment installation. +#### Options +| Parameter | Required | Default | Choices | Comments | +|:---------|:--------|:---------|:---------|:---------| +| state | true | present | present,abcent | present=create,abcent=remove | +| wasdir | true | N/A | N/A | Path to installation location of WAS | +| name | true | N/A | N/A | Name of the profile | +| cell_name | true | N/A | N/A | Name of the cell | +| host_name | true | N/A | N/A | Host Name | +| node_name | true | N/A | N/A | Node name of this profile | +| username | true | N/A | N/A | Administrative user name of the deployment manager | +| password | true | N/A | N/A | Administrative user password of the deployment manager | +| dmgr_host | true | N/A | N/A | Host name of the Deployment Manager | +| dmgr_port | true | N/A | N/A | SOAP port number of the Deployment Manager | +| federate | false | N/A | N/A | Wether the node should be federated to a cell. If true, cell name cannot be the same as the cell name of the deployment manager. | +``` +# Example: +# Create +profile_nodeagent: state=present wasdir=/usr/local/WebSphere/AppServer/ name=nodeagent cell_name=devCellTmp host_name=localhost node_name=devcell-node1 username=admin password=allyourbasearebelongtous dmgr_host=localhost dmgr_port=8879 federate=true +# Remove: +profile_dmgr: state=abcent wasdir=/usr/local/WebSphere/AppServer/ name=nodeagent +```