diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 66d4efa..57389f8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,4 +1,9 @@ develop +======= + - Provide diff in napalm_install_config in ``result.diff`` instead + of ``result.msg``. + +1.1.0 ===== - Fix issue with -u not working. - Update tests to use newer Python and to use Ansible 2.8.x or 2.9.x. diff --git a/napalm_ansible/modules/napalm_install_config.py b/napalm_ansible/modules/napalm_install_config.py index 8d6153e..5f10f55 100644 --- a/napalm_ansible/modules/napalm_install_config.py +++ b/napalm_ansible/modules/napalm_install_config.py @@ -157,11 +157,13 @@ def return_values(obj): returned: always type: bool sample: True -msg: +diff: description: diff of the change returned: always - type: string - sample: "[edit system]\n- host-name lab-testing;\n+ host-name lab;" + type: dict + sample: { + 'prepared': "[edit system]\n- host-name lab-testing;\n+ host-name lab;", + } """ napalm_found = False @@ -331,7 +333,7 @@ def main(): except Exception as e: module.fail_json(msg="cannot close device connection: " + str(e)) - module.exit_json(changed=changed, msg=diff) + module.exit_json(changed=changed, diff={"prepared": diff}, msg=diff) if __name__ == "__main__":