mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-08 14:20:04 -07:00
pacman: implement change detection for update_cache=true; add cache_updated return value (#4337)
* Implement change detection for update_cache=true. Add cache_updated return value. * ... * Make sure pacman --sync --list is called only as often as necessary.
This commit is contained in:
parent
ca2c64b5ca
commit
cf4d68ac50
5 changed files with 122 additions and 13 deletions
|
@ -10,3 +10,4 @@
|
|||
- include: 'basic.yml'
|
||||
- include: 'package_urls.yml'
|
||||
- include: 'remove_nosave.yml'
|
||||
- include: 'update_cache.yml'
|
||||
|
|
23
tests/integration/targets/pacman/tasks/update_cache.yml
Normal file
23
tests/integration/targets/pacman/tasks/update_cache.yml
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
- name: Make sure package cache is updated
|
||||
pacman:
|
||||
update_cache: true
|
||||
|
||||
- name: Update package cache again (should not be changed)
|
||||
pacman:
|
||||
update_cache: true
|
||||
register: update_cache_idem
|
||||
|
||||
- name: Update package cache again with force=true (should be changed)
|
||||
pacman:
|
||||
update_cache: true
|
||||
force: true
|
||||
register: update_cache_force
|
||||
|
||||
- name: Check conditions
|
||||
assert:
|
||||
that:
|
||||
- update_cache_idem is not changed
|
||||
- update_cache_idem.cache_updated == false
|
||||
- update_cache_force is changed
|
||||
- update_cache_force.cache_updated == true
|
Loading…
Add table
Add a link
Reference in a new issue