diff options
author | anvitpusalkar <143819336+anvitpusalkar@users.noreply.github.com> | 2024-10-30 19:59:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-30 19:59:01 +0100 |
commit | 2c6b78f5166392491f43c07504029d02aecc3380 (patch) | |
tree | 83f2e7dbce0e8b42ccba478b392f256427c83255 /test | |
parent | Fix returning unreachable for looped tasks (#84049) (diff) | |
download | ansible-2c6b78f5166392491f43c07504029d02aecc3380.tar.xz ansible-2c6b78f5166392491f43c07504029d02aecc3380.zip |
Add --flush-cache option for ansible and ansible-console (#84149)
* Allow CLIs that accept inventory options to flush the inventory cache(s) and fact cache
Fixes #83749
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/targets/adhoc/runme.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/integration/targets/adhoc/runme.sh b/test/integration/targets/adhoc/runme.sh index eda6d66192..1b52947761 100755 --- a/test/integration/targets/adhoc/runme.sh +++ b/test/integration/targets/adhoc/runme.sh @@ -7,3 +7,11 @@ ansible -a 'sleep 20' --task-timeout 5 localhost |grep 'The command action faile # -a parsing with json ansible --task-timeout 5 localhost -m command -a '{"cmd": "whoami"}' | grep 'rc=0' + +# test ansible --flush-cache +export ANSIBLE_CACHE_PLUGIN=jsonfile +export ANSIBLE_CACHE_PLUGIN_CONNECTION=./ +# collect and cache facts +ansible localhost -m setup > /dev/null && test -s localhost +# test flushing the fact cache +ansible --flush-cache localhost -m debug -a "msg={{ ansible_facts }}" | grep '"msg": {}' |