Ansible PC has the following packages installed
apt install ansible sshpass
remote PC has the following packages installed
apt install python-apt python aptitude openssh-server
running you playbook little -k for ssh password, big -K for sudo password
ansible-playbook -i hosts playbook.yml -k -K
Setting up passwordless sudo
nano /etc/sudoer
add line at the end of the file and replace john with your user
john ALL=(ALL) NOPASSWD:ALL