Every time I install a package, I want to make sure I have the latest version. That means I need to run apt-get update, or it’s equivalent, before I install the package. Currently I have an 'apt update_cache=yes" task running before every package install. That results in multiple ‘apt-get update’ calls. Is there a good way to make that only happen once per ansible-playbook --sudo /etc/ansible/webservices.yml
?
Would state=latest
update the cache only once per run?
Would that work with other package management modules, like yum?