ansible -i Inventory -m apt -a "upgrade=yes update_cache=yes cache_valid_time=86400" -b -B 3600 all
This command does the following:
1. Use the inventory file named "Inventory"
2. Run the Ansible module "apt"
3. Run the ad-hoc command for the apt module "upgrade=yes update_cache=yes cache_valid_time=86400"
4. The -b makes the user become sudo.
5.