---
- name: Retrieve efs
  oc_obj:
    state: list
    kind: dc
    selector: "provisioners-infra=efs"
    namespace: "{{openshift_provisioners_project}}"
  register: efs_dc
  when: openshift_provisioners_efs | bool

- name: stop efs
  oc_scale:
    kind: dc
    name: "{{ object }}"
    namespace: "{{openshift_provisioners_project}}"
    replicas: 0
  with_items: "{{ efs_dc.results.results[0]['items'] | map(attribute='metadata.name') | list }}"
  loop_control:
    loop_var: object
  when: openshift_provisioners_efs | bool
