= ocp-workload-Vert.x-Reactica

== Overview

This ansible playbook role are used to deploy a demo on RHPDS. Instructions below here are for developing and testing the playbook. To run the demo go to https://rhpds.redhat.com and search the catalog for **Reactica Demo**.

=== Purpose
This roles create a reactive demo called Reactica that is show-casing an event based reactive application using Eclipse Vert.x, Red Hat AMQ and Red Hat DataGrid.

For more details about the demo please see (https://github.com/reactica/rhte-demo)[https://github.com/reactica/rhte-demo]


=== Deploy a Workload with the `ocp-workload` playbook

To deploy an new version of the demo to an environment please use the following script:

----
#!/bin/sh
HOST_GUID=dev310
TARGET_HOST="bastion.$HOST_GUID.openshift.opentlc.com"
OCP_USERNAME="xxxx-redhat.com"
SSH_USER="opentlc-mgr"
SSH_PRIVATE_KEY="id_rsa"
GUID="XXXX"

WORKLOAD="ocp-workload-vertx-reactica"


ansible-playbook -v -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \
              -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \
              -e"ansible_ssh_user=${SSH_USER}" \
              -e"ANSIBLE_REPO_PATH=`pwd`" \
              -e"ocp_username=${OCP_USERNAME}" \
              -e"ocp_workload=${WORKLOAD}" \
              -e"guid=${GUID}" \
              -e"ocp_user_needs_quota=true" \
              -e"ocp_master=master.${HOST_GUID}.openshift.opentlc.com" \
              -e"ocp_apps_domain=apps.${HOST_GUID}.openshift.opentlc.com" \
              -e"ACTION=create"

----

IMPORTANT: You need to replace the **HOST_GUID**, **GUID** and **OCP_USERNAME** with your own credentials and you need access to the bastion host using your private SSH key. Please contact rhpds-admin@redhat.com for getting access.

=== To Delete the demo

To remove the demo from the shared cluster run the following script:

----
#!/bin/sh
HOST_GUID=dev310
TARGET_HOST="bastion.$HOST_GUID.openshift.opentlc.com"
OCP_USERNAME="xxxx-redhat.com"
SSH_USER="opentlc-mgr"
SSH_PRIVATE_KEY="id_rsa"
GUID="XXXX"

WORKLOAD="ocp-workload-vertx-reactica"

ansible-playbook -v -i ${TARGET_HOST}, ./configs/ocp-workloads/ocp-workload.yml \
              -e"ansible_ssh_private_key_file=~/.ssh/${SSH_PRIVATE_KEY}" \
              -e"ansible_ssh_user=${SSH_USER}" \
              -e"ANSIBLE_REPO_PATH=`pwd`" \
              -e"ocp_username=${OCP_USERNAME}" \
              -e"ocp_workload=${WORKLOAD}" \
              -e"guid=${GUID}" \
              -e"ocp_user_needs_quota=true" \
              -e"ocp_master=master.${HOST_GUID}.openshift.opentlc.com" \
              -e"ocp_apps_domain=apps.${HOST_GUID}.openshift.opentlc.com" \
              -e"ACTION=remove"
----

IMPORTANT: You need to replace the **HOST_GUID**, **GUID** and **OCP_USERNAME** with your own credentials and you need access to the bastion host using your private SSH key. Please contact rhpds-admin@redhat.com for getting access.

