To check if ansible is working you can ping in all hosts using the following command
ansible -m ping all
ansible -m <MODULO> -a <PARAMETRO> <HOSTS>
or
ansible <HOSTS> -m <MODULO> -a <PARAMETRO>
Note: for a complete list of modules visit https://docs.ansible.com/ansible/latest/index.html
apt
moduleThis module simply run apt. the example code is
ansible <HOST> -m apt -a "name=ncdu state=present update_cache=yes" --become
setup
moduleRetrieve all informations about the hosts.
ansible <HOST> -m setup
If you want to filter the infos
ansible <HOST> -m setup -a "filter=ansible_distribution"