create-project.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ---
  2. # Creates an ICHP-like project in the cluster.
  3. #
  4. # Pass variables to this playbook on the command line (-e):
  5. #
  6. # user: the user requesting the project (role.requester)
  7. # project: the name of the project (role.name)
  8. # rbac: last token of "ichp-project-${foo}"
  9. # (admin, editor, viewer, debugger)
  10. # (becomes role.rbac_level, defaults to "editor")
  11. #
  12. # For anything more complex, create a vars file and load it (-e @file.yml).
  13. # See the structure of the vars below. Generally do not set egress_ip.
  14. #
  15. # TODO: establish egress IP? (openshift.egress_range)
  16. # TODO: remove egress IPs without their corresponding projects
  17. #
  18. - name: Create an ICHP-lookalike project.
  19. hosts: workstation.lab.example.com
  20. gather_subset: min
  21. become: no
  22. tasks:
  23. # Get auth info, and test comms.
  24. - include_role:
  25. name: check-env
  26. - include_role:
  27. name: create-ichp-project
  28. vars:
  29. role:
  30. requester: "{{ user }}"
  31. name: "{{ project }}"
  32. displayname: "{{ displayname | default(omit) }}"
  33. rbac_level: "ichp-project-{{ rbac | default('editor') }}"
  34. egress_ip: "192.168.50.38"
  35. #egress_ip: an available egress IP to allocate to the project
  36. #quota: compute resourcequotas
  37. # requests: compute reservation
  38. # cpu: max cpu reserved (1500m, 1.5 CPU)
  39. # memory: max memory reserved (2048Mi, 2Gi)
  40. # limits: compute limits
  41. # cpu: max cpu consumed (4000m, 4 CPUs)
  42. # memory: max memory consumed (4096Mi, 4Gi)
  43. #lrange: compute limitranges, for both container and pod
  44. # default: default limits and requests (no defaults)
  45. # limit:
  46. # cpu:
  47. # memory:
  48. # request:
  49. # cpu:
  50. # memory:
  51. # max: maximum limits
  52. # cpu: maximum cpu limit (4000m, 4 cpus)
  53. # memory: maximum memory limit (4096Mi, 4Gi)
  54. # min: minimum requests
  55. # cpu: minimum requested cpu (50m, 5%)
  56. # memory: minimum requested memory (64Mi)
  57. # ratio: max limit-to-request ratio (x-to-1)
  58. # cpu: cpu lrr (4)
  59. # memory: memory lrr (4)
  60. ...