fix precedence issue with facts and vars (#32302)

avoid making gathered facts high precedence, only set_fact is supposed to be.
vars set via set_fact with cacheable are higher precedence than plain facts.

Previously (after 6fbd0a8bb5) regular facts would end up with a
higher precedence than host or play vars, but they should not be. Facts were getting added to 'non_persistent_facts' (equivalent to 'register' vars) which is higher precedence than facts should be.

added 'cacheable set_facts' to precedence docs

'ansible_facts_cacheable' ->  '_ansible_facts_cacheable' (made 'private')
This commit is contained in:
Brian Coca 2017-11-01 11:42:17 -04:00 committed by Adrian Likins
parent d1e55551e9
commit 41685fb516
3 changed files with 8 additions and 7 deletions

View file

@ -54,5 +54,5 @@ class ActionModule(ActionBase):
result['changed'] = False
result['ansible_facts'] = facts
result['ansible_facts_cacheable'] = cacheable
result['_ansible_facts_cacheable'] = cacheable
return result