mysql icon indicating copy to clipboard operation
mysql copied to clipboard

Don't `update_cache` when running APT install task

Open rwanyoike opened this issue 9 years ago • 3 comments

This is the only ANXS playbook I've noted that runs update_cache while installing packages. I think it's better to depend on https://github.com/ANXS/apt (or not), which is able to check how recent the cache was updated, and save time. I noticed this because the speed difference had an impact on a slow connection.

- name: MySQL | Make sure the MySQL packages are installed
  apt:
    pkg: "{{item}}"
    update_cache: yes
  with_items: mysql_packages

rwanyoike avatar Aug 13 '15 18:08 rwanyoike

+1 This is the only role that has this on my end as well. It is generally done in a common role or in your playbook. The mysql role should only install, not update cache.

patrickheeney avatar Aug 13 '15 20:08 patrickheeney

Better yet, using something like cache_valid_time: 86400 would update it only if it is one day old...

If only every role did that... we wouldn't need a common role to do it.

mikegleasonjr avatar Oct 18 '15 03:10 mikegleasonjr

Sounds valid to me. I checked some other repos and usually we don't add cache_valid_time

Feel free top open a PR

soupdiver avatar Oct 19 '15 07:10 soupdiver