---
- name: Check for docker-excluder
  stat:
    path: /sbin/{{ r_openshift_excluder_service_type }}-docker-excluder
  register: docker_excluder_stat

- name: Enable docker excluder
  command: "/sbin/{{ r_openshift_excluder_service_type }}-docker-excluder exclude"
  when:
  - r_openshift_excluder_enable_docker_excluder | bool
  - docker_excluder_stat.stat.exists

- name: Check for openshift excluder
  stat:
    path: /sbin/{{ r_openshift_excluder_service_type }}-excluder
  register: openshift_excluder_stat

- name: Enable openshift excluder
  command: "/sbin/{{ r_openshift_excluder_service_type }}-excluder exclude"
  when:
  - r_openshift_excluder_enable_openshift_excluder | bool
  - openshift_excluder_stat.stat.exists
