How to set condition module executations in Ansible Playbook with Example?

Example – 1 For CENTOS / RHEL Example – 1 For Ubuntu