support fact caching for isolated hosts

see: https://github.com/ansible/awx/issues/198
This commit is contained in:
Ryan Petrello
2018-02-20 15:00:47 -05:00
parent 662f4ec346
commit 7d9e4d6e2f
2 changed files with 14 additions and 3 deletions

View File

@@ -25,3 +25,14 @@
fail:
msg: "isolated task is still running"
when: "is_alive.rc == 0"
- stat: path="{{src}}/facts/"
register: fact_cache
- name: Copy gathered facts from the isolated host.
synchronize:
src: "{{src}}/facts/"
dest: "{{src}}/facts/"
delete: yes # delete fact cache records that go missing via clear_facts
mode: pull
when: fact_cache.stat.exists