The command and shell modules default to reporting changed: true because Ansible cannot know if the command modified the system. If you run a read-only command (like grep or df), you should use changed_when: false.
command
list nodes
1 2 3 4 5
# all nodes ansible all --list-hosts
# list specify group nodes ansible client_servers -i inventory/hosts.yaml --list-hosts
run a quick command
1 2 3 4 5 6 7 8 9 10
ansible <pattern> -m <module> -a "<arguments>"
# Run on a single specific node using the shell module ansible all -m shell -a "df -h | grep /dev/nvme" --limit"node1"
# Run on multiple specific nodes ansible all -m shell -a "systemctl status kubelet" -l "node1,node2"
# Run on an exact IP address ansible app_group -m shell -a "podman ps -a" --limit"192.168.1.10"