├── .gitattributes ├── .gitignore ├── LICENSE ├── MacOS ├── README.md ├── install.sh ├── local-path-storage-mod.yaml ├── masdevops.yaml └── masinst.sh ├── README.md ├── android └── hosts_go_mas.txt ├── masdevops.yaml ├── masinst.bat ├── masinst.sh ├── masocpl.yml └── mssql ├── README.md └── masocpl.yml /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.crt 2 | *.dat 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Eclipse Public License - v 2.0 2 | 3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE 4 | PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION 5 | OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 6 | 7 | 1. DEFINITIONS 8 | 9 | "Contribution" means: 10 | 11 | a) in the case of the initial Contributor, the initial content 12 | Distributed under this Agreement, and 13 | 14 | b) in the case of each subsequent Contributor: 15 | i) changes to the Program, and 16 | ii) additions to the Program; 17 | where such changes and/or additions to the Program originate from 18 | and are Distributed by that particular Contributor. A Contribution 19 | "originates" from a Contributor if it was added to the Program by 20 | such Contributor itself or anyone acting on such Contributor's behalf. 21 | Contributions do not include changes or additions to the Program that 22 | are not Modified Works. 23 | 24 | "Contributor" means any person or entity that Distributes the Program. 25 | 26 | "Licensed Patents" mean patent claims licensable by a Contributor which 27 | are necessarily infringed by the use or sale of its Contribution alone 28 | or when combined with the Program. 29 | 30 | "Program" means the Contributions Distributed in accordance with this 31 | Agreement. 32 | 33 | "Recipient" means anyone who receives the Program under this Agreement 34 | or any Secondary License (as applicable), including Contributors. 35 | 36 | "Derivative Works" shall mean any work, whether in Source Code or other 37 | form, that is based on (or derived from) the Program and for which the 38 | editorial revisions, annotations, elaborations, or other modifications 39 | represent, as a whole, an original work of authorship. 40 | 41 | "Modified Works" shall mean any work in Source Code or other form that 42 | results from an addition to, deletion from, or modification of the 43 | contents of the Program, including, for purposes of clarity any new file 44 | in Source Code form that contains any contents of the Program. Modified 45 | Works shall not include works that contain only declarations, 46 | interfaces, types, classes, structures, or files of the Program solely 47 | in each case in order to link to, bind by name, or subclass the Program 48 | or Modified Works thereof. 49 | 50 | "Distribute" means the acts of a) distributing or b) making available 51 | in any manner that enables the transfer of a copy. 52 | 53 | "Source Code" means the form of a Program preferred for making 54 | modifications, including but not limited to software source code, 55 | documentation source, and configuration files. 56 | 57 | "Secondary License" means either the GNU General Public License, 58 | Version 2.0, or any later versions of that license, including any 59 | exceptions or additional permissions as identified by the initial 60 | Contributor. 61 | 62 | 2. GRANT OF RIGHTS 63 | 64 | a) Subject to the terms of this Agreement, each Contributor hereby 65 | grants Recipient a non-exclusive, worldwide, royalty-free copyright 66 | license to reproduce, prepare Derivative Works of, publicly display, 67 | publicly perform, Distribute and sublicense the Contribution of such 68 | Contributor, if any, and such Derivative Works. 69 | 70 | b) Subject to the terms of this Agreement, each Contributor hereby 71 | grants Recipient a non-exclusive, worldwide, royalty-free patent 72 | license under Licensed Patents to make, use, sell, offer to sell, 73 | import and otherwise transfer the Contribution of such Contributor, 74 | if any, in Source Code or other form. This patent license shall 75 | apply to the combination of the Contribution and the Program if, at 76 | the time the Contribution is added by the Contributor, such addition 77 | of the Contribution causes such combination to be covered by the 78 | Licensed Patents. The patent license shall not apply to any other 79 | combinations which include the Contribution. No hardware per se is 80 | licensed hereunder. 81 | 82 | c) Recipient understands that although each Contributor grants the 83 | licenses to its Contributions set forth herein, no assurances are 84 | provided by any Contributor that the Program does not infringe the 85 | patent or other intellectual property rights of any other entity. 86 | Each Contributor disclaims any liability to Recipient for claims 87 | brought by any other entity based on infringement of intellectual 88 | property rights or otherwise. As a condition to exercising the 89 | rights and licenses granted hereunder, each Recipient hereby 90 | assumes sole responsibility to secure any other intellectual 91 | property rights needed, if any. For example, if a third party 92 | patent license is required to allow Recipient to Distribute the 93 | Program, it is Recipient's responsibility to acquire that license 94 | before distributing the Program. 95 | 96 | d) Each Contributor represents that to its knowledge it has 97 | sufficient copyright rights in its Contribution, if any, to grant 98 | the copyright license set forth in this Agreement. 99 | 100 | e) Notwithstanding the terms of any Secondary License, no 101 | Contributor makes additional grants to any Recipient (other than 102 | those set forth in this Agreement) as a result of such Recipient's 103 | receipt of the Program under the terms of a Secondary License 104 | (if permitted under the terms of Section 3). 105 | 106 | 3. REQUIREMENTS 107 | 108 | 3.1 If a Contributor Distributes the Program in any form, then: 109 | 110 | a) the Program must also be made available as Source Code, in 111 | accordance with section 3.2, and the Contributor must accompany 112 | the Program with a statement that the Source Code for the Program 113 | is available under this Agreement, and informs Recipients how to 114 | obtain it in a reasonable manner on or through a medium customarily 115 | used for software exchange; and 116 | 117 | b) the Contributor may Distribute the Program under a license 118 | different than this Agreement, provided that such license: 119 | i) effectively disclaims on behalf of all other Contributors all 120 | warranties and conditions, express and implied, including 121 | warranties or conditions of title and non-infringement, and 122 | implied warranties or conditions of merchantability and fitness 123 | for a particular purpose; 124 | 125 | ii) effectively excludes on behalf of all other Contributors all 126 | liability for damages, including direct, indirect, special, 127 | incidental and consequential damages, such as lost profits; 128 | 129 | iii) does not attempt to limit or alter the recipients' rights 130 | in the Source Code under section 3.2; and 131 | 132 | iv) requires any subsequent distribution of the Program by any 133 | party to be under a license that satisfies the requirements 134 | of this section 3. 135 | 136 | 3.2 When the Program is Distributed as Source Code: 137 | 138 | a) it must be made available under this Agreement, or if the 139 | Program (i) is combined with other material in a separate file or 140 | files made available under a Secondary License, and (ii) the initial 141 | Contributor attached to the Source Code the notice described in 142 | Exhibit A of this Agreement, then the Program may be made available 143 | under the terms of such Secondary Licenses, and 144 | 145 | b) a copy of this Agreement must be included with each copy of 146 | the Program. 147 | 148 | 3.3 Contributors may not remove or alter any copyright, patent, 149 | trademark, attribution notices, disclaimers of warranty, or limitations 150 | of liability ("notices") contained within the Program from any copy of 151 | the Program which they Distribute, provided that Contributors may add 152 | their own appropriate notices. 153 | 154 | 4. COMMERCIAL DISTRIBUTION 155 | 156 | Commercial distributors of software may accept certain responsibilities 157 | with respect to end users, business partners and the like. While this 158 | license is intended to facilitate the commercial use of the Program, 159 | the Contributor who includes the Program in a commercial product 160 | offering should do so in a manner which does not create potential 161 | liability for other Contributors. Therefore, if a Contributor includes 162 | the Program in a commercial product offering, such Contributor 163 | ("Commercial Contributor") hereby agrees to defend and indemnify every 164 | other Contributor ("Indemnified Contributor") against any losses, 165 | damages and costs (collectively "Losses") arising from claims, lawsuits 166 | and other legal actions brought by a third party against the Indemnified 167 | Contributor to the extent caused by the acts or omissions of such 168 | Commercial Contributor in connection with its distribution of the Program 169 | in a commercial product offering. The obligations in this section do not 170 | apply to any claims or Losses relating to any actual or alleged 171 | intellectual property infringement. In order to qualify, an Indemnified 172 | Contributor must: a) promptly notify the Commercial Contributor in 173 | writing of such claim, and b) allow the Commercial Contributor to control, 174 | and cooperate with the Commercial Contributor in, the defense and any 175 | related settlement negotiations. The Indemnified Contributor may 176 | participate in any such claim at its own expense. 177 | 178 | For example, a Contributor might include the Program in a commercial 179 | product offering, Product X. That Contributor is then a Commercial 180 | Contributor. If that Commercial Contributor then makes performance 181 | claims, or offers warranties related to Product X, those performance 182 | claims and warranties are such Commercial Contributor's responsibility 183 | alone. Under this section, the Commercial Contributor would have to 184 | defend claims against the other Contributors related to those performance 185 | claims and warranties, and if a court requires any other Contributor to 186 | pay any damages as a result, the Commercial Contributor must pay 187 | those damages. 188 | 189 | 5. NO WARRANTY 190 | 191 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT 192 | PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" 193 | BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR 194 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF 195 | TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 196 | PURPOSE. Each Recipient is solely responsible for determining the 197 | appropriateness of using and distributing the Program and assumes all 198 | risks associated with its exercise of rights under this Agreement, 199 | including but not limited to the risks and costs of program errors, 200 | compliance with applicable laws, damage to or loss of data, programs 201 | or equipment, and unavailability or interruption of operations. 202 | 203 | 6. DISCLAIMER OF LIABILITY 204 | 205 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT 206 | PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS 207 | SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 208 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST 209 | PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 210 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 211 | ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE 212 | EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE 213 | POSSIBILITY OF SUCH DAMAGES. 214 | 215 | 7. GENERAL 216 | 217 | If any provision of this Agreement is invalid or unenforceable under 218 | applicable law, it shall not affect the validity or enforceability of 219 | the remainder of the terms of this Agreement, and without further 220 | action by the parties hereto, such provision shall be reformed to the 221 | minimum extent necessary to make such provision valid and enforceable. 222 | 223 | If Recipient institutes patent litigation against any entity 224 | (including a cross-claim or counterclaim in a lawsuit) alleging that the 225 | Program itself (excluding combinations of the Program with other software 226 | or hardware) infringes such Recipient's patent(s), then such Recipient's 227 | rights granted under Section 2(b) shall terminate as of the date such 228 | litigation is filed. 229 | 230 | All Recipient's rights under this Agreement shall terminate if it 231 | fails to comply with any of the material terms or conditions of this 232 | Agreement and does not cure such failure in a reasonable period of 233 | time after becoming aware of such noncompliance. If all Recipient's 234 | rights under this Agreement terminate, Recipient agrees to cease use 235 | and distribution of the Program as soon as reasonably practicable. 236 | However, Recipient's obligations under this Agreement and any licenses 237 | granted by Recipient relating to the Program shall continue and survive. 238 | 239 | Everyone is permitted to copy and distribute copies of this Agreement, 240 | but in order to avoid inconsistency the Agreement is copyrighted and 241 | may only be modified in the following manner. The Agreement Steward 242 | reserves the right to publish new versions (including revisions) of 243 | this Agreement from time to time. No one other than the Agreement 244 | Steward has the right to modify this Agreement. The Eclipse Foundation 245 | is the initial Agreement Steward. The Eclipse Foundation may assign the 246 | responsibility to serve as the Agreement Steward to a suitable separate 247 | entity. Each new version of the Agreement will be given a distinguishing 248 | version number. The Program (including Contributions) may always be 249 | Distributed subject to the version of the Agreement under which it was 250 | received. In addition, after a new version of the Agreement is published, 251 | Contributor may elect to Distribute the Program (including its 252 | Contributions) under the new version. 253 | 254 | Except as expressly stated in Sections 2(a) and 2(b) above, Recipient 255 | receives no rights or licenses to the intellectual property of any 256 | Contributor under this Agreement, whether expressly, by implication, 257 | estoppel or otherwise. All rights in the Program not expressly granted 258 | under this Agreement are reserved. Nothing in this Agreement is intended 259 | to be enforceable by any entity that is not a Contributor or Recipient. 260 | No third-party beneficiary rights are created under this Agreement. 261 | 262 | Exhibit A - Form of Secondary Licenses Notice 263 | 264 | "This Source Code may also be made available under the following 265 | Secondary Licenses when the conditions for such availability set forth 266 | in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), 267 | version(s), and exceptions or additional permissions here}." 268 | 269 | Simply including a copy of this Agreement, including this Exhibit A 270 | is not sufficient to license the Source Code under Secondary Licenses. 271 | 272 | If it is not possible or desirable to put the notice in a particular 273 | file, then You may include the notice in a location (such as a LICENSE 274 | file in a relevant directory) where a recipient would be likely to 275 | look for such a notice. 276 | 277 | You may add additional accurate notices of copyright ownership. 278 | -------------------------------------------------------------------------------- /MacOS/README.md: -------------------------------------------------------------------------------- 1 | # Install MAS in MacOS laptop 2 | 3 | ## 1. Install Openshift local to your laptop 4 | Open [Red Hat Console for OpenShift](https://console.redhat.com/openshift) and folllow the Steps to install CRC 5 | - click on the *Create Cluster* button 6 | - click on the *Local* tab, download and install OpenShift Local (also know previously as CRC, i.e. Code Ready Container). 7 | - Install the CRC by clicking the downloaded packages 8 | - After CRC is installed , run the below command to prepare the crc configuration and start it for MAS Manage install 9 | ```bash 10 | crc config set consent-telemetry no 11 | crc config set cpus 14 12 | crc config set memory 30720 13 | crc start 14 | crc stop 15 | crc config set disk-size 200 16 | crc start 17 | ``` 18 | 19 | !!!note: In that same page, there is your pull secret that you'll need to copy and use during setup 20 | 21 | 22 | ## 2. Install openshift client command line 23 | 24 | You need to download and install openshift client command line following the below steps: 25 | 26 | - Run the below command to install oc to MacOS laptop 27 | ```Bash 28 | curl -O "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.10.0/openshift-client-mac-4.10.0.tar.gz" 29 | tar -xzvf openshift-client-mac-4.10.0.tar.gz 30 | chmod +x oc kubectl 31 | sudo mv oc /usr/local/bin/oc && sudo 32 | sudo mv kubectl /usr/local/bin/kubectl 33 | oc --help 34 | ``` 35 | - Go to `System preferences` and `Security & Privacy` to Allow its execution permission. 36 | 37 | ## 3. Configure the necessary file and Env var in the install.sh 38 | 39 | Download the automation install script to your laptop 40 | ```bash 41 | git clone mas-local 42 | cd mas-local/MacOS 43 | ``` 44 | 45 | ### 3.1 Prepare your `license.dat` for MAS install and put it under this folder 46 | 47 | 48 | ### 3.2 Prepare UDS related Env var and also prepare the `uds.crt` file and save it to current folder. 49 | As UDS is only one time connection for MAS install, you can use the existing UDS server and no need to install it in CRC. You need to know 50 | 51 | **UDS_ENDPOINT_URL** : `url of the remote UDS server.` 52 | **UDS_API_KEY** : `api key of the remote UDS server` 53 | 54 | After you get the above 2 Env info from the existing UDS server, just export the Env Vars in `install.sh` file. 55 | 56 | `uds.crt` You need retrieve it and generate the file. 57 | You can get it by run `openssl s_client`, e.g if your `UDS_ENDPOINT_URL="https://uds-endpoint-ibm-common-services.masms-xxx.us-south.containers.appdomain.cloud"`, you can run below command 58 | ``` 59 | openssl s_client -servername uds-endpoint-ibm-common-services.masms-xxx.us-south.containers.appdomain.cloud -connect uds-endpoint-ibm-common-services.masms-xxx.us-south.containers.appdomain.cloud:443 -showcerts 60 | ``` 61 | Then combined all certificates parts between 62 | -----BEGIN CERTIFICATE----- 63 | xxxxxxxx 64 | -----END CERTIFICATE----- 65 | to generate the `uds.crt` file like this and put the file here. 66 | ```yaml 67 | -----BEGIN CERTIFICATE----- 68 | xxxxxxxx 69 | -----END CERTIFICATE----- 70 | -----BEGIN CERTIFICATE----- 71 | xxxxxxxx 72 | -----END CERTIFICATE----- 73 | ``` 74 | 75 | ### 3.3 Replace and export the other Env vars with the yours in `install.sh` script. 76 | ```bash 77 | ### Pls replace the entitlemwnt key with yours 78 | 79 | export IBM_ENTITLEMENT_KEY=eyJhbGciOiJIUzI1NiJ9xxxx 80 | ``` 81 | 82 | **Entitled Registry (ER) key** : This key will have to be enabled to get the MAS and CloudPak for Data images and You can get it by logging into [My IBM](https://myibm.ibm.com/dashboard/) and click on *Container Software & Entitlement key* 83 | 84 | ``` 85 | ### SLS License key info you need to change 86 | export SLS_LICENSE_ID=xxxx 87 | ``` 88 | **SLS_LICENSE_ID** matching the MAS license file. You can find out what this is by open the license file in an editor, and check the first line. The license id will be the second-last number. For example, if your first line is `SERVER sls-rlks-0.rlks 0272bc344002 27000` then your icense id is `0272bc344002`. 89 | 90 | ## 4. Run masinst.sh to kick off the MAS install 91 | 92 | ``` 93 | ./masinst.sh 94 | ``` 95 | As the log proceed, pay attention to record the userid and password of the MAS superuser, that should look like this: 96 | ``` 97 | ok: [localhost] => { 98 | "msg": [ 99 | "Maximo Application Suite is Ready, use the superuser credentials to authenticate", 100 | "Admin Dashboard ... https://admin.masdemo.apps-crc.testing", 101 | "Username .......... DIZv7X2eavITxb3vKtf3XRsY85UYj7FV", 102 | "Password .......... 58Wi9n9U4yVgZ7AhXVRS4eIqEQSnMhsq" 103 | ] 104 | } 105 | ``` 106 | In case you don't have the log anymore, you can always retrieve them from the `masdemo-credentials-superuser` secret in the `mas-masdemo-core` namespace. -------------------------------------------------------------------------------- /MacOS/install.sh: -------------------------------------------------------------------------------- 1 | ### Pls replace the entitlemwnt key with yous 2 | export IBM_ENTITLEMENT_KEY=eyJhbGciOiJIUzI1NiJ9xxxx 3 | 4 | ### No need to change the Channel if you plan to install 8.8.x 5 | export MAS_CHANNEL=8.8.x 6 | export MAS_APP_CHANNEL=8.4.x 7 | 8 | ###No need to change if you plan to use the folder path 9 | export MAS_INSTANCE_ID=masdemo 10 | export MAS_CONFIG_DIR=/tmp/masconfig 11 | export MAS_WORKSPACE_ID=main 12 | 13 | ### SLS License key info you need to change 14 | export SLS_LICENSE_ID=xxxx 15 | export SLS_LICENSE_FILE="${MAS_CONFIG_DIR}/license.dat" 16 | 17 | ### UDS info you want to connect during MAS install 18 | #### Need to replace the below 3 items 19 | export UDS_ENDPOINT_URL=xxxx 20 | export UDS_TLS_CERT_LOCAL_FILE_PATH="${MAS_CONFIG_DIR}/uds.crt" 21 | export UDS_API_KEY=xxx 22 | #### No need to change below if you won't 23 | export UDS_CONTACT_EMAIL=nobody@abc.com 24 | export UDS_CONTACT_FIRSTNAME=nobody 25 | export UDS_CONTACT_LASTNAME=nobody 26 | 27 | export UDS_STORAGE_CLASS=crc-csi-hostpath-provisioner 28 | 29 | 30 | ### Mongo Storage class and size 31 | export MONGODB_STORAGE_CLASS=crc-csi-hostpath-provisioner 32 | export MONGODB_CPU_REQUESTS=50m 33 | export MONGODB_MEM_REQUESTS=256Mi 34 | 35 | ### No need to change the below session if you install manage 8.8.x 36 | 37 | export MAS_ENTITLEMENT_KEY=${IBM_ENTITLEMENT_KEY} 38 | export MAS_APP_ID=manage 39 | 40 | ###Confgur the DB2 Disk Size and No need to change 41 | export DB2_META_STORAGE_CLASS="crc-csi-hostpath-provisioner" 42 | export DB2_META_STORAGE_SIZE="10Gi" 43 | export DB2_DATA_STORAGE_CLASS="crc-csi-hostpath-provisioner" 44 | export DB2_DATA_STORAGE_SIZE="10Gi" 45 | export DB2_BACKUP_STORAGE_CLASS="crc-csi-hostpath-provisioner" 46 | export DB2_BACKUP_STORAGE_SIZE="10Gi" 47 | export DB2_LOGS_STORAGE_CLASS="crc-csi-hostpath-provisioner" 48 | export DB2_LOGS_STORAGE_SIZE="10Gi" 49 | export DB2_TEMP_STORAGE_CLASS="crc-csi-hostpath-provisioner" 50 | export DB2_TEMP_STORAGE_SIZE="10Gi" 51 | export DB2_META_STORAGE_ACCESSMODE=ReadWriteOnce 52 | export DB2_BACKUP_STORAGE_ACCESSMODE=ReadWriteOnce 53 | export DB2_DATA_STORAGE_ACCESSMODE=ReadWriteOnce 54 | export DB2_BACKUP_STORAGE_ACCESSMODE=ReadWriteOnce 55 | export DB2_LOGS_STORAGE_ACCESSMODE=ReadWriteOnce 56 | export DB2_TEMP_STORAGE_ACCESSMODE=ReadWriteOnce 57 | export DB2_CPU_REQUESTS=500m 58 | export DB2_MEMORY_REQUESTS=3Gi 59 | 60 | ###Confgure if we need to install AIO and sample data, no need to change 61 | export MAS_APP_SETTINGS_AIO_FLAG=false 62 | export MAS_APP_SETTINGS_DEMODATA=true 63 | 64 | ###comment out the role not required 65 | sed -i 's%- ibm.mas_devops.sbo%#- ibm.mas_devops.sbo%g' /mascli/ansible-devops/playbooks/oneclick_core.yml 66 | sed -i 's%- ibm.mas_devops.cluster_monitoring%#- ibm.mas_devops.cluster_monitoring%g' /mascli/ansible-devops/playbooks/oneclick_core.yml 67 | sed -i 's%- ibm.mas_devops.suite_dns%##- ibm.mas_devops.suite_dns%g' /mascli/ansible-devops/playbooks/oneclick_core.yml 68 | 69 | echo "==========Start to run the playbook==================" 70 | ansible-playbook /mascli/ansible-devops/playbooks/oneclick_core.yml 71 | [[ $? != 0 ]] && { echo "MAS ot its Dependency install failed, pls check the log " ; exit 1; } 72 | ansible-playbook /mascli/ansible-devops/playbooks/oneclick_add_manage.yml 73 | [[ $? != 0 ]] && { echo "MAS Manage ot its Dependency install failed, pls check the log " ; exit 1; } 74 | 75 | -------------------------------------------------------------------------------- /MacOS/local-path-storage-mod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: local-path-storage 5 | labels: 6 | security.openshift.io/scc.podSecurityLabelSync: 'false' 7 | openshift.io/run-level: '0' 8 | pod-security.kubernetes.io/audit: privileged 9 | pod-security.kubernetes.io/warn: privileged 10 | --- 11 | apiVersion: v1 12 | kind: ServiceAccount 13 | metadata: 14 | name: local-path-provisioner-service-account 15 | namespace: local-path-storage 16 | 17 | --- 18 | apiVersion: rbac.authorization.k8s.io/v1 19 | kind: ClusterRole 20 | metadata: 21 | name: local-path-provisioner-role 22 | rules: 23 | - apiGroups: [ "" ] 24 | resources: [ "nodes", "persistentvolumeclaims", "configmaps" ] 25 | verbs: [ "get", "list", "watch" ] 26 | - apiGroups: [ "" ] 27 | resources: [ "endpoints", "persistentvolumes", "pods" ] 28 | verbs: [ "*" ] 29 | - apiGroups: [ "" ] 30 | resources: [ "events" ] 31 | verbs: [ "create", "patch" ] 32 | - apiGroups: [ "storage.k8s.io" ] 33 | resources: [ "storageclasses" ] 34 | verbs: [ "get", "list", "watch" ] 35 | 36 | --- 37 | apiVersion: rbac.authorization.k8s.io/v1 38 | kind: ClusterRoleBinding 39 | metadata: 40 | name: local-path-provisioner-bind 41 | roleRef: 42 | apiGroup: rbac.authorization.k8s.io 43 | kind: ClusterRole 44 | name: local-path-provisioner-role 45 | subjects: 46 | - kind: ServiceAccount 47 | name: local-path-provisioner-service-account 48 | namespace: local-path-storage 49 | 50 | --- 51 | apiVersion: apps/v1 52 | kind: Deployment 53 | metadata: 54 | name: local-path-provisioner 55 | namespace: local-path-storage 56 | spec: 57 | replicas: 1 58 | selector: 59 | matchLabels: 60 | app: local-path-provisioner 61 | template: 62 | metadata: 63 | labels: 64 | app: local-path-provisioner 65 | spec: 66 | serviceAccountName: local-path-provisioner-service-account 67 | containers: 68 | - name: local-path-provisioner 69 | image: rancher/local-path-provisioner:v0.0.23 70 | imagePullPolicy: IfNotPresent 71 | command: 72 | - local-path-provisioner 73 | - --debug 74 | - start 75 | - --config 76 | - /etc/config/config.json 77 | volumeMounts: 78 | - name: config-volume 79 | mountPath: /etc/config/ 80 | env: 81 | - name: POD_NAMESPACE 82 | valueFrom: 83 | fieldRef: 84 | fieldPath: metadata.namespace 85 | volumes: 86 | - name: config-volume 87 | configMap: 88 | name: local-path-config 89 | 90 | --- 91 | apiVersion: storage.k8s.io/v1 92 | kind: StorageClass 93 | metadata: 94 | name: local-path 95 | annotations: 96 | storageclass.kubernetes.io/is-default-class: 'true' 97 | provisioner: rancher.io/local-path 98 | volumeBindingMode: WaitForFirstConsumer 99 | reclaimPolicy: Delete 100 | 101 | --- 102 | kind: ConfigMap 103 | apiVersion: v1 104 | metadata: 105 | name: local-path-config 106 | namespace: local-path-storage 107 | data: 108 | config.json: |- 109 | { 110 | "nodePathMap":[ 111 | { 112 | "node":"DEFAULT_PATH_FOR_NON_LISTED_NODES", 113 | "paths":["/mnt/pv-data"] 114 | } 115 | ] 116 | } 117 | setup: |- 118 | #!/bin/sh 119 | set -eu 120 | mkdir -m 0777 -p "$VOL_DIR" 121 | teardown: |- 122 | #!/bin/sh 123 | set -eu 124 | rm -rf "$VOL_DIR" 125 | helperPod.yaml: |- 126 | apiVersion: v1 127 | kind: Pod 128 | metadata: 129 | name: helper-pod 130 | spec: 131 | containers: 132 | - name: helper-pod 133 | image: busybox 134 | imagePullPolicy: IfNotPresent 135 | 136 | 137 | -------------------------------------------------------------------------------- /MacOS/masdevops.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: mas-devops 5 | labels: 6 | security.openshift.io/scc.podSecurityLabelSync: 'false' 7 | openshift.io/run-level: '0' 8 | pod-security.kubernetes.io/audit: privileged 9 | pod-security.kubernetes.io/warn: privileged 10 | --- 11 | apiVersion: v1 12 | kind: ServiceAccount 13 | metadata: 14 | name: mas-devops-service-account 15 | namespace: mas-devops 16 | --- 17 | apiVersion: rbac.authorization.k8s.io/v1 18 | kind: ClusterRoleBinding 19 | metadata: 20 | name: mas-devops-role 21 | roleRef: 22 | apiGroup: rbac.authorization.k8s.io 23 | kind: ClusterRole 24 | name: cluster-admin 25 | subjects: 26 | - kind: ServiceAccount 27 | name: mas-devops-service-account 28 | namespace: mas-devops 29 | --- 30 | apiVersion: apps/v1 31 | kind: Deployment 32 | metadata: 33 | labels: 34 | app: mas-devops-app 35 | name: mas-devops-app 36 | namespace: mas-devops 37 | spec: 38 | replicas: 1 39 | selector: 40 | matchLabels: 41 | app: mas-devops-app 42 | strategy: 43 | type: Recreate 44 | template: 45 | metadata: 46 | labels: 47 | app: mas-devops-app 48 | spec: 49 | serviceAccountName: mas-devops-service-account 50 | containers: 51 | - name: main 52 | imagePullPolicy: Always 53 | image: quay.io/ibmmas/cli:latest 54 | command: [ "/bin/bash", "-c", "--" ] 55 | args: [ "while true; do sleep 30; done;" ] 56 | securityContext: 57 | runAsUser: 0 58 | -------------------------------------------------------------------------------- /MacOS/masinst.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | function checkcrcstatus () { 4 | crcstatus=$1 5 | retry=2 6 | while ( [ $retry -gt 0 ] ) 7 | do 8 | str1=$( crc status | grep 'CRC' | grep 'VM' | grep -i "$crcstatus") 9 | if [[ -n ${str1} ]]; 10 | then 11 | echo "CRC is $crcstatus" 12 | break 13 | fi 14 | sleep 30; 15 | echo "CRC is not in $crcstatus will check again in 30 sec." 16 | retry=`expr $retry - 1` 17 | done 18 | if [ $retry -eq 0 ] 19 | then 20 | echo " CRC fail to $crcstatus correctly in 10 Mins!!! " 21 | echo " Please Check what's wrong. " 22 | exit 1 23 | else 24 | echo "CRC is already in $crcstatus" 25 | fi 26 | } 27 | 28 | 29 | echo "####Pre-install Check####" 30 | ## Check if the crc configure can meet the install 31 | telemetryflag=$(crc config view | grep -i 'telemetry' |awk -F ':' '{print $2}' |tr -d ' ') 32 | cpunum=$(crc config view | grep -i 'cpus' |awk -F ':' '{print $2}'|tr -d ' ') 33 | disksize=$(crc config view | grep -i 'disk-size ' |awk -F ':' '{print $2}'|tr -d ' ' ) 34 | memorysize=$(crc config view | grep -i 'memory ' |awk -F ':' '{print $2}'|tr -d ' ') 35 | ## Start to set up CRC to use the pre-configured 36 | [[ -z "${telemetryflag}" ]] && crc config set consent-telemetry no && export starflag=true 37 | [[ -z "$cpunum" ]] && crc config set cpus 14 && export starflag=true 38 | [[ -z "$disksize" ]] && crc config set disk-size 200 && export starflag=true 39 | [[ -z "$memorysize" ]] && crc config set memory 30720 && export starflag=true 40 | [[ "$starflag" == "true" ]] && crc start && checkcrcstatus running 41 | if [[ "$telemetryflag" == "no" ]] && (( $cpunum >= 14 )) && (( $disksize >= 200 )) && (( $memorysize >= 30720 )) 42 | then 43 | echo "CRC confguration meets the MAS install requirement" 44 | else 45 | echo "CRC confguration does not meet the MAS install requirement" 46 | echo "Stop and congiure the minimum configuration and re-run the install script" 47 | crc stop 48 | checkcrcstatus stopped 49 | [[ "$telemetryflag" != "no" ]] && crc config set consent-telemetry no 50 | (( $cpunum < 14 )) && crc config set cpus 14 51 | (( $memorysize < 30720 )) && crc config set memory 30720 52 | crc start 53 | checkcrcstatus running 54 | if (( $disksize < 200 )) 55 | then 56 | crc stop 57 | checkcrcstatus stopped 58 | crc config set disk-size 200 59 | crc start 60 | checkcrcstatus running 61 | fi 62 | fi 63 | 64 | echo "#1 Check if crc is install correctly" 65 | ## Not check the Openshift status because sometimes CRC cluster still work even the openshift status not running 66 | crcvm=$(crc status | grep 'CRC' | grep 'VM' | grep 'Running') 67 | if [[ -n "$crcvm" ]] 68 | then 69 | echo "CRC VM is running now" 70 | else 71 | echo "CRC VM is not running, pls make sure your CRC is running for MAS install" 72 | crc start 73 | checkcrcstatus running 74 | fi 75 | 76 | ## Will add oc check 77 | echo "=========Check and install oc client=======" 78 | oc help 79 | if [[ $? -ne 0 ]] 80 | then 81 | echo "========You don't have oc client and Prepare Openshift client ===========" 82 | curl -O "https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.10.0/openshift-client-mac-4.10.0.tar.gz" 83 | tar -xzvf openshift-client-mac-4.10.0.tar.gz 84 | chmod +x oc kubectl 85 | mv oc /usr/local/bin/oc 86 | mv kubectl /usr/local/bin/kubectl 87 | echo "Need you to run the below command to copy the oc to /usr/local/bin in your macOS and allow it in system prefernece" 88 | echo "sudo mv oc /usr/local/bin/oc && sudo mv kubectl /usr/local/bin/kubectl" 89 | exit 1 90 | fi 91 | echo "Now Login the CRC" 92 | logincmd=$(crc console --credentials | grep -i kubeadmin |grep -i 'To login as an admin, run' |sed 's%To login as an admin, run %%g'| sed "s%'%%g") 93 | eval $logincmd | grep -i 'Login successful.' 94 | if [[ $? == 0 ]] 95 | then 96 | echo "Login successful." 97 | checkArch=$(oc get node -L 'kubernetes.io/arch'|grep ' arm64') 98 | if [[ $? == 0 ]] && [[ -n "${checkArch}" ]] 99 | then 100 | echo "==== Arch Precheck failure !!!====" 101 | echo "==== MAS does not Support Apple M1 ==== " 102 | exit 0 103 | fi 104 | else 105 | echo "Not able to login, please check the CRC status again" 106 | exit 1 107 | fi 108 | 109 | ### Now configure the local-path Storage Provisoner 110 | ### This is no more needed from CRC 2.11.0, because there is an equivalent default storage class (crc-csi-hostpath-provisioner) 111 | ### oc apply -f local-path-storage-mod.yaml 112 | 113 | ## Creates a pod to run the MAS ansible collection 114 | oc apply -f masdevops.yaml 115 | oc project mas-devops 116 | POD=$(oc get pods | grep -i mas-devops-app | awk '{print $1}') 117 | ## Wait for 3 mins for Pod to start up. 118 | retry=20 119 | while ( [ $retry -gt 0 ] ) 120 | do 121 | str1=$( oc get pods -n mas-devops | grep -i mas-devops-app | grep -i 'running') 122 | if [[ -n ${str1} ]]; 123 | then 124 | echo "Pod is running" 125 | break 126 | fi 127 | sleep 30; 128 | echo "Pod is not running, will check again in 30 sec." 129 | retry=`expr $retry - 1` 130 | done 131 | if [ $retry -eq 0 ] 132 | then 133 | echo " Pod fail to run correctly in 10 Mins!!! " 134 | echo " Please Check what's wrong and re-run the install script " 135 | exit 1 136 | else 137 | echo "Pod is Running Well" 138 | fi 139 | echo "==============Start to run the install script in the mas-devops pod==================================" 140 | echo "====You can login Dashboard and check the pod mas-devops/$POD and log at /tmp/oneclick_manage.log====" 141 | 142 | ##Creates the directory where all the MAS configuration will go 143 | masconfgpath="/tmp/masconfig" 144 | oc exec $POD -- mkdir -p $masconfgpath 145 | 146 | ## Uploads your MAS license file and UDS certificate 147 | oc cp license.dat mas-devops/$POD:$masconfgpath/license.dat 148 | oc cp uds.crt mas-devops/$POD:$masconfgpath/uds.crt 149 | ###copy the ansible install script to pod 150 | oc cp install.sh mas-devops/$POD:/tmp/install.sh 151 | ### Run the playbook 152 | oc exec $POD -- bash -c "cd /tmp && nohup ./install.sh > oneclick_manage.log 2>&1 &" 153 | oc exec $POD -- tail -f /tmp/oneclick_manage.log 154 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | :memo: **Preliminary note**: 2 | --- 3 | The procedure to install MAS Manage on OCP Local is now also described and maintained in the regular IBM Documentation. It can be found at this link: https://www.ibm.com/docs/en/mas-cd/continuous-delivery?topic=installing-red-hat-openshift-container-platform-maximo-application-suite-windows-system 4 | 5 | --- 6 | 7 | # MAS Local 8 | A few scripts to bring up a MAS Manage on OCP Local with DB2 in the cluster (there is also a version with an external MS SQL). If you want to watch a recording of the installation, it is available on YouTube [here](https://youtu.be/LrbPGrxxAvo). Note that I've not refreshed the video recently and the installation has slightly changed, so don't look for an exact match. If you would like to use this MAS Manage on OCP Local to demo Maximo Mobile using a local emulator, check [this blog](https://community.ibm.com/community/user/asset-facilities/blogs/alex-donatelli/2022/12/22/maximo-mobile-demo-env-connected-to-manage-local). 9 | Please note that the current version works from CRC 2.11.0 (OCP 4.11.17) on. 10 | 11 | ## Summary 12 | My team and I have decided to focus a bit on the problem of installing MAS on a laptop computer in a simple way. I've tried to interest people to pull together notes and explanations on how to do that, but got not a lot of help, so we spent some of our free time on that task. I hope you will find it useful, and that you'll help us in keeping it current and improve it. 13 | These instructions will allow you to have a fully functional MAS Core + Manage, that has the Suite License Server (SLS), Data Reporter Operator (DRO) and DB2 on board. 14 | 15 | ## What you would need to run OpenShift Local 16 | First of all, you'll need a decent Laptop. I used a Lenovo ThinkPad P15 with 64 GiB of memory. In the end, you will need the availability of 14 vCPU and 32 GiB of memory in the virtual environment you will use that is Hyper-V for Windows. (NOTE: It may even work with 12 vCPU due to some new enhancements we have delivered in MAS to reduce the footprint) 17 | If you have a smaller PC that has only 32 GB of memory but still at least 12 vCPU, you may want to try the deployment using an external MS SQL Server described [here](https://github.com/evilADevil/mas-local/tree/main/mssql) 18 | Then you will need a locally running OCP (also know previously as CRC, i.e. Code Ready Container). Normally you would download it from the Red Hat Console page, but the version in that page is always the latest, while we need the one supported by MAS. You can download it from https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/. Pick one that includes an OCP version supported by MAS. Check in the `release-info.json` what each package containes. For example 2.38.0 includes OCP 4.15.17. For Windows, the file is `crc-windows-installer.zip`. Unzip it and install it. Then register to Red Hat if you haven't already, go to the [Red Hat Console for OpenShift](https://console.redhat.com/openshift), click on the *Create Cluster* button, click on the *Local* tab. In that page, there is your pull secret that you'll need to copy and use during setup 19 | Now you are ready for the next step. Open a command prompt and run `crc setup`. Before staring a new OpenShift Local, we want to configure it so that it will allow MAS to fit. We will need to use a trick because CRC seems to have a bug in expanding the disk. We need to start it a first time, then stop it, set the new disk size and start it again. 20 | This is the set of commands to configure it correctly and start it 21 | ``` 22 | crc config set consent-telemetry no 23 | crc config set cpus 14 24 | crc config set memory 32768 25 | crc config set disk-size 200 26 | crc start 27 | ``` 28 | At this point you should have an OpenShift running and ready to host MAS Core + Manage. From the last ourput of `crc start` you may want to record the password to log into the cluster. 29 | 30 | ## What you would need to run MAS Manage 31 | Now that you have OpenShift Local running, you are almost ready to install MAS Core and Manage, but before doing that, you'll need a few files and info. 32 | Open a Windows command prompt, and `cd` to a directory in which you will want to create the MAS Local working directory. 33 | As a firt step, let's grab the content of this repository. Issue the following command from the directory you have chosen for this work. 34 | ``` 35 | git clone https://github.com/evilADevil/mas-local 36 | cd mas-local 37 | ``` 38 | Then you need to procure yourself a file to add to this directory and some important information: 39 | 1. The **Entitled Registry (ER) key**. This key will have to be enabled to get the MAS and CloudPak for Data images and you can get it by logging into [My IBM](https://myibm.ibm.com/dashboard/) and click on *Container Software & Entitlement key* 40 | 2. A **MAS license file**. Put this file called `license.dat` in the `mas-local` directory. 41 | 3. A **license id** matching the MAS license file. You can find out what this is by open the license file in an editor, and check the first line. The license id will be the second-last number. For example, if your first line is `SERVER sls-rlks-0.rlks 0272bc344002 27000` then your license id is `0272bc344002`. 42 | The next step is to customize the file `masocpl.yml` using the information you collected. Specifically: 43 | - Replace `<>` with your ER key from step 0 above. 44 | - Replace `<>` with the license id you obtained from step 2 above 45 | - Replace also the `dro_contact` info 46 | We are ready to proceed to install MAS Core and Manage 47 | 48 | ## How you would install MAS Core and MAS Manage 49 | At this point, your working directory should include the following files: 50 | ``` 51 | masdevops.yaml 52 | masocpl.yml 53 | license.dat 54 | masinst.bat 55 | ``` 56 | other files may be present there (like this `README.md`), but these are the important ones for the installation. 57 | Before starting the MAS installation, you need to login to the OpenShift Local instance. The `crc start` command you have issued should have ended with some messages like these that include the admin credentials: 58 | ``` 59 | Started the OpenShift cluster. 60 | 61 | The server is accessible via web console at: 62 | https://console-openshift-console.apps-crc.testing 63 | 64 | Log in as administrator: 65 | Username: kubeadmin 66 | Password: H2rDA-GXB82-dSdTA-cAAYu 67 | 68 | Log in as user: 69 | Username: developer 70 | Password: developer 71 | 72 | Use the 'oc' command line interface: 73 | > @FOR /f "tokens=*" %i IN ('crc oc-env') DO @call %i 74 | > oc login -u developer https://api.crc.testing:6443 75 | ``` 76 | At the command prompt, run the following commands using the password that your environment provided: 77 | ``` 78 | @FOR /f "tokens=*" %i IN ('crc oc-env') DO @call %i 79 | oc login -u kubeadmin -p H2rDA-GXB82-dSdTA-cAAYu https://api.crc.testing:6443 80 | ``` 81 | At this point you are ready to install MAS with Manage. Run `masinst` at the prompt and wait it to finish. 82 | As the log proceed, pay attention to record the userid and password of the MAS superuser, that should look like this: 83 | ``` 84 | ok: [localhost] => { 85 | "msg": [ 86 | "Maximo Application Suite is Ready, use the superuser credentials to authenticate", 87 | "Admin Dashboard ... https://admin.masdemo.apps-crc.testing", 88 | "Username .......... DIZv7X2eavITxb3vKtf3XRsY85UYj7FV", 89 | "Password .......... 58Wi9n9U4yVgZ7AhXVRS4eIqEQSnMhsq" 90 | ] 91 | } 92 | ``` 93 | In case you don't have the log anymore, you can always retrieve them from the `masdemo-credentials-superuser` secret in the `mas-masdemo-core` namespace. 94 | After the installation completes, you may want to log into MAS administration using the MAS superuser credentials. You can fing the urls to use in the `Networking -> Routes` of the `mas-masdemo-core` namespace. First of all click on the `masdemo-api` url and accept the self-signed certificate. In this way your browser won't have a problem in accessing the MAS APIs later on. Ignore the execption you will get and close that window. Then go back to the cluster UI and click the `masdemo-admin` url. Once in MAS, navigate to the `Users` section, filter by `wilson`, then click on the `wilson` user and reset his password. Wait for the syncronization to finish. Log out and login as `wilson`. In the MAS Navigator you should see the Manage tile and you should be able to launch into it. 95 | When you are done with your environment, you can stop it using the `crc stop` command. Of course, you can restart it when needed, using the `crc start` command. -------------------------------------------------------------------------------- /android/hosts_go_mas.txt: -------------------------------------------------------------------------------- 1 | 10.0.2.2 console-openshift-console.apps-crc.testing 2 | 10.0.2.2 oauth-openshift.apps-crc.testing 3 | 10.0.2.2 api.masdemo.apps-crc.testing 4 | 10.0.2.2 admin.masdemo.apps-crc.testing 5 | 10.0.2.2 auth.masdemo.apps-crc.testing 6 | 10.0.2.2 home.masdemo.apps-crc.testing 7 | 10.0.2.2 maslocal.home.masdemo.apps-crc.testing 8 | 10.0.2.2 maslocal-all.manage.masdemo.apps-crc.testing 9 | 10.0.2.2 maslocal.manage.masdemo.apps-crc.testing 10 | -------------------------------------------------------------------------------- /masdevops.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: mas-devops 5 | labels: 6 | security.openshift.io/scc.podSecurityLabelSync: 'false' 7 | openshift.io/run-level: '0' 8 | pod-security.kubernetes.io/audit: privileged 9 | pod-security.kubernetes.io/warn: privileged 10 | --- 11 | apiVersion: v1 12 | kind: ServiceAccount 13 | metadata: 14 | name: mas-devops-service-account 15 | namespace: mas-devops 16 | --- 17 | apiVersion: rbac.authorization.k8s.io/v1 18 | kind: ClusterRoleBinding 19 | metadata: 20 | name: mas-devops-role 21 | roleRef: 22 | apiGroup: rbac.authorization.k8s.io 23 | kind: ClusterRole 24 | name: cluster-admin 25 | subjects: 26 | - kind: ServiceAccount 27 | name: mas-devops-service-account 28 | namespace: mas-devops 29 | --- 30 | apiVersion: apps/v1 31 | kind: Deployment 32 | metadata: 33 | labels: 34 | app: mas-devops-app 35 | name: mas-devops-app 36 | namespace: mas-devops 37 | spec: 38 | replicas: 1 39 | selector: 40 | matchLabels: 41 | app: mas-devops-app 42 | strategy: 43 | type: Recreate 44 | template: 45 | metadata: 46 | labels: 47 | app: mas-devops-app 48 | spec: 49 | serviceAccountName: mas-devops-service-account 50 | containers: 51 | - name: main 52 | imagePullPolicy: Always 53 | image: quay.io/ibmmas/cli:latest 54 | command: [ "/bin/bash", "-c", "--" ] 55 | args: [ "while true; do sleep 30; done;" ] 56 | securityContext: 57 | runAsUser: 0 58 | -------------------------------------------------------------------------------- /masinst.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | REM -------------------------------------------------------- 3 | REM Windows Batch script to install MAS Manage on OCP Local 4 | REM with only UDS external 5 | REM -------------------------------------------------------- 6 | REM Make sure you have logged into your local OCP before 7 | REM staring the script 8 | REM "masinst" will deploy an internal DB2 9 | REM "masinst mssql" will deploy using the external MSSQL 10 | REM -------------------------------------------------------- 11 | echo +----------------------------------+ 12 | if "%1" EQU "mssql" (echo ^| Deployment for an external MSSQL ^|) else (echo ^| Deployment for an internal DB2 ^|) 13 | echo +----------------------------------+ 14 | for /f "tokens=2" %%i in ('crc status ^| findstr /c:"OpenShift:"') do if "%%i" NEQ "Running" (echo OpenShift Local is not running while it should. Issue 'crc start' and set the environment. && exit /B 1) 15 | oc get pods > NULL 2>&1 16 | if %errorlevel% NEQ 0 echo Either the OpenShift Local environment is not set properly or we are not logged into a cluster. && exit /B 1 17 | echo Ready to start the installation. 18 | pause 19 | 20 | REM Install the local path provisioner, from the Rancher distro, slightly modified to work on OCP 21 | REM *** This is no more needed from CRC 2.11.0, because there is an equivalent default storage class (crc-csi-hostpath-provisioner) 22 | REM oc apply -f local-path-storage-mod.yaml 23 | 24 | REM Creates a pod to run the MAS ansible collection 25 | oc apply -f masdevops.yaml 26 | oc project mas-devops 27 | 28 | REM Waits for the pod to come to life 29 | :notrunning 30 | for /f "tokens=1,3" %%i in ('oc get pods ^| findstr /c:"mas-devops-app-"') do set POD=%%i&set STATUS=%%j 31 | echo %STATUS% 32 | if %STATUS% NEQ Running timeout 5 > NUL & goto notrunning 33 | 34 | REM Cleanup in case of a second run (idempotent) 35 | oc exec %POD% -- rm -r /opt/app-root/src/masloc 36 | 37 | REM Clone the latest collection 38 | oc exec %POD% -- git clone https://github.com/ibm-mas/ansible-devops /opt/app-root/src/masloc/ansible-devops 39 | 40 | REM Creates the directory where all the MAS configuration will go 41 | oc exec %POD% -- mkdir /opt/app-root/src/masloc/masconfig 42 | 43 | REM Uploads the playbook to install MAS on OCP local (this may eventually become part of the MAS collection) 44 | REM --> IMPORTANT <-- You need to modify this file to include your ER key and License ID 45 | if "%1" EQU "mssql" (oc cp mssql/masocpl.yml %POD%:/opt/app-root/src/masloc/ansible-devops/ibm/mas_devops/playbooks) else (oc cp masocpl.yml %POD%:/opt/app-root/src/masloc/ansible-devops/ibm/mas_devops/playbooks) 46 | 47 | REM Uploads your MAS license file 48 | oc cp license.dat %POD%:/opt/app-root/src/masloc 49 | 50 | REM Rebuilds the collection to add the new playbook and installs it 51 | for /f "tokens=6" %%i in ('oc exec %POD% -- bash -c "cd /opt/app-root/src/masloc/ansible-devops/ibm/mas_devops && ansible-galaxy collection build --force" ^| findstr /c:"Created collection"') do set COLL=%%i 52 | oc exec %POD% -- bash -c "cd /opt/app-root/src/masloc/ansible-devops/ibm/mas_devops && ansible-galaxy collection install %COLL% --force" 53 | 54 | REM Run the playbook 55 | if "%1" EQU "mssql" (oc exec %POD% -- bash -c "cd /opt/app-root/src/masloc/ansible-devops/ibm/mas_devops && export MAS_APP_SETTINGS_DEMODATA=True && export MAS_APP_SETTINGS_AIO_FLAG=False && export MAS_APP_SETTINGS_DB_SCHEMA=dbo && export MAS_APP_SETTINGS_TABLESPACE=PRIMARY && export MAS_APP_SETTINGS_INDEXSPACE=PRIMARY && ansible-playbook ibm.mas_devops.masocpl") else (oc exec %POD% -- bash -c "cd /opt/app-root/src/masloc/ansible-devops/ibm/mas_devops && export MAS_APP_SETTINGS_DEMODATA=True && export MAS_APP_SETTINGS_AIO_FLAG=False && ansible-playbook ibm.mas_devops.masocpl") 56 | -------------------------------------------------------------------------------- /masinst.sh: -------------------------------------------------------------------------------- 1 | ## Install the local provisioning storage class 2 | ## oc apply -f local-path-storage-mod.yaml 3 | 4 | ## Creates a pod to run the MAS ansible collection 5 | oc apply -f masdevops.yaml 6 | oc project mas-devops 7 | POD=$(oc get pods | grep -i mas-devops-app | awk '{print $1}') 8 | ## Wait for 3 mins for Pod to start up. 9 | retry=20 10 | while ( [ $retry -gt 0 ] ) 11 | do 12 | str1=$( oc get pods -n mas-devops | grep -i mas-devops-app | grep -i 'running') 13 | if [[ -n ${str1} ]]; 14 | then 15 | echo "Pod is running" 16 | break 17 | fi 18 | sleep 30; 19 | echo "Pod is not running, will check again in 30 sec." 20 | retry=`expr $retry - 1` 21 | done 22 | if [ $retry -eq 0 ] 23 | then 24 | echo " Pod fail to run correctly in 10 Mins!!! " 25 | echo " Please Check what's wrong and re-run the install script " 26 | exit 1 27 | else 28 | echo "Pod is Running Well" 29 | fi 30 | 31 | ## Cleanup in case of a second run 32 | oc exec $POD -- rm -rf /opt/app-root/src/masloc 33 | ## Clone the latest collection 34 | oc exec $POD -- git clone https://github.com/ibm-mas/ansible-devops /opt/app-root/src/masloc/ansible-devops 35 | ## Creates the directory where all the MAS configuration will go 36 | oc exec $POD -- mkdir /opt/app-root/src/masloc/masconfig 37 | # Upload the playbook to install MAS on OCP 38 | oc cp masocpl.yml $POD:/opt/app-root/src/masloc/ansible-devops/ibm/mas_devops/playbooks 39 | ## Uploads your MAS license file 40 | oc cp license.dat mas-devops/$POD:/opt/app-root/src/masloc 41 | IFS=' ' 42 | read -a strarr <<< $(oc exec $POD -- bash -c "cd /opt/app-root/src/masloc/ansible-devops/ibm/mas_devops && ansible-galaxy collection build --force" | grep -i 'Created collection') 43 | oc exec $POD -- bash -c "cd /opt/app-root/src/masloc/ansible-devops/ibm/mas_devops && ansible-galaxy collection install ${strarr[5]} --force" 44 | ## Run the playbook 45 | oc exec $POD -- bash -c "cd /opt/app-root/src/masloc/ansible-devops/ibm/mas_devops && export MAS_APP_SETTINGS_DEMODATA=True && export MAS_APP_SETTINGS_AIO_FLAG=False && ansible-playbook ibm.mas_devops.masocpl" 46 | -------------------------------------------------------------------------------- /masocpl.yml: -------------------------------------------------------------------------------- 1 | - hosts: localhost 2 | any_errors_fatal: true 3 | vars: 4 | mongodb_storage_class: crc-csi-hostpath-provisioner 5 | mongodb_storage_capacity_data: 5Gi 6 | mongodb_storage_capacity_logs: 2Gi 7 | mongodb_replicas: 1 8 | mas_channel: 9.0.x 9 | mas_catalog_version: v9-241107-amd64 10 | mas_workspace_name: "MAS Local" 11 | mas_instance_id: masdemo 12 | mas_workspace_id: maslocal 13 | mas_config_dir: /opt/app-root/src/masloc/masconfig 14 | ibm_entitlement_key: <> 15 | sls_mongodb_cfg_file: /opt/app-root/src/masloc/masconfig/mongo-mongoce.yml 16 | bootstrap: 17 | license_id: <> 18 | license_file: "/opt/app-root/src/masloc/license.dat" 19 | dro_storage_class: crc-csi-hostpath-provisioner 20 | dro_contact: 21 | email: 'nobody@nowhere.com' 22 | first_name: 'nobody' 23 | last_name: 'noone' 24 | 25 | db2_instance_name: 'db2mas' 26 | # Cannot set dbname due to a bug in create_ldap_user.yml 27 | # db2_dbname: 'maxdb' 28 | 29 | db2_data_storage_class: crc-csi-hostpath-provisioner 30 | db2_meta_storage_class: crc-csi-hostpath-provisioner 31 | db2_backup_storage_class: crc-csi-hostpath-provisioner 32 | db2_logs_storage_class: crc-csi-hostpath-provisioner 33 | db2_temp_storage_class: crc-csi-hostpath-provisioner 34 | 35 | db2_data_storage_accessmode: ReadWriteOnce 36 | db2_meta_storage_accessmode: ReadWriteOnce 37 | db2_backup_storage_accessmode: ReadWriteOnce 38 | db2_logs_storage_accessmode: ReadWriteOnce 39 | db2_temp_storage_accessmode: ReadWriteOnce 40 | 41 | db2_data_storage_size: 20Gi 42 | db2_meta_storage_size: 10Gi 43 | db2_backup_storage_size: 10Gi 44 | db2_logs_storage_size: 10Gi 45 | db2_temp_storage_size: 10Gi 46 | 47 | db2_cpu_requests: 500m 48 | db2_memory_requests: 3Gi 49 | db2_ldap_username: 'maximo' 50 | db2_ldap_password: 'maximo' 51 | db2_username: 'maximo' 52 | 53 | mas_app_id: 'manage' 54 | mas_app_channel: 9.0.x 55 | mas_app_upgrade_strategy: 'Manual' 56 | # This does not work at the moment and there is a workaround for it in the bat file 57 | # a defect has been open and this file will be updated when it will be fixed 58 | # mas_app_settings_demodata: 'true' 59 | mas_app_settings_aio_flag: 'false' 60 | 61 | roles: 62 | - ibm.mas_devops.ibm_catalogs 63 | - ibm.mas_devops.common_services 64 | - ibm.mas_devops.cert_manager 65 | - ibm.mas_devops.mongodb 66 | - ibm.mas_devops.sls 67 | - ibm.mas_devops.dro 68 | - ibm.mas_devops.db2 69 | - ibm.mas_devops.suite_db2_setup_for_manage 70 | - ibm.mas_devops.gencfg_workspace 71 | - ibm.mas_devops.suite_install 72 | - ibm.mas_devops.suite_config 73 | - ibm.mas_devops.suite_verify 74 | - ibm.mas_devops.suite_app_install 75 | - ibm.mas_devops.suite_app_config -------------------------------------------------------------------------------- /mssql/README.md: -------------------------------------------------------------------------------- 1 | # MAS Local on MS SQL 2 | A few scripts to bring up a MAS Manage on OCP Local with an external MS SQL 3 | 4 | ## Summary 5 | These instructions will allow you to have a fully functional MAS Core + Manage, that has the Suite License Server (SLS) on board, while UDS is either slim or remote and Manage uses a MS SQL Server outside of the OpenShift cluster, but resident on the same PC. 6 | 7 | ## What you would need to run MS SQL Server 8 | For this type of deployment you will need a laptop able to handle OCP Local with 12 vCPU and 20 GiB of memory + a running MS SQL Server. (Hopefully a Lenovo ThinkPad P15 with 32 GiB of memory is enough). 9 | You can download and install the MS SQL Server Developer's version from the Microsoft site at this link : https://www.microsoft.com/en-us/sql-server/sql-server-downloads 10 | During the install, don't forget to add the current user as the administrator and make sure the full text search option is selected for the engine. All other defaults are good (e.g. Instance ID = MSSQLSERVER). Install also the SQL Server Management Studio (SSMS). 11 | Open the SQL Server Configuration Manager and make sure the services are running (SQL Full-text Filter Daemon Launcher, SQL Server). Moreover, in *SQL Server Network Configuration*, *Protocols for MSSQLSERVER*, *TCP/IP* has to be enabled. Double click on it, switch to the *IP Addresses* tab, and make sure the IP Address 127.0.0.1 is Active and Enabled (both should be *Yes*). 12 | Run the Microsoft SQL Server Management Studio and log in (the current user should be the administrator). 13 | Create a new database called **maxdb80**. Configure it as described at this link: https://www.ibm.com/docs/en/mas-cd/continuous-delivery?topic=deployment-configuring-microsoft-sql-server. Use `maximopassword` as the password for the `MAXIMO` userid. If you want to use a different password, you will have to modify the `masocpl.yml` file in this directory and change the `jdbc_instance_password` field, to match the password you have used. 14 | At this point you should install OpenShift Local, if you have not done that already. The next section will provide a few info. 15 | 16 | ## What you would need to run OpenShift Local 17 | To get OpenShift Local and install it, the instructions are the same of those described in the main README. The configuration is different and these is the set of commands to configure it correctly and start it 18 | ``` 19 | crc config set consent-telemetry no 20 | crc config set host-network-access true 21 | crc config set cpus 12 22 | crc config set memory 27648 23 | crc config set disk-size 200 24 | crc start 25 | ``` 26 | At this point you should have an OpenShift running and ready to host MAS Core + Manage. From the last ourput of `crc start` you may want to record the password to log into the cluster. 27 | 28 | ## What you would need to run MAS Manage and you would install MAS Core and MAS Manage 29 | The instructions are exactly those written in the main README, but instead of customizing the file `masocpl.yml` in the `mas-local` directory, you'll need to customize the one in this directory (i.e. `mas-local\mssql`). Moreover there is a difference in the way you will invoke the batch file to run the installation for an external MS SQL. The command is `masinst mssql`. 30 | When the installation is completed, follow the instructions at the end of the main README, to retrieve the MAS superuser credentials, accept the self-signed certificates, log as the MAS superuser, reset the password of the user `wilson`, and then log as him to access Manage. -------------------------------------------------------------------------------- /mssql/masocpl.yml: -------------------------------------------------------------------------------- 1 | - hosts: localhost 2 | any_errors_fatal: true 3 | vars: 4 | mongodb_storage_class: crc-csi-hostpath-provisioner 5 | mongodb_storage_capacity_data: 5Gi 6 | mongodb_storage_capacity_logs: 2Gi 7 | mongodb_replicas: 1 8 | mas_channel: 9.0.x 9 | mas_catalog_version: v9-240625-amd64 10 | mas_workspace_name: "MAS Local" 11 | mas_instance_id: masdemo 12 | mas_workspace_id: maslocal 13 | mas_config_dir: /opt/app-root/src/masloc/masconfig 14 | ibm_entitlement_key: <> 15 | sls_mongodb_cfg_file: /opt/app-root/src/masloc/masconfig/mongo-mongoce.yml 16 | bootstrap: 17 | license_id: <> 18 | license_file: "/opt/app-root/src/masloc/license.dat" 19 | dro_storage_class: crc-csi-hostpath-provisioner 20 | dro_contact: 21 | email: 'nobody@nowhere.com' 22 | first_name: 'nobody' 23 | last_name: 'noone' 24 | configure_external_db: true 25 | mas_config_scope: 'system' 26 | db_instance_id: maxdb80 27 | db_username: MAXIMO 28 | # mas_app_settings_demodata: 'true' 29 | # mas_app_settings_aio_flag: 'false' 30 | # mas_app_settings_db_schema: dbo 31 | # mas_app_settings_tablespace: PRIMARY 32 | # mas_app_settings_indexspace: PRIMARY 33 | jdbc_instance_password: maximopassword 34 | jdbc_url: "jdbc:sqlserver://host.crc.testing:1433;databaseName=maxdb80;integratedSecurity=false;sendStringParametersAsUnicode=false;responseBuffering=adaptive;encrypt=false;" 35 | mas_app_id: 'manage' 36 | mas_app_channel: 9.0.x 37 | mas_app_upgrade_strategy: 'Manual' 38 | 39 | roles: 40 | - ibm.mas_devops.ibm_catalogs 41 | - ibm.mas_devops.common_services 42 | - ibm.mas_devops.cert_manager 43 | - ibm.mas_devops.mongodb 44 | - ibm.mas_devops.sls 45 | - ibm.mas_devops.dro 46 | - ibm.mas_devops.gencfg_workspace 47 | - ibm.mas_devops.gencfg_jdbc 48 | - ibm.mas_devops.suite_install 49 | - ibm.mas_devops.suite_config 50 | - ibm.mas_devops.suite_verify 51 | - ibm.mas_devops.suite_app_install 52 | - ibm.mas_devops.suite_app_config 53 | --------------------------------------------------------------------------------