mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Allow modules to return facts.
If the module result contains "ansible_facts", that will be added to the setup cache.
This commit is contained in:
@@ -362,9 +362,11 @@ md5sum2 = os.popen("md5sum %s" % ansible_file).read().split()[0]
|
||||
if md5sum != md5sum2:
|
||||
changed = True
|
||||
|
||||
setup_options['written'] = ansible_file
|
||||
setup_options['changed'] = changed
|
||||
setup_options['md5sum'] = md5sum2
|
||||
setup_result = {}
|
||||
setup_result['written'] = ansible_file
|
||||
setup_result['changed'] = changed
|
||||
setup_result['md5sum'] = md5sum2
|
||||
setup_result['ansible_facts'] = setup_options
|
||||
|
||||
print json.dumps(setup_options)
|
||||
print json.dumps(setup_result)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user