commit | author | age
|
37d997
|
1 |
--- |
JL |
2 |
- name: define ocp_project |
|
3 |
set_fact: |
|
4 |
ocp_project: "optaweb-employee-rostering-{{guid}}" |
|
5 |
|
|
6 |
- name: Create project for OptaPlanner Employee Rostering Demo |
|
7 |
shell: | |
|
8 |
oc new-project {{ocp_project}} \ |
|
9 |
--display-name="OptaPlanner Employee Rostering Demo" \ |
|
10 |
--description="OptaPlanner Employee Rostering Demo" |
|
11 |
ignore_errors: true |
|
12 |
|
|
13 |
- name: "Label namespace" |
|
14 |
command: "oc label namespace {{ocp_project}} AAD='{{guid}}'" |
|
15 |
|
|
16 |
- name: "Create PostgreSQL database" |
|
17 |
shell: "oc new-app postgresql-persistent -n {{ocp_project}}" |
|
18 |
|
|
19 |
- name: "Create OptaWeb app" |
|
20 |
shell: "oc new-app --name employee-rostering \ |
|
21 |
--strategy=docker \ |
|
22 |
java:8~{{optaweb_git_repository}}#{{optaweb_git_branch}} \ |
9cb564
|
23 |
-e JAVA_TOOL_OPTIONS=\"-XX:MaxHeapSize=2g -XX:InitialHeapSize=2g\" \ |
37d997
|
24 |
-n {{ocp_project}}" |
JL |
25 |
|
|
26 |
- name: "Share PostgreSQL secret with OptaWeb app" |
|
27 |
shell: "oc set env dc/employee-rostering --from=secret/postgresql -n {{ocp_project}}" |
|
28 |
|
|
29 |
- name: "Expose the service" |
|
30 |
shell: "oc expose svc/employee-rostering -n {{ocp_project}}" |
|
31 |
|
|
32 |
- name: Wait 10 seconds for the builds to be defined |
|
33 |
pause: |
|
34 |
seconds: 10 |
|
35 |
|
|
36 |
#### Wait for the build to complete before slapping on the quota .... |
|
37 |
- include_tasks: ./wait_for_build.yml |
|
38 |
vars: |
|
39 |
build_to_wait: |
|
40 |
- employee-rostering |
|
41 |
|
|
42 |
#### Wait for the deployment to complete before slapping on the quota ... |
|
43 |
- include_tasks: ./wait_for_deploy.yml |
|
44 |
vars: |
|
45 |
pod_to_wait: |
|
46 |
- employee-rostering |
|
47 |
|
|
48 |
- name: Annotate the completed project as requested by user |
|
49 |
shell: "oc annotate namespace {{ocp_project}} openshift.io/requester={{ocp_username}} --overwrite" |
|
50 |
|
|
51 |
- name: Give user access to the completed project |
|
52 |
shell: "oc policy add-role-to-user admin {{ocp_username}} -n {{ocp_project}}" |
|
53 |
|
|
54 |
- name: workload Tasks Complete |
|
55 |
debug: |
|
56 |
msg: workload Tasks Complete |