Inventory cache not flushed when using --flush-cache
#73699
Labels
affects_2.9
This issue/PR affects Ansible v2.9
bug
This issue/PR relates to a bug.
has_pr
This issue has an associated PR.
inventory
Inventory category
P3
Priority 3 - Approved, No Time Limitation
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
SUMMARY
The inventory cache is not flushed when using
--flush-cache
ISSUE TYPE
COMPONENT NAME
cli and/or inventory manager
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Debian 10
STEPS TO REPRODUCE
ansible.cfg:
Dummy inventory plugin
bug_report.py
displaying if the inventory manager gavecache=True
or not:Inventory yaml file
bug_report.yml
:EXPECTED RESULTS
The doc state in https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html#inventory-cache:
From previous minimal test case, as far as I understand the doc and comments in other inventory plugins, the first call, using
--flush-cache
, should outputUpdating cache
. The second one should outputUsing data from cache
:ACTUAL RESULTS
No matter if using
--flush-cache
or not, the inventory manager is settingcache=True
and the plugin always showsUsing data from cache
:Looking at source code in current devel branch, it seems
--flush-cache
only flush facts and ignore inventory: https://github.com/ansible/ansible/blob/devel/lib/ansible/cli/playbook.py#L208The text was updated successfully, but these errors were encountered: