Simple base of an ansible playbook to perform the equivalent to sudo apt update && sudo apt upgrade on debian hosts.
An example of the command line usage is:
ansible-playbook -i ~/mydirectory/inventory -l mytargets apt-update-upgrade.yml --ask-become-pass
Example of an inventory file:
my servers
[mytargets]
192.168.10.50 ansible_ssh_user=susy ansible_ssh_private_key_file=/.ssh/susy_id_rsa
192.168.10.51 ansible_ssh_user=mary ansible_ssh_private_key_file=/.ssh/mary_id_rsa
192.168.10.52:831 ansible_ssh_user=ralph ansible_ssh_private_key_file=~/.ssh/ralph_id_rsa
[all:vars] ansible_python_interpreter=/usr/bin/python3