jbride
2018-07-17 8ff93bf9a8dd8cea3a8d5ac9709551dc216bc523
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
- 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