Multiple Checks via single task

Hi All,

Request your help on how to perform the below check via a single task in ansible playbook

Check whether the hostname is fully qualified domain name : hostname -f
if exist then check

Check the IP address of the doamin name : nslookup `hostname -f``
if exist then check

Check whether the IP address and the Fully qualified domain name exist in the /etc/host file.

From,
Vino.B

It's not possible to do in a single task, you need several tasks.