From eb5f9c216b4537fd4b099b6be9afab6fec5852de Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Tue, 9 Feb 2016 14:33:47 -0500 Subject: [PATCH] update eos_template doc string and return values This updates the return values form eos_template to be consistent across all template modules. This change now returns updates and respones --- .../modules/network/eos/eos_template.py | 42 ++++--------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/lib/ansible/modules/network/eos/eos_template.py b/lib/ansible/modules/network/eos/eos_template.py index 89c3315373..613a613e06 100644 --- a/lib/ansible/modules/network/eos/eos_template.py +++ b/lib/ansible/modules/network/eos/eos_template.py @@ -47,16 +47,6 @@ options: required: false default: false choices: BOOLEANS - include_defaults: - description: - - The module, by default, will collect the current device - running-config to use as a base for comparision to the commands - in I(src). Setting this value to true will cause the module - to issue the command `show running-config all` to include all - device settings. - required: false - default: false - choices: BOOLEANS backup: description: - When this argument is configured true, the module will backup @@ -90,7 +80,6 @@ options: """ EXAMPLES = """ - - name: push a configuration onto the device eos_template: src: config.j2 @@ -104,34 +93,20 @@ EXAMPLES = """ eos_template: src: candidate_config.txt config: current_config.txt - - -# The example below shows how to use ignore_missing. In the example, -# the device running config is already configured with 'no shutdown' but -# the value does not show up in the running-config as it is the default. The -# ignore_missing argument will not cause the task to try to reconfigure the -# same command since the source value is ignored. - -vars: - candidate_config: - interface Ethernet1 - no shutdown -tasks: - - name: configure interface administrative state - eos_template: - src: candidate_config.txt - ignore_missing: yes - """ RETURN = """ - -commands: +updates: description: The set of commands that will be pushed to the remote device returned: always type: list - sample: [...] + sample: ['...', '...'] +responses: + description: The set of responses from issuing the commands on the device + retured: when not check_mode + type: list + sample: ['...', '...'] """ def compare(this, other): @@ -220,9 +195,10 @@ def main(): response = module.config_replace(commands) else: response = module.configure(commands) + result['responses'] = response result['changed'] = True - result['commands'] = commands + result['updates'] = commands return module.exit_json(**result) from ansible.module_utils.basic import *