Hi@akhtar,
You can use the yum_repository module in Ansible-playbook. This allows us to configure or remove yum in the remote nodes. You need to set state value as absent.
- hosts: all
  tasks:
  - name: Remove repository (and clean up left-over metadata)
    yum_repository:
      name: epel
      file: docker_repo
      state: absent