commit | author | age
|
002ef8
|
1 |
--- |
J |
2 |
|
b3f3f9
|
3 |
# ######### Default project ############## |
4be029
|
4 |
#- name: Create project for workload; project = {{ocp_project}} |
J |
5 |
# shell: "oc new-project {{ocp_project}}" |
002ef8
|
6 |
|
4be029
|
7 |
#- name: Make sure we go back do default project |
J |
8 |
# shell: "oc project default" |
002ef8
|
9 |
|
4be029
|
10 |
#- name: Delete default limitrange |
J |
11 |
# shell: | |
|
12 |
# oc delete limitrange {{ocp_project}}-core-resource-limits -n {{ocp_project}} |
002ef8
|
13 |
|
4be029
|
14 |
#- name: Create a new limitrange |
J |
15 |
# template: |
|
16 |
# src: templates/limitrange.yaml |
|
17 |
# dest: /tmp/{{ocp_project}}_limitrange.yaml |
|
18 |
#- shell: | |
|
19 |
# oc create -f /tmp/{{ocp_project}}_limitrange.yaml -n {{ocp_project}} |
002ef8
|
20 |
|
b3f3f9
|
21 |
# ############################################################### |
J |
22 |
|
|
23 |
|
|
24 |
|
|
25 |
# ######### Constraint project ############## |
|
26 |
|
|
27 |
- name: Create project; project = {{ocp_constraints_project}} |
|
28 |
shell: "oc new-project {{ocp_constraints_project}}" |
|
29 |
|
|
30 |
- name: Give ocp_username access to {{ocp_constraints_project}}; user = {{ocp_username}} |
|
31 |
shell: "oc policy add-role-to-user admin {{ocp_username}} -n {{ocp_constraints_project}}" |
|
32 |
|
|
33 |
- name: Delete default limitrange |
|
34 |
shell: | |
|
35 |
oc delete limitrange {{ocp_constraints_project}}-core-resource-limits -n {{ocp_constraints_project}} |
|
36 |
|
|
37 |
- name: Create a new limitrange |
|
38 |
template: |
|
39 |
src: templates/constraints_limitrange.yaml |
|
40 |
dest: /tmp/{{ocp_constraints_project}}_limitrange.yaml |
|
41 |
- shell: | |
|
42 |
oc create -f /tmp/{{ocp_constraints_project}}_limitrange.yaml -n {{ocp_constraints_project}} |
|
43 |
|
|
44 |
|
b6a44e
|
45 |
- name: Annotate the empty project as requested by user |
ae2d59
|
46 |
shell: "oc annotate namespace {{ocp_constraints_project}} openshift.io/requester={{ocp_username}} --overwrite" |
b6a44e
|
47 |
|
J |
48 |
- name: Give ocp_username access to ocp_project; user = {{ocp_username}} |
ae2d59
|
49 |
shell: "oc policy add-role-to-user admin {{ocp_username}} -n {{ocp_constraints_project}}" |
J |
50 |
|
|
51 |
# ############################################################### |
b6a44e
|
52 |
|
002ef8
|
53 |
- name: workload Tasks Complete |
J |
54 |
debug: |
|
55 |
msg: workload Tasks Complete |