Merge lp:~salmavar/charms/trusty/ibm-im/ibm-im-branch into lp:~ibmcharmers/charms/trusty/ibm-im/devel

Proposed by Shruthima
Status: Merged
Merged at revision: 2
Proposed branch: lp:~salmavar/charms/trusty/ibm-im/ibm-im-branch
Merge into: lp:~ibmcharmers/charms/trusty/ibm-im/devel
Diff against target: 719 lines (+327/-321)
4 files modified
README.md (+211/-175)
copyright (+1/-1)
files/sftp_get.sh (+0/-20)
reactive/ibm-im.sh (+115/-125)
To merge this branch: bzr merge lp:~salmavar/charms/trusty/ibm-im/ibm-im-branch
Reviewer Review Type Date Requested Status
Venkatesh Pending
Review via email: mp+292629@code.launchpad.net
To post a comment you must log in.
2. By Shruthima

Modified README and reactive files

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.md'
2--- README.md 2016-04-22 11:21:50 +0000
3+++ README.md 2016-04-27 12:12:01 +0000
4@@ -1,175 +1,211 @@
5-## Charm for IBM Installation Manager(IM) 1.8
6-
7-### Overview
8-
9-IBM Installation Manager
10-
11-IBM® Installation Manager is a single installation program that uses remote or local software repositories to install, modify, or update certain IBM products.
12-
13-User guides and security guides to support this release are available for
14-Online viewing [User Guide](http://www.ibm.com/support/knowledgecenter/SSDV2W/im_family_welcome.html)
15-
16-
17-### Download of Product Binaries
18-
19-Download your licensed IBM IM 1.8 software for Ubuntu.
20-
21-You can download product binaries from
22-[Product Page](http://www-01.ibm.com/support/docview.wss?uid=swg27025142)
23-
24-
25-### Usage
26-Download your licensed IBM Installation Manager software and host it.
27-
28-Curl-url and Curl-opts are two main options we are using from ibm-base-layer to download the ibm product as IBM-IM is built on top of the IBM-Base-Layer [More Info](http://interfaces.juju.solutions/layer/ibm-base/)
29-
30-To download and install the code contained in this charm you must agree to the IBM license.
31-
32-You can view the full license for `IBM Installation Manager`by visiting the [license-info](http://www-03.ibm.com/software/sla/sladb.nsf/displaylis/39AFC1C1D485C4E085257E7300548B05?OpenDocument).
33-
34-Search for "IBM Installation Manager" and choose the license that applies to the version you are using.
35-
36-##### For (x86_64) Ubuntu , The packages are:
37-
38-IBM Installation Manager 1.8 (agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip)
39-
40-##### For Power (ppcle) Ubuntu, The packages are:
41-
42-IBM Installation Manager 1.8(agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip)
43-
44-Creating Repositories
45---------------------
46-For deploying IBM IM charm the user needs to download the correct packages as mentioned in the 'Usage' section above and host it so that the IBM IM charm can connect to the host server and deploy the same. The host server can be any Ubuntu machine and the package needs to be kept in the path like `/home/charm/repository/<productname>`. The path where the package is kept is a configurable item and needs to be set before deploying the charm.
47-
48-
49-### Deploy
50-
51-1.Run the following commands to deploy this charm:
52-
53- juju deploy ibm-im
54-2.At this point the charm will wait until the user accepts the license. If you agree to the license, run the following command.
55-
56- juju set ibm-im license_accepted="True"
57-
58-
59-3.IBM IM charm also needs an host from where the packages can be downloaded (the user has to keep the Installation Manager packages on this host server),from the directory where the package is kept, user name and password to connect to the host server.
60-
61-We have to provide values for curl-url and curl-opt to download the product.
62-
63-curl-url with hostname,package_dir,package name,checksum value, curl-opts with username and password,to proceed with the installation.
64- To provide these run the following command:
65-
66- juju set ibm-im curl_url="<hostname><package_dir><package_name>?<sha512=value>"
67- juju set ibm-im curl_opts="-u <username>:<password>"
68-
69-For eg:
70-
71- juju set ibm-im curl_url="http://1.2.3.4/debs/agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip?sha512=d58483957f56c20492f174b5a112b93a35cb7e45d5009c5c5fc4a3d34f91d2fcbefff770cad578287056ca1af01cacd700eb349937530e6f44780075f7dbaaab"
72- juju set ibm-im curl_opts="-u root:root123"
73-
74-
75-
76- The command to find the sha512 value is
77-
78- sha512sum <IM Package Name>
79-
80-
81-4.Setting the license-accepted to False will uninstall the product:
82-
83- juju set ibm-im license_accepted="False"
84-
85-**Note** : If user wants to install any other packages other then the packages mentioned in usage section, user need to download IBM-IM zip file to local trusty folder and edit the layer.yaml i.e provide the default package name under ibm-im-package option.
86-
87-Next user need to deploy locally with the command
88-
89- juju deploy --repository=/home/charm1/charms/ local:trusty/ibm-im
90-
91-Next he need to follow the below deploy section from step 2
92-### Upgrade of ibm-im
93-Once deployed and if the user wants to upgrade the newer version, setting the ibm-im-fp-package will upgrade the product.
94-
95- juju set ibm-im ibm_im_fp_package="<fix pack-name>"
96-
97-For eg:
98-
99- juju set ibm-im ibm_im_fp_package="agent.installer.linux.gtk.x86_64_1.8.4001.20160217_1716.zip"
100-
101-**Note** Before setting the ibm-im-fp-package value user must host the package and provide curl-url and curl-opt options for Downloading fix pack package.
102-
103- For eg:
104-
105- juju set ibm-im curl_url="http://1.2.3.4/debs/agent.installer.linux.gtk.x86_64_1.8.4001.20160217_1716.zip?sha512=0a2e72e40530c2fe39edf76c45ea068a296d1670f8e4e75111c8efeede8e845087b4d5b850f5a570ffb0d5422b5f4b24121812ca754739989a9b160261d40d15"
106- juju set ibm-im curl_opts="-u root:root123"
107-
108-
109-
110-### Installation Verification
111-
112-Once deployed, you can use IBM IM to install any IBM products. To verify IM is installed or not
113-get into the container and check whether the below path is exist.
114-
115- opt/IBM/InstallationManager
116-
117-To get into the container run the below commmand.
118-
119- juju ssh <machine-id where IBM IM is installed>
120-
121-
122-### Uninstallation of ibm-im
123-
124-Setting the license-accepted to False will uninstall the product.
125-
126- juju set ibm-im license_accepted=False
127-
128-
129-### Configuration
130-
131-- **license_accepted** Before you can use or install IBM IM,
132- you must accept the terms of International License
133- Agreement for Non-Warranted Programs and additional license information.
134- Please read the license agreement carefully
135- [IBM IM License](http://www-03.ibm.com/software/sla/sladb.nsf/displaylis/39AFC1C1D485C4E085257E7300548B05?OpenDocument). Set the value of license-accepted to True if you agree to IBM IM license.
136-
137-**The IBM IM software cannot be installed until the terms and
138-conditions are accepted. The charm will not function correctly until the configuration option is set to True.**
139-
140-- **curl_url** For downloading package we need to set curl_url with following options.
141-
142- - *hostname* - The web server host name from which IBM IM installation packages can be downloaded.
143- - *package_dir* - The package directory path in the web server.
144- - *package name* - The IBM IM Package name.
145- - *checksum value* - Checksum value to check integrity of IBM IM package. The Charm
146- uses sha512sum to check the integrity. If empty, it does not carry out the
147- integrity check. Use `sha512sum <Package Location/Package Name>`
148- to find out Checksum value for downloaded package.
149-
150-- **curl_opts** We need to set curl_opts with following options.
151- - *username* - User name of the webserver host.
152- - *password* - Password of the webserver host.
153-
154-- **ibm-im-fp-package** The IBM IM Fix pack Package name. These must be provided when user wants to upgrade the charm.
155-
156-
157-
158-
159-### IBM IM Information
160-
161-### General Information
162-
163-Details about IBM IM available [Here](http://www.ibm.com/support/knowledgecenter/SSDV2W/im_family_welcome.html)
164-
165-### Download Information
166-
167-Information on procuring IBM IM product is available at the [Product Page](http://www-01.ibm.com/support/docview.wss?uid=swg27025142)
168-
169-### License Information
170-
171-License information for IBM IM can be viewed [Here](http://www-03.ibm.com/software/sla/sladb.nsf/searchlis/?searchview&searchorder=4&searchmax=0&query=%28Installation+Manager+1.8.3%29)
172-
173-### Known Limitations
174-
175-This charm makes use of Juju Status commands, and requires juju 1.24 or greater
176-
177-### Contact Information
178-
179-For issues with this charm, please contact [IBM Juju Support Team](mailto:jujusupp@us.ibm.com)
180\ No newline at end of file
181+## Charm for IBM Installation Manager(IM) 1.8
182+
183+### Overview
184+
185+IBM Installation Manager
186+
187+IBM® Installation Manager is a single installation program that uses remote or local software repositories to install, modify, or update certain IBM products.
188+
189+User guides and security guides to support this release are available for
190+online viewing [User Guide](http://www.ibm.com/support/knowledgecenter/SSDV2W/im_family_welcome.html)
191+
192+
193+### Download of Product Binaries
194+
195+Download your licensed IBM IM 1.8 software for Ubuntu.
196+
197+You can download product binaries from
198+[Product Page](http://www-01.ibm.com/support/docview.wss?uid=swg27025142)
199+
200+
201+### Usage
202+Download your licensed IBM Installation Manager software and host it in a way that can be downloaded using curl.
203+
204+Curl-url and Curl-opts are two main options we are using from ibm-base-layer to download the ibm product as IBM-IM is built on top of the ibm-base layer [More Info](http://interfaces.juju.solutions/layer/ibm-base/)
205+
206+To download and install the code contained in this charm you must agree to the IBM license.
207+
208+You can view the full license for `IBM Installation Manager`by visiting the [license-info](http://www-03.ibm.com/software/sla/sladb.nsf/displaylis/39AFC1C1D485C4E085257E7300548B05?OpenDocument).
209+
210+Search for "IBM Installation Manager" and choose the license that applies to the version you are using.
211+
212+##### For (x86_64) Ubuntu , The packages are:
213+
214+IBM Installation Manager 1.8 (agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip)
215+
216+##### For Power (ppcle) Ubuntu, The packages are:
217+
218+IBM Installation Manager 1.8(agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip)
219+
220+Creating Repositories
221+--------------------
222+For deploying IBM IM charm the user needs to download the correct packages as mentioned in the 'Usage' section above and host it in a way which can be downloaded using curl.
223+
224+For eg:
225+
226+The packages should be hosted such that it can be downloaded using curl. For e.g using python simple HTTP Server as follows,If the user downloads the IM package agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip in /home/Downloads then the below commands will start a simple HTTP Server and host the packages in the /home/Downloads folder
227+
228+ cd /home/Downloads
229+ python -m SimpleHTTPServer
230+
231+And the curl-url would be
232+
233+ http://localhost:8000/package/agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip?md5=<md5 of agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip>
234+
235+### Deploy
236+
237+1.Run the following commands to deploy this charm:
238+
239+ juju deploy ibm-im
240+
241+2.Here the charm will wait until the user accepts the license. If you agree to the license, run the following command.
242+
243+ juju set ibm-im license_accepted="True"
244+
245+
246+3.IBM IM charm also needs an host from where the packages can be downloaded (the user has to keep the Installation Manager packages on this host server),from the directory where the package is kept, user name and password to connect to the host server(as mentioned in the creating repositories section).
247+
248+We have to provide values for curl-url and curl-opt to download the product.
249+
250+curl-url with host name,package_dir,package name,checksum value, curl-opts with user name and password,to proceed with the installation.
251+ To provide these run the following command:
252+
253+ juju set ibm-im curl_url="<hostname>/<package_dir><package_name>?<sha512=value>"
254+ juju set ibm-im curl_opts="-u <username>:<password>"
255+
256+For eg:
257+
258+ juju set ibm-im curl_url="http://1.2.3.4/debs/agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip?sha512=d58483957f56c20492f174b5a112b93a35cb7e45d5009c5c5fc4a3d34f91d2fcbefff770cad578287056ca1af01cacd700eb349937530e6f44780075f7dbaaab"
259+ juju set ibm-im curl_opts="-u root:root123"
260+
261+
262+
263+ The command to find the sha512 value is
264+
265+ sha512sum <IM Package Name>
266+
267+For eg:
268+
269+ sha512sum agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip
270+
271+
272+4.Setting the license-accepted to False will uninstall the product:
273+
274+ juju set ibm-im license_accepted="False"
275+
276+**Note** : If user wants to install any other packages other then the packages mentioned in usage section, user needs to download IBM-IM charm folder from charm store to local machine and edit the layer.yaml i.e provide the default package name under ibm-im-package option.
277+
278+Next user needs to deploy locally with the command
279+
280+ juju deploy --repository=<path_to_charms_folder> local:trusty/ibm-im
281+
282+Next he need to follow the below deploy section from step 2
283+### Upgrade of ibm-im
284+Once deployed and if the user wants to upgrade to the newer version, setting the ibm-im-fp-package will upgrade the product.
285+
286+ juju set ibm-im ibm_im_fp_package="<fix pack-name>"
287+
288+For eg:
289+
290+ juju set ibm-im ibm_im_fp_package="agent.installer.linux.gtk.x86_64_1.8.4001.20160217_1716.zip"
291+
292+**Note** Before setting the ibm-im-fp-package value user must host the package and provide curl-url and curl-opt options for Downloading fix pack package.
293+
294+ For eg:
295+
296+ juju set ibm-im curl_url="http://1.2.3.4/debs/agent.installer.linux.gtk.x86_64_1.8.4001.20160217_1716.zip?sha512=0a2e72e40530c2fe39edf76c45ea068a296d1670f8e4e75111c8efeede8e845087b4d5b850f5a570ffb0d5422b5f4b24121812ca754739989a9b160261d40d15"
297+ juju set ibm-im curl_opts="-u root:root123"
298+
299+
300+
301+### Installation Verification
302+
303+Once deployed, you can use IBM IM to install any IBM products. To verify IM is installed or not
304+get into the container and check whether the below path is exist.
305+
306+ /opt/IBM/InstallationManager
307+
308+To get into the container run the below command.
309+
310+ juju ssh <machine-id where IBM IM is installed>
311+
312+
313+### Uninstallation of ibm-im
314+
315+Setting the license-accepted to False will uninstall the product.
316+
317+ juju set ibm-im license_accepted=False
318+
319+
320+### Configuration
321+
322+- **license_accepted** Before you can use or install IBM IM,
323+ you must accept the terms of International License
324+ Agreement for Non-Warranted Programs and additional license information.
325+ Please read the license agreement carefully
326+ [IBM IM License](http://www-03.ibm.com/software/sla/sladb.nsf/displaylis/39AFC1C1D485C4E085257E7300548B05?OpenDocument). Set the value of license-accepted to True if you agree to IBM IM license.
327+
328+**The IBM IM software cannot be installed until the terms and
329+conditions are accepted. The charm will not function correctly until the configuration option is set to True.**
330+
331+- **curl_url** For downloading package we need to set curl_url with following options.
332+
333+ - *hostname* - The web server host name from which IBM IM installation packages can be downloaded.
334+ - *package_dir* - The package directory path in the web server.
335+ - *package name* - The IBM IM Package name.
336+ - *checksum value* - Checksum value to check integrity of IBM IM package. The Charm
337+ uses sha512sum to check the integrity. If empty, it does not carry out the
338+ integrity check. Use `sha512sum <Package Location/Package Name>`
339+ to find out Checksum value for downloaded package.
340+
341+- **curl_opts** We need to set curl_opts with following options.
342+ - *username* - User name of the webserver host.
343+ - *password* - Password of the webserver host.
344+
345+- **ibm-im-fp-package** The IBM IM Fix pack Package name. These must be provided when user wants to upgrade the charm.
346+
347+
348+
349+
350+### IBM IM Information
351+
352+### General Information
353+
354+Details about IBM IM available [Here](http://www.ibm.com/support/knowledgecenter/SSDV2W/im_family_welcome.html)
355+
356+### Download Information
357+
358+Information on procuring IBM IM product is available at the [Product Page](http://www-01.ibm.com/support/docview.wss?uid=swg27025142)
359+
360+### License Information
361+
362+License information for IBM IM can be viewed [Here](http://www-03.ibm.com/software/sla/sladb.nsf/searchlis/?searchview&searchorder=4&searchmax=0&query=%28Installation+Manager+1.8.3%29)
363+
364+### Known Limitations
365+
366+This charm makes use of juju status commands, and requires juju 1.24 or greater
367+
368+### Contact Information
369+
370+For issues with this charm, please contact [IBM Juju Support Team](mailto:jujusupp@us.ibm.com)
371+### Additional Information
372+This layer is intended to be extended by other charms that would benefit from having IBM Installation Manager (IBM IM) preinstalled. For example, a WebSphere layered charm could include this layer so it could use IBM IM to install WebSphere.
373+
374+To use this layer, include the following in your `layer.yaml`:
375+
376+```yaml
377+includes: ['layer:ibm-installation-manager']
378+```
379+
380+Then, in your charm, watch for the `im.installed` state, at which point you will know the IBM IM tools are available:
381+
382+```bash
383+IM_PATH=/opt/IBM/InstallationManager
384+
385+@when 'im.installed'
386+install_was() {
387+ WAS_REPO=`config-get was_repo`
388+ ${IM_PATH}/tools/imutilsc saveCredential -url $WAS_REPO -userName $IBM_ID_NAME -userPassword $IBM_ID_PASS -secureStorageFile "secure.store"
389+ ${IM_PATH}/installc -input silent-install.xml -acceptlicense -secureStorageFile "secure.store"
390+ ${IM_PATH}/imcl install $IM_ARGS
391+}
392
393=== modified file 'copyright'
394--- copyright 2016-04-22 11:21:50 +0000
395+++ copyright 2016-04-27 12:12:01 +0000
396@@ -1,4 +1,4 @@
397-Copyright 2015 IBM Corporation
398+Copyright 2016 IBM Corporation
399
400 This Charm is licensed under the Apache License, Version 2.0 (the "License");
401 you may not use this file except in compliance with the License.
402
403=== removed file 'files/sftp_get.sh'
404--- files/sftp_get.sh 2016-04-22 11:21:50 +0000
405+++ files/sftp_get.sh 1970-01-01 00:00:00 +0000
406@@ -1,20 +0,0 @@
407-#!/usr/bin/expect
408-# Helper script to connect and download using sftp
409-# Invoked from download action
410-# Usage: sftp_get.sh user password host remote_dir localpath
411-
412-set user [lindex $argv 0]
413-set password [lindex $argv 1]
414-set host [lindex $argv 2]
415-set r_dir [lindex $argv 3]
416-set localpath [lindex $argv 4]
417-
418-set timeout 90
419-spawn sftp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $user@$host
420-expect "password:"
421-send "$password\n"
422-expect "sftp>"
423-set timeout 3000
424-send "get -r $r_dir $localpath\n"
425-expect "sftp>"
426-send "exit\n"
427
428=== modified file 'reactive/ibm-im.sh'
429--- reactive/ibm-im.sh 2016-04-22 11:21:50 +0000
430+++ reactive/ibm-im.sh 2016-04-27 12:12:01 +0000
431@@ -3,109 +3,96 @@
432
433 source charms.reactive.sh
434 ARCHIVE_DIR=files/archives
435-
436-# Fail if we're not on a supported arch. Also set defaults for filename
437-# and sha1sum based on arch.
438 ARCHITECTURE=`uname -m`
439-DEFAULT_INSTALLER_FILE_IM=""
440-if [ "$ARCHITECTURE" = "x86_64" ]; then
441- DEFAULT_INSTALLER_FILE_IM="agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip"
442-elif [ "$ARCHITECTURE" = "ppc64le" ]; then
443- DEFAULT_INSTALLER_FILE_IM="agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip"
444-else
445- status-set blocked "IBM IM: Platform not supported"
446-fi
447-
448-# Get the package name from layer.yaml to check whether the user wants to install a different package
449- im_file_name="$(layer_option ibm-im ibm_im_package)"
450- cfg_im_pkg_name=$im_file_name
451-
452- # Set package name to a predefined value if the user has not provided a package name
453- if [ "$cfg_im_pkg_name" == "" ]; then
454- cfg_im_pkg_name=${DEFAULT_INSTALLER_FILE_IM}
455- fi
456-
457-cfg_im_pkg_name=${DEFAULT_INSTALLER_FILE_IM}
458
459 # Installation Manager install path
460 IM_INSTALL_PATH="/opt/IBM/InstallationManager"
461
462-# Check whether IM is installed
463-is_im_installed()
464-{
465- if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then
466- echo "True"
467- else
468- echo "False"
469- fi
470-
471-}
472-
473-#Remove IM, if installed
474-remove_im_software()
475-{
476- im_installed=`is_im_installed`
477- if [ $im_installed == True ]; then
478- juju-log "IBM IM: Removing IBM IM software."
479- /root/var/ibm/InstallationManager/uninstall/uninstallc
480- juju-log "IBM IM: Removed IBM IM software"
481- fi
482-
483-}
484
485 @when 'ibm-base.license.accepted' 'ibm-base.curl.resource.fetched'
486 @when_not 'ibm-im.installed'
487 function install(){
488-# Do the actual IBM IM install
489-im_inst=`is_im_installed`
490- if [ $im_inst == False ]; then
491- if [ -f $CHARM_DIR/$ARCHIVE_DIR/$cfg_im_pkg_name ]; then
492- juju-log "IBM IM: downloading and extracting IM packages"
493- if [ -f $CHARM_DIR/$ARCHIVE_DIR/userinstc ]; then
494- juju-log "IBM IM: IBM IM package contents extracted already."
495- else
496- cd $CHARM_DIR/$ARCHIVE_DIR
497-
498+# Get the package name to check whether the user wants to install a different package
499+ im_file_name="$(layer_option ibm-im ibm_im_package)"
500+ cfg_im_pkg_name=$im_file_name
501+
502+ #Check whether user has selected right package name from the package name string. If he selects wrong package name , install would fail.
503+ # Set package name to a predefined value if user have not set the layer option
504+ if [ "$cfg_im_pkg_name" == "" ]; then
505+ if [ "$ARCHITECTURE" = "x86_64" ]; then
506+ DEFAULT_INSTALLER_FILE_IM="agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip"
507+ elif [ "$ARCHITECTURE" = "ppc64le" ]; then
508+ DEFAULT_INSTALLER_FILE_IM="agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip"
509+ else
510+ status-set blocked "IBM IM: Platform not supported"
511+ fi
512+ cfg_im_pkg_name=${DEFAULT_INSTALLER_FILE_IM}
513+ else
514+ if [ "$ARCHITECTURE" = "x86_64" ]; then
515+ juju-log "Checking the package name"
516+ if echo "$cfg_im_pkg_name" | grep -q "x86"; then
517+ juju-log "IBM IM: Package name is matching for the platform"
518+ else
519+ juju-log "IBM IM: Probably Not the right package. IM install will fail if its not the right package"
520+ status-set blocked "Probably Not the right package. Please configure the correct package name"
521+ exit 0
522+ fi
523+ else
524+ if echo "$cfg_im_pkg_name" | grep -q "ppcle"; then
525+ juju-log "IBM IM: Package name is matching for the platform"
526+ else
527+ juju-log "IBM IM: Probably Not the right package. IM install will fail if its not the right package"
528+ status-set blocked "Probably Not the right package. Please configure the correct package name"
529+ exit 0
530+ fi
531+ fi
532+ fi
533+
534+ # Do the actual IBM IM install
535+ if [ -f $CHARM_DIR/$ARCHIVE_DIR/$cfg_im_pkg_name ]; then
536+ juju-log "IBM IM: downloading and extracting IM packages"
537+ if [ -f $CHARM_DIR/$ARCHIVE_DIR/userinstc ]; then
538+ juju-log "IBM IM: IBM IM package contents extracted already."
539+ else
540+ cd $CHARM_DIR/$ARCHIVE_DIR
541+
542 juju-log "im_pkg_name===="$cfg_im_pkg_name
543 if ! unzip $cfg_im_pkg_name -d $CHARM_DIR/$ARCHIVE_DIR
544- then
545- juju-log "IBM IM: Unable to extract the IM package content. Verify whether the package is corrupt."
546- # Remove corrupt archive file
547- status-set blocked "IBM Installation Manager package is corrupt"
548- rm -f $CHARM_DIR/$ARCHIVE_DIR/$im_pkg_name
549- exit 0
550- else
551- juju-log "IBM IM: Installation Manager extracted successfully."
552- fi
553- fi
554- fi
555- juju-log "IBM IM: IM installation start"
556- # Check IM package availability
557- juju-log $CHARM_DIR/$ARCHIVE_DIR
558- if [ -f $CHARM_DIR/$ARCHIVE_DIR/userinstc ];
559- then
560+ then
561+ juju-log "IBM IM: Unable to extract the IM package content. Verify whether the package is corrupt."
562+ # Remove corrupt archive file
563+ status-set blocked "IBM Installation Manager package is corrupt"
564+ rm -f $CHARM_DIR/$ARCHIVE_DIR/$im_pkg_name
565+ exit 0
566+ else
567+ juju-log "IBM IM: Installation Manager extracted successfully."
568+ fi
569+ fi
570+ fi
571+ juju-log "IBM IM: IM installation start"
572+ # Check IM package availability
573+ juju-log $CHARM_DIR/$ARCHIVE_DIR
574+ if [ -f $CHARM_DIR/$ARCHIVE_DIR/userinstc ];
575+ then
576
577- juju-log "IBM IM: IM Packages available for installation."
578- cp $CHARM_DIR/$ARCHIVE_DIR/install.xml $CHARM_DIR/$ARCHIVE_DIR/silent_install.xml
579- sed -i "2 a \<profile kind='self' installLocation='$IM_INSTALL_PATH' id='IBM Installation Manager'>\n <data key='eclipseLocation' value='$IM_INSTALL_PATH' />\n</profile>" $CHARM_DIR/$ARCHIVE_DIR/silent_install.xml
580- if $CHARM_DIR/$ARCHIVE_DIR/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/silent_install.xml -acceptlicense
581- then
582- set_state 'ibm-im.installed'
583+ juju-log "IBM IM: IM Packages available for installation."
584+ cp $CHARM_DIR/$ARCHIVE_DIR/install.xml $CHARM_DIR/$ARCHIVE_DIR/silent_install.xml
585+ sed -i "2 a \<profile kind='self' installLocation='$IM_INSTALL_PATH' id='IBM Installation Manager'>\n <data key='eclipseLocation' value='$IM_INSTALL_PATH' />\n</profile>" $CHARM_DIR/$ARCHIVE_DIR/silent_install.xml
586+ if $CHARM_DIR/$ARCHIVE_DIR/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/silent_install.xml -acceptlicense
587+ then
588+ set_state 'ibm-im.installed'
589
590- status-set active "IBM IM: IM Is installed successfully"
591- else
592- juju-log "IBM IM: Error while installing IM"
593- exit 1
594- fi
595+ status-set active "IBM IM: IM Is installed successfully"
596+ else
597+ juju-log "IBM IM: Error while installing IM"
598+ exit 1
599+ fi
600
601- else
602- juju-log "IBM IM: IM Packages missing. Please check README file"
603- status-set maintenance "IBM IM install failed"
604- exit 1
605- fi
606- else
607- juju-log "IBM IM: IBM IM Installed already using same package name."
608- fi
609+ else
610+ juju-log "IBM IM: IM Packages missing. Please check README file"
611+ status-set maintenance "IBM IM install failed"
612+ exit 1
613+ fi
614 }
615
616
617@@ -114,63 +101,66 @@
618 function install-ibm-im-fixpack(){
619 ibm_im_fp_package=`config-get ibm_im_fp_package`
620
621-if [ -f $CHARM_DIR/$ARCHIVE_DIR/$ibm_im_fp_package ]; then
622+ if [ -f $CHARM_DIR/$ARCHIVE_DIR/$ibm_im_fp_package ]; then
623 juju-log "IBM-IM: ibm_im_fp_package is available"
624 if [ -f $CHARM_DIR/$ARCHIVE_DIR/FP/userinstc ]; then
625- juju-log "IBM IM: IBM IM package contents extracted already."
626- else
627- mkdir $CHARM_DIR/$ARCHIVE_DIR/FP
628+ juju-log "IBM IM: IBM IM package contents extracted already."
629+ else
630+ mkdir $CHARM_DIR/$ARCHIVE_DIR/FP
631 cd $CHARM_DIR/$ARCHIVE_DIR
632- juju-log "im_fp_pkg_name===="$ibm_im_fp_package
633+ juju-log "im_fp_pkg_name===="$ibm_im_fp_package
634 if ! unzip $ibm_im_fp_package -d $CHARM_DIR/$ARCHIVE_DIR/FP
635- then
636- juju-log "IBM IM: Unable to extract the IM FP package content. Verify whether the package is corrupt."
637- # Remove corrupt archive file
638- status-set blocked "IBM Installation Manager fixpack package is corrupt"
639- rm -f $CHARM_DIR/$ARCHIVE_DIR/$ibm_im_fp_package
640- exit 0
641- else
642- juju-log "IBM IM: Installation Manager Fix pack extracted successfully."
643- fi
644- fi
645- juju-log "IBM IM: IM upgrading start"
646- # Check IM package availability
647- juju-log $CHARM_DIR/$ARCHIVE_DIR
648- if [ -f $CHARM_DIR/$ARCHIVE_DIR/FP/userinstc ];
649- then
650+ then
651+ juju-log "IBM IM: Unable to extract the IM FP package content. Verify whether the package is corrupt."
652+ # Remove corrupt archive file
653+ status-set blocked "IBM Installation Manager fixpack package is corrupt"
654+ rm -f $CHARM_DIR/$ARCHIVE_DIR/$ibm_im_fp_package
655+ exit 0
656+ else
657+ juju-log "IBM IM: Installation Manager Fix pack extracted successfully."
658+ fi
659+ fi
660+ juju-log "IBM IM: IM upgrading start"
661+ # Check IM package availability
662+ juju-log $CHARM_DIR/$ARCHIVE_DIR
663+ if [ -f $CHARM_DIR/$ARCHIVE_DIR/FP/userinstc ];
664+ then
665
666- juju-log "IBM IM: IM FP Packages available for installation."
667- cp $CHARM_DIR/$ARCHIVE_DIR/FP/install.xml $CHARM_DIR/$ARCHIVE_DIR/FP/silent_install.xml
668- sed -i "2 a \<profile kind='self' installLocation='$IM_INSTALL_PATH' id='IBM Installation Manager'>\n <data key='eclipseLocation' value='$IM_INSTALL_PATH' />\n</profile>" $CHARM_DIR/$ARCHIVE_DIR/FP/silent_install.xml
669- if $CHARM_DIR/$ARCHIVE_DIR/FP/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/FP/silent_install.xml -acceptlicense
670- then
671- set_state 'ibm-im.updated'
672+ juju-log "IBM IM: IM FP Packages available for installation."
673+ cp $CHARM_DIR/$ARCHIVE_DIR/FP/install.xml $CHARM_DIR/$ARCHIVE_DIR/FP/silent_install.xml
674+ sed -i "2 a \<profile kind='self' installLocation='$IM_INSTALL_PATH' id='IBM Installation Manager'>\n <data key='eclipseLocation' value='$IM_INSTALL_PATH' />\n</profile>" $CHARM_DIR/$ARCHIVE_DIR/FP/silent_install.xml
675+ if $CHARM_DIR/$ARCHIVE_DIR/FP/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/FP/silent_install.xml -acceptlicense
676+ then
677+ set_state 'ibm-im.updated'
678
679- status-set active "IBM IM: IM Is updated successfully"
680- else
681- juju-log "IBM IM: Error while updating IM"
682- exit 1
683- fi
684- fi
685+ status-set active "IBM IM: IM Is updated successfully"
686+ else
687+ juju-log "IBM IM: Error while updating IM"
688+ exit 1
689+ fi
690+ fi
691
692 else
693 juju-log "IBM_IM: Fix pack is not available to install, please provide the correct package"
694- status-set maintenance "IBM IM updating failed"
695- exit 1
696+ status-set maintenance "IBM IM updating failed"
697+ exit 1
698 fi
699
700 }
701
702 @when 'config.changed.ibm_im_fp_package'
703 function config-changed-ibm-im-fp(){
704+ rm -rf $CHARM_DIR/$ARCHIVE_DIR/FP
705 remove_state 'ibm-im.updated'
706- rm -rf $CHARM_DIR/$ARCHIVE_DIR/FP
707+
708 }
709
710 @when 'ibm-im.installed'
711 @when_not 'ibm-base.license.accepted'
712 function uninstall() {
713- remove_im_software
714+ juju-log "IBM IM: Removing IBM IM software."
715+ /root/var/ibm/InstallationManager/uninstall/uninstallc
716+ juju-log "IBM IM: Removed IBM IM software"
717 remove_state "ibm-im.installed"
718 status-set blocked "IBM IM uninstalled"
719 }

Subscribers

People subscribed via source and target branches

to all changes: