---
|
- name: define ocp_project
|
set_fact:
|
ocp_project: "bxms-dm-{{guid}}"
|
|
- name: "Create project for workload {{ocp_project}}"
|
shell: "oc new-project {{ocp_project}}"
|
|
- name: Make sure we go back to default project
|
shell: "oc project default"
|
|
- name: Load dm imagestream
|
shell: "oc create -f {{DM_IS_URL}} -n {{ocp_project}}"
|
|
- name: Initialize the project template
|
shell: "oc create -f https://raw.githubusercontent.com/gpe-mw-training/bxms_decision_mgmt_foundations_lab/master/resources/rhdm7-full-ng.yaml -n {{ocp_project}}"
|
|
- name: Prep local filesystem for temp files
|
file:
|
path: "/tmp/{{guid}}"
|
state: directory
|
|
- name: Initialize OCP resources from the project template using CLUSTER {{ ocp_apps_domain }}
|
shell: |
|
oc new-app --name=dm-demo -n {{ocp_project}} --template=rhdm7-full-ng \
|
-p RHT_IMAGE_STREAM_NAMESPACE={{ocp_project}} \
|
-p KIE_ADMIN_PWD=test1234! \
|
-p MAVEN_REPO_PASSWORD=test1234! \
|
-p CLUSTER={{ocp_apps_domain}} \
|
-p PROJECT={{ocp_project}} \
|
-p APPLICATION_NAME=gpte > /tmp/{{guid}}/gpte-dm-demo.txt
|
|
- include: ./wait_for_build.yml
|
static: no
|
vars:
|
build_to_wait:
|
- gpte-custom-kieserver
|
- gpte-ng-dmf
|
|
- name: resume gpte-rhdmcentr
|
shell: oc rollout resume dc/gpte-rhdmcentr -n {{ocp_project}}
|
- include: ./wait_for_deploy.yml
|
static: no
|
vars:
|
pod_to_wait:
|
- gpte-rhdmcentr
|
|
- name: resume gpte-kieserver
|
shell: oc rollout resume dc/gpte-kieserver -n {{ocp_project}}
|
- include: ./wait_for_deploy.yml
|
static: no
|
vars:
|
pod_to_wait:
|
- gpte-kieserver
|
|
- name: resume gpte-ng-dmf
|
shell: oc rollout resume dc/gpte-ng-dmf -n {{ocp_project}}
|
- include: ./wait_for_deploy.yml
|
static: no
|
vars:
|
pod_to_wait:
|
- gpte-ng-dmf
|
|
- name: Annotate the empty project as requested by user
|
shell: "oc annotate namespace {{ocp_project}} openshift.io/requester={{ocp_username}} --overwrite"
|
|
- name: Give ocp_username access to ocp_project; user = {{ocp_username}}
|
shell: "oc policy add-role-to-user admin {{ocp_username}} -n {{ocp_project}}"
|
|
- name: workload Tasks Complete
|
debug:
|
msg: workload Tasks Complete
|