Created
November 6, 2012 18:32
-
-
Save svyatov/4026576 to your computer and use it in GitHub Desktop.
Update apt cache once per play
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- apt: update-cache=yes | |
only_if: is_unset("$apt_cache_updated") | |
register: apt_cache_updated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put this file to something like
playbooks/global_tasks
and use like so......wherever you want - cache updating will be performed just once.
If you need to force update (after adding new repo for example) - just use
apt
module as usual instead of this include:By the way, the case above can be impoved this way: