---
- name: Create a k8s ResourceQuota
  community.okd.k8s:
    api_key: "{{ communishift_ocp_api_token }}"
    host: "{{ communishift_ocp_api_host }}"
    state: present
    definition:
      apiVersion: v1
      kind: ResourceQuota
      metadata:
        name: "{{ item.value.name }}-quota"
        namespace: "{{ item.value.name }}"
      spec:
        hard:
          cpu: "{{ item.value.cpu_requests | default('1') }}" # requests.cpu
          memory: "{{ item.value.memory_requests | default('1Gi') }}" # requests.memory
          limits.cpu: "{{ item.value.cpu_limits | default('1') }}"
          limits.memory: "{{ item.value.memory_limits | default('2Gi') }}"
          requests.storage: "{{ item.value.storage_requests | default('5Gi') }}"
          persistentvolumeclaims: "1"
          pods: "2"
          replicationcontrollers: 1
