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
=== modified file 'README.md'
--- README.md 2016-04-22 11:21:50 +0000
+++ README.md 2016-04-27 12:12:01 +0000
@@ -1,175 +1,211 @@
1## Charm for IBM Installation Manager(IM) 1.8
2
3### Overview
4
5IBM Installation Manager
6
7IBM® Installation Manager is a single installation program that uses remote or local software repositories to install, modify, or update certain IBM products.
8
9User guides and security guides to support this release are available for
10Online viewing [User Guide](http://www.ibm.com/support/knowledgecenter/SSDV2W/im_family_welcome.html)
11
12
13### Download of Product Binaries
14
15Download your licensed IBM IM 1.8 software for Ubuntu.
16
17You can download product binaries from
18[Product Page](http://www-01.ibm.com/support/docview.wss?uid=swg27025142)
19
20
21### Usage
22Download your licensed IBM Installation Manager software and host it.
23
24Curl-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/)
25
26To download and install the code contained in this charm you must agree to the IBM license.
27
28You 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).
29
30Search for "IBM Installation Manager" and choose the license that applies to the version you are using.
31
32##### For (x86_64) Ubuntu , The packages are:
33
34IBM Installation Manager 1.8 (agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip)
35
36##### For Power (ppcle) Ubuntu, The packages are:
37
38IBM Installation Manager 1.8(agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip)
39
40Creating Repositories
41--------------------
42For 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.
43
44
45### Deploy
46
471.Run the following commands to deploy this charm:
48
49 juju deploy ibm-im
502.At this point the charm will wait until the user accepts the license. If you agree to the license, run the following command.
51
52 juju set ibm-im license_accepted="True"
53
54
553.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.
56
57We have to provide values for curl-url and curl-opt to download the product.
58
59curl-url with hostname,package_dir,package name,checksum value, curl-opts with username and password,to proceed with the installation.
60 To provide these run the following command:
61
62 juju set ibm-im curl_url="<hostname><package_dir><package_name>?<sha512=value>"
63 juju set ibm-im curl_opts="-u <username>:<password>"
64
65For eg:
66
67 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"
68 juju set ibm-im curl_opts="-u root:root123"
69
70
71
72 The command to find the sha512 value is
73
74 sha512sum <IM Package Name>
75
76
774.Setting the license-accepted to False will uninstall the product:
78
79 juju set ibm-im license_accepted="False"
80
81**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.
82
83Next user need to deploy locally with the command
84
85 juju deploy --repository=/home/charm1/charms/ local:trusty/ibm-im
86
87Next he need to follow the below deploy section from step 2
88### Upgrade of ibm-im
89Once deployed and if the user wants to upgrade the newer version, setting the ibm-im-fp-package will upgrade the product.
90
91 juju set ibm-im ibm_im_fp_package="<fix pack-name>"
92
93For eg:
94
95 juju set ibm-im ibm_im_fp_package="agent.installer.linux.gtk.x86_64_1.8.4001.20160217_1716.zip"
96
97**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.
98
99 For eg:
100
101 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"
102 juju set ibm-im curl_opts="-u root:root123"
103
104
105
106### Installation Verification
107
108Once deployed, you can use IBM IM to install any IBM products. To verify IM is installed or not
109get into the container and check whether the below path is exist.
110
111 opt/IBM/InstallationManager
112
113To get into the container run the below commmand.
114
115 juju ssh <machine-id where IBM IM is installed>
116
117
118### Uninstallation of ibm-im
119
120Setting the license-accepted to False will uninstall the product.
121
122 juju set ibm-im license_accepted=False
123
124
125### Configuration
126
127- **license_accepted** Before you can use or install IBM IM,
128 you must accept the terms of International License
129 Agreement for Non-Warranted Programs and additional license information.
130 Please read the license agreement carefully
131 [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.
132
133**The IBM IM software cannot be installed until the terms and
134conditions are accepted. The charm will not function correctly until the configuration option is set to True.**
135
136- **curl_url** For downloading package we need to set curl_url with following options.
137
138 - *hostname* - The web server host name from which IBM IM installation packages can be downloaded.
139 - *package_dir* - The package directory path in the web server.
140 - *package name* - The IBM IM Package name.
141 - *checksum value* - Checksum value to check integrity of IBM IM package. The Charm
142 uses sha512sum to check the integrity. If empty, it does not carry out the
143 integrity check. Use `sha512sum <Package Location/Package Name>`
144 to find out Checksum value for downloaded package.
145
146- **curl_opts** We need to set curl_opts with following options.
147 - *username* - User name of the webserver host.
148 - *password* - Password of the webserver host.
149
150- **ibm-im-fp-package** The IBM IM Fix pack Package name. These must be provided when user wants to upgrade the charm.
151
152
153
154
155### IBM IM Information
156
157### General Information
158
159Details about IBM IM available [Here](http://www.ibm.com/support/knowledgecenter/SSDV2W/im_family_welcome.html)
160
161### Download Information
162
163Information on procuring IBM IM product is available at the [Product Page](http://www-01.ibm.com/support/docview.wss?uid=swg27025142)
164
165### License Information
166
167License 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)
168
169### Known Limitations
170
171This charm makes use of Juju Status commands, and requires juju 1.24 or greater
172
173### Contact Information
174
175For issues with this charm, please contact [IBM Juju Support Team](mailto:jujusupp@us.ibm.com)
176\ No newline at end of file1\ No newline at end of file
2## Charm for IBM Installation Manager(IM) 1.8
3
4### Overview
5
6IBM Installation Manager
7
8IBM® Installation Manager is a single installation program that uses remote or local software repositories to install, modify, or update certain IBM products.
9
10User guides and security guides to support this release are available for
11online viewing [User Guide](http://www.ibm.com/support/knowledgecenter/SSDV2W/im_family_welcome.html)
12
13
14### Download of Product Binaries
15
16Download your licensed IBM IM 1.8 software for Ubuntu.
17
18You can download product binaries from
19[Product Page](http://www-01.ibm.com/support/docview.wss?uid=swg27025142)
20
21
22### Usage
23Download your licensed IBM Installation Manager software and host it in a way that can be downloaded using curl.
24
25Curl-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/)
26
27To download and install the code contained in this charm you must agree to the IBM license.
28
29You 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).
30
31Search for "IBM Installation Manager" and choose the license that applies to the version you are using.
32
33##### For (x86_64) Ubuntu , The packages are:
34
35IBM Installation Manager 1.8 (agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip)
36
37##### For Power (ppcle) Ubuntu, The packages are:
38
39IBM Installation Manager 1.8(agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip)
40
41Creating Repositories
42--------------------
43For 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.
44
45For eg:
46
47The 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
48
49 cd /home/Downloads
50 python -m SimpleHTTPServer
51
52And the curl-url would be
53
54 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>
55
56### Deploy
57
581.Run the following commands to deploy this charm:
59
60 juju deploy ibm-im
61
622.Here the charm will wait until the user accepts the license. If you agree to the license, run the following command.
63
64 juju set ibm-im license_accepted="True"
65
66
673.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).
68
69We have to provide values for curl-url and curl-opt to download the product.
70
71curl-url with host name,package_dir,package name,checksum value, curl-opts with user name and password,to proceed with the installation.
72 To provide these run the following command:
73
74 juju set ibm-im curl_url="<hostname>/<package_dir><package_name>?<sha512=value>"
75 juju set ibm-im curl_opts="-u <username>:<password>"
76
77For eg:
78
79 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"
80 juju set ibm-im curl_opts="-u root:root123"
81
82
83
84 The command to find the sha512 value is
85
86 sha512sum <IM Package Name>
87
88For eg:
89
90 sha512sum agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip
91
92
934.Setting the license-accepted to False will uninstall the product:
94
95 juju set ibm-im license_accepted="False"
96
97**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.
98
99Next user needs to deploy locally with the command
100
101 juju deploy --repository=<path_to_charms_folder> local:trusty/ibm-im
102
103Next he need to follow the below deploy section from step 2
104### Upgrade of ibm-im
105Once deployed and if the user wants to upgrade to the newer version, setting the ibm-im-fp-package will upgrade the product.
106
107 juju set ibm-im ibm_im_fp_package="<fix pack-name>"
108
109For eg:
110
111 juju set ibm-im ibm_im_fp_package="agent.installer.linux.gtk.x86_64_1.8.4001.20160217_1716.zip"
112
113**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.
114
115 For eg:
116
117 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"
118 juju set ibm-im curl_opts="-u root:root123"
119
120
121
122### Installation Verification
123
124Once deployed, you can use IBM IM to install any IBM products. To verify IM is installed or not
125get into the container and check whether the below path is exist.
126
127 /opt/IBM/InstallationManager
128
129To get into the container run the below command.
130
131 juju ssh <machine-id where IBM IM is installed>
132
133
134### Uninstallation of ibm-im
135
136Setting the license-accepted to False will uninstall the product.
137
138 juju set ibm-im license_accepted=False
139
140
141### Configuration
142
143- **license_accepted** Before you can use or install IBM IM,
144 you must accept the terms of International License
145 Agreement for Non-Warranted Programs and additional license information.
146 Please read the license agreement carefully
147 [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.
148
149**The IBM IM software cannot be installed until the terms and
150conditions are accepted. The charm will not function correctly until the configuration option is set to True.**
151
152- **curl_url** For downloading package we need to set curl_url with following options.
153
154 - *hostname* - The web server host name from which IBM IM installation packages can be downloaded.
155 - *package_dir* - The package directory path in the web server.
156 - *package name* - The IBM IM Package name.
157 - *checksum value* - Checksum value to check integrity of IBM IM package. The Charm
158 uses sha512sum to check the integrity. If empty, it does not carry out the
159 integrity check. Use `sha512sum <Package Location/Package Name>`
160 to find out Checksum value for downloaded package.
161
162- **curl_opts** We need to set curl_opts with following options.
163 - *username* - User name of the webserver host.
164 - *password* - Password of the webserver host.
165
166- **ibm-im-fp-package** The IBM IM Fix pack Package name. These must be provided when user wants to upgrade the charm.
167
168
169
170
171### IBM IM Information
172
173### General Information
174
175Details about IBM IM available [Here](http://www.ibm.com/support/knowledgecenter/SSDV2W/im_family_welcome.html)
176
177### Download Information
178
179Information on procuring IBM IM product is available at the [Product Page](http://www-01.ibm.com/support/docview.wss?uid=swg27025142)
180
181### License Information
182
183License 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)
184
185### Known Limitations
186
187This charm makes use of juju status commands, and requires juju 1.24 or greater
188
189### Contact Information
190
191For issues with this charm, please contact [IBM Juju Support Team](mailto:jujusupp@us.ibm.com)
192### Additional Information
193This 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.
194
195To use this layer, include the following in your `layer.yaml`:
196
197```yaml
198includes: ['layer:ibm-installation-manager']
199```
200
201Then, in your charm, watch for the `im.installed` state, at which point you will know the IBM IM tools are available:
202
203```bash
204IM_PATH=/opt/IBM/InstallationManager
205
206@when 'im.installed'
207install_was() {
208 WAS_REPO=`config-get was_repo`
209 ${IM_PATH}/tools/imutilsc saveCredential -url $WAS_REPO -userName $IBM_ID_NAME -userPassword $IBM_ID_PASS -secureStorageFile "secure.store"
210 ${IM_PATH}/installc -input silent-install.xml -acceptlicense -secureStorageFile "secure.store"
211 ${IM_PATH}/imcl install $IM_ARGS
212}
177213
=== modified file 'copyright'
--- copyright 2016-04-22 11:21:50 +0000
+++ copyright 2016-04-27 12:12:01 +0000
@@ -1,4 +1,4 @@
1Copyright 2015 IBM Corporation1Copyright 2016 IBM Corporation
22
3This Charm is licensed under the Apache License, Version 2.0 (the "License");3This Charm is licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.4you may not use this file except in compliance with the License.
55
=== removed file 'files/sftp_get.sh'
--- files/sftp_get.sh 2016-04-22 11:21:50 +0000
+++ files/sftp_get.sh 1970-01-01 00:00:00 +0000
@@ -1,20 +0,0 @@
1#!/usr/bin/expect
2# Helper script to connect and download using sftp
3# Invoked from download action
4# Usage: sftp_get.sh user password host remote_dir localpath
5
6set user [lindex $argv 0]
7set password [lindex $argv 1]
8set host [lindex $argv 2]
9set r_dir [lindex $argv 3]
10set localpath [lindex $argv 4]
11
12set timeout 90
13spawn sftp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null $user@$host
14expect "password:"
15send "$password\n"
16expect "sftp>"
17set timeout 3000
18send "get -r $r_dir $localpath\n"
19expect "sftp>"
20send "exit\n"
210
=== modified file 'reactive/ibm-im.sh'
--- reactive/ibm-im.sh 2016-04-22 11:21:50 +0000
+++ reactive/ibm-im.sh 2016-04-27 12:12:01 +0000
@@ -3,109 +3,96 @@
33
4source charms.reactive.sh4source charms.reactive.sh
5ARCHIVE_DIR=files/archives5ARCHIVE_DIR=files/archives
6
7# Fail if we're not on a supported arch. Also set defaults for filename
8# and sha1sum based on arch.
9ARCHITECTURE=`uname -m`6ARCHITECTURE=`uname -m`
10DEFAULT_INSTALLER_FILE_IM=""
11if [ "$ARCHITECTURE" = "x86_64" ]; then
12 DEFAULT_INSTALLER_FILE_IM="agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip"
13elif [ "$ARCHITECTURE" = "ppc64le" ]; then
14 DEFAULT_INSTALLER_FILE_IM="agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip"
15else
16 status-set blocked "IBM IM: Platform not supported"
17fi
18
19# Get the package name from layer.yaml to check whether the user wants to install a different package
20 im_file_name="$(layer_option ibm-im ibm_im_package)"
21 cfg_im_pkg_name=$im_file_name
22
23 # Set package name to a predefined value if the user has not provided a package name
24 if [ "$cfg_im_pkg_name" == "" ]; then
25 cfg_im_pkg_name=${DEFAULT_INSTALLER_FILE_IM}
26 fi
27
28cfg_im_pkg_name=${DEFAULT_INSTALLER_FILE_IM}
297
30# Installation Manager install path8# Installation Manager install path
31IM_INSTALL_PATH="/opt/IBM/InstallationManager"9IM_INSTALL_PATH="/opt/IBM/InstallationManager"
3210
33# Check whether IM is installed
34is_im_installed()
35{
36 if [ -f $IM_INSTALL_PATH/eclipse/IBMIM ]; then
37 echo "True"
38 else
39 echo "False"
40 fi
41
42}
43
44#Remove IM, if installed
45remove_im_software()
46{
47 im_installed=`is_im_installed`
48 if [ $im_installed == True ]; then
49 juju-log "IBM IM: Removing IBM IM software."
50 /root/var/ibm/InstallationManager/uninstall/uninstallc
51 juju-log "IBM IM: Removed IBM IM software"
52 fi
53
54}
5511
56@when 'ibm-base.license.accepted' 'ibm-base.curl.resource.fetched'12@when 'ibm-base.license.accepted' 'ibm-base.curl.resource.fetched'
57@when_not 'ibm-im.installed'13@when_not 'ibm-im.installed'
58function install(){14function install(){
59# Do the actual IBM IM install15# Get the package name to check whether the user wants to install a different package
60im_inst=`is_im_installed`16 im_file_name="$(layer_option ibm-im ibm_im_package)"
61 if [ $im_inst == False ]; then17 cfg_im_pkg_name=$im_file_name
62 if [ -f $CHARM_DIR/$ARCHIVE_DIR/$cfg_im_pkg_name ]; then18
63 juju-log "IBM IM: downloading and extracting IM packages"19 #Check whether user has selected right package name from the package name string. If he selects wrong package name , install would fail.
64 if [ -f $CHARM_DIR/$ARCHIVE_DIR/userinstc ]; then20 # Set package name to a predefined value if user have not set the layer option
65 juju-log "IBM IM: IBM IM package contents extracted already."21 if [ "$cfg_im_pkg_name" == "" ]; then
66 else22 if [ "$ARCHITECTURE" = "x86_64" ]; then
67 cd $CHARM_DIR/$ARCHIVE_DIR23 DEFAULT_INSTALLER_FILE_IM="agent.installer.linux.gtk.x86_64_1.8.3000.20150606_0047.zip"
68 24 elif [ "$ARCHITECTURE" = "ppc64le" ]; then
25 DEFAULT_INSTALLER_FILE_IM="agent.installer.linux.gtk.ppc64le_1.8.1000.20141126_2002.zip"
26 else
27 status-set blocked "IBM IM: Platform not supported"
28 fi
29 cfg_im_pkg_name=${DEFAULT_INSTALLER_FILE_IM}
30 else
31 if [ "$ARCHITECTURE" = "x86_64" ]; then
32 juju-log "Checking the package name"
33 if echo "$cfg_im_pkg_name" | grep -q "x86"; then
34 juju-log "IBM IM: Package name is matching for the platform"
35 else
36 juju-log "IBM IM: Probably Not the right package. IM install will fail if its not the right package"
37 status-set blocked "Probably Not the right package. Please configure the correct package name"
38 exit 0
39 fi
40 else
41 if echo "$cfg_im_pkg_name" | grep -q "ppcle"; then
42 juju-log "IBM IM: Package name is matching for the platform"
43 else
44 juju-log "IBM IM: Probably Not the right package. IM install will fail if its not the right package"
45 status-set blocked "Probably Not the right package. Please configure the correct package name"
46 exit 0
47 fi
48 fi
49 fi
50
51 # Do the actual IBM IM install
52 if [ -f $CHARM_DIR/$ARCHIVE_DIR/$cfg_im_pkg_name ]; then
53 juju-log "IBM IM: downloading and extracting IM packages"
54 if [ -f $CHARM_DIR/$ARCHIVE_DIR/userinstc ]; then
55 juju-log "IBM IM: IBM IM package contents extracted already."
56 else
57 cd $CHARM_DIR/$ARCHIVE_DIR
58
69 juju-log "im_pkg_name===="$cfg_im_pkg_name59 juju-log "im_pkg_name===="$cfg_im_pkg_name
70 if ! unzip $cfg_im_pkg_name -d $CHARM_DIR/$ARCHIVE_DIR60 if ! unzip $cfg_im_pkg_name -d $CHARM_DIR/$ARCHIVE_DIR
71 then61 then
72 juju-log "IBM IM: Unable to extract the IM package content. Verify whether the package is corrupt."62 juju-log "IBM IM: Unable to extract the IM package content. Verify whether the package is corrupt."
73 # Remove corrupt archive file63 # Remove corrupt archive file
74 status-set blocked "IBM Installation Manager package is corrupt"64 status-set blocked "IBM Installation Manager package is corrupt"
75 rm -f $CHARM_DIR/$ARCHIVE_DIR/$im_pkg_name65 rm -f $CHARM_DIR/$ARCHIVE_DIR/$im_pkg_name
76 exit 066 exit 0
77 else67 else
78 juju-log "IBM IM: Installation Manager extracted successfully."68 juju-log "IBM IM: Installation Manager extracted successfully."
79 fi69 fi
80 fi70 fi
81 fi71 fi
82 juju-log "IBM IM: IM installation start"72 juju-log "IBM IM: IM installation start"
83 # Check IM package availability73 # Check IM package availability
84 juju-log $CHARM_DIR/$ARCHIVE_DIR74 juju-log $CHARM_DIR/$ARCHIVE_DIR
85 if [ -f $CHARM_DIR/$ARCHIVE_DIR/userinstc ];75 if [ -f $CHARM_DIR/$ARCHIVE_DIR/userinstc ];
86 then76 then
8777
88 juju-log "IBM IM: IM Packages available for installation."78 juju-log "IBM IM: IM Packages available for installation."
89 cp $CHARM_DIR/$ARCHIVE_DIR/install.xml $CHARM_DIR/$ARCHIVE_DIR/silent_install.xml79 cp $CHARM_DIR/$ARCHIVE_DIR/install.xml $CHARM_DIR/$ARCHIVE_DIR/silent_install.xml
90 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.xml80 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
91 if $CHARM_DIR/$ARCHIVE_DIR/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/silent_install.xml -acceptlicense81 if $CHARM_DIR/$ARCHIVE_DIR/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/silent_install.xml -acceptlicense
92 then82 then
93 set_state 'ibm-im.installed'83 set_state 'ibm-im.installed'
94 84
95 status-set active "IBM IM: IM Is installed successfully"85 status-set active "IBM IM: IM Is installed successfully"
96 else86 else
97 juju-log "IBM IM: Error while installing IM"87 juju-log "IBM IM: Error while installing IM"
98 exit 188 exit 1
99 fi89 fi
10090
101 else91 else
102 juju-log "IBM IM: IM Packages missing. Please check README file"92 juju-log "IBM IM: IM Packages missing. Please check README file"
103 status-set maintenance "IBM IM install failed"93 status-set maintenance "IBM IM install failed"
104 exit 194 exit 1
105 fi95 fi
106 else
107 juju-log "IBM IM: IBM IM Installed already using same package name."
108 fi
109 }96 }
11097
111 98
@@ -114,63 +101,66 @@
114function install-ibm-im-fixpack(){101function install-ibm-im-fixpack(){
115ibm_im_fp_package=`config-get ibm_im_fp_package`102ibm_im_fp_package=`config-get ibm_im_fp_package`
116103
117if [ -f $CHARM_DIR/$ARCHIVE_DIR/$ibm_im_fp_package ]; then 104 if [ -f $CHARM_DIR/$ARCHIVE_DIR/$ibm_im_fp_package ]; then
118 juju-log "IBM-IM: ibm_im_fp_package is available"105 juju-log "IBM-IM: ibm_im_fp_package is available"
119 if [ -f $CHARM_DIR/$ARCHIVE_DIR/FP/userinstc ]; then106 if [ -f $CHARM_DIR/$ARCHIVE_DIR/FP/userinstc ]; then
120 juju-log "IBM IM: IBM IM package contents extracted already."107 juju-log "IBM IM: IBM IM package contents extracted already."
121 else108 else
122 mkdir $CHARM_DIR/$ARCHIVE_DIR/FP109 mkdir $CHARM_DIR/$ARCHIVE_DIR/FP
123 cd $CHARM_DIR/$ARCHIVE_DIR110 cd $CHARM_DIR/$ARCHIVE_DIR
124 juju-log "im_fp_pkg_name===="$ibm_im_fp_package111 juju-log "im_fp_pkg_name===="$ibm_im_fp_package
125 if ! unzip $ibm_im_fp_package -d $CHARM_DIR/$ARCHIVE_DIR/FP112 if ! unzip $ibm_im_fp_package -d $CHARM_DIR/$ARCHIVE_DIR/FP
126 then113 then
127 juju-log "IBM IM: Unable to extract the IM FP package content. Verify whether the package is corrupt."114 juju-log "IBM IM: Unable to extract the IM FP package content. Verify whether the package is corrupt."
128 # Remove corrupt archive file115 # Remove corrupt archive file
129 status-set blocked "IBM Installation Manager fixpack package is corrupt"116 status-set blocked "IBM Installation Manager fixpack package is corrupt"
130 rm -f $CHARM_DIR/$ARCHIVE_DIR/$ibm_im_fp_package117 rm -f $CHARM_DIR/$ARCHIVE_DIR/$ibm_im_fp_package
131 exit 0118 exit 0
132 else119 else
133 juju-log "IBM IM: Installation Manager Fix pack extracted successfully."120 juju-log "IBM IM: Installation Manager Fix pack extracted successfully."
134 fi121 fi
135 fi122 fi
136 juju-log "IBM IM: IM upgrading start"123 juju-log "IBM IM: IM upgrading start"
137 # Check IM package availability124 # Check IM package availability
138 juju-log $CHARM_DIR/$ARCHIVE_DIR125 juju-log $CHARM_DIR/$ARCHIVE_DIR
139 if [ -f $CHARM_DIR/$ARCHIVE_DIR/FP/userinstc ];126 if [ -f $CHARM_DIR/$ARCHIVE_DIR/FP/userinstc ];
140 then127 then
141128
142 juju-log "IBM IM: IM FP Packages available for installation."129 juju-log "IBM IM: IM FP Packages available for installation."
143 cp $CHARM_DIR/$ARCHIVE_DIR/FP/install.xml $CHARM_DIR/$ARCHIVE_DIR/FP/silent_install.xml130 cp $CHARM_DIR/$ARCHIVE_DIR/FP/install.xml $CHARM_DIR/$ARCHIVE_DIR/FP/silent_install.xml
144 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.xml131 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
145 if $CHARM_DIR/$ARCHIVE_DIR/FP/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/FP/silent_install.xml -acceptlicense132 if $CHARM_DIR/$ARCHIVE_DIR/FP/userinstc -input $CHARM_DIR/$ARCHIVE_DIR/FP/silent_install.xml -acceptlicense
146 then133 then
147 set_state 'ibm-im.updated'134 set_state 'ibm-im.updated'
148 135
149 status-set active "IBM IM: IM Is updated successfully"136 status-set active "IBM IM: IM Is updated successfully"
150 else137 else
151 juju-log "IBM IM: Error while updating IM"138 juju-log "IBM IM: Error while updating IM"
152 exit 1139 exit 1
153 fi140 fi
154 fi141 fi
155142
156 else143 else
157 juju-log "IBM_IM: Fix pack is not available to install, please provide the correct package"144 juju-log "IBM_IM: Fix pack is not available to install, please provide the correct package"
158 status-set maintenance "IBM IM updating failed"145 status-set maintenance "IBM IM updating failed"
159 exit 1146 exit 1
160fi147fi
161148
162}149}
163150
164@when 'config.changed.ibm_im_fp_package'151@when 'config.changed.ibm_im_fp_package'
165function config-changed-ibm-im-fp(){152function config-changed-ibm-im-fp(){
153 rm -rf $CHARM_DIR/$ARCHIVE_DIR/FP
166 remove_state 'ibm-im.updated'154 remove_state 'ibm-im.updated'
167 rm -rf $CHARM_DIR/$ARCHIVE_DIR/FP155
168}156}
169157
170@when 'ibm-im.installed'158@when 'ibm-im.installed'
171@when_not 'ibm-base.license.accepted'159@when_not 'ibm-base.license.accepted'
172function uninstall() {160function uninstall() {
173 remove_im_software161 juju-log "IBM IM: Removing IBM IM software."
162 /root/var/ibm/InstallationManager/uninstall/uninstallc
163 juju-log "IBM IM: Removed IBM IM software"
174 remove_state "ibm-im.installed"164 remove_state "ibm-im.installed"
175 status-set blocked "IBM IM uninstalled"165 status-set blocked "IBM IM uninstalled"
176}166}

Subscribers

People subscribed via source and target branches

to all changes: