collect isolated capacity using a cache plugin, not stdout parsing

reading capacity values using the jsonfile cache plugin is more robust
in scenarios where ansible-playbook may print non-JSON output (such as
-vvv or when a custom callback plugin like timer is enabled)
This commit is contained in:
Ryan Petrello
2018-11-26 16:28:17 -05:00
parent 9eb2c02e92
commit fc0a039097
2 changed files with 47 additions and 38 deletions

View File

@@ -62,7 +62,12 @@ def main():
# Module never results in a change
module.exit_json(changed=False, capacity_cpu=capacity_cpu,
capacity_mem=capacity_mem, version=version)
capacity_mem=capacity_mem, version=version,
ansible_facts=dict(
awx_capacity_cpu=capacity_cpu,
awx_capacity_mem=capacity_mem,
awx_capacity_version=version
))
if __name__ == '__main__':