create-project.yml 2.5 KB

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