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
reviewable/pr18780/r1
Peter Sprygada 9 years ago
parent 624d1e38b8
commit d66a0cbe3f

@ -47,16 +47,6 @@ options:
required: false required: false
default: false default: false
choices: BOOLEANS 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: backup:
description: description:
- When this argument is configured true, the module will backup - When this argument is configured true, the module will backup
@ -90,7 +80,6 @@ options:
""" """
EXAMPLES = """ EXAMPLES = """
- name: push a configuration onto the device - name: push a configuration onto the device
eos_template: eos_template:
src: config.j2 src: config.j2
@ -104,34 +93,20 @@ EXAMPLES = """
eos_template: eos_template:
src: candidate_config.txt src: candidate_config.txt
config: current_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 = """ RETURN = """
updates:
commands:
description: The set of commands that will be pushed to the remote device description: The set of commands that will be pushed to the remote device
returned: always returned: always
type: list 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): def compare(this, other):
@ -220,9 +195,10 @@ def main():
response = module.config_replace(commands) response = module.config_replace(commands)
else: else:
response = module.configure(commands) response = module.configure(commands)
result['responses'] = response
result['changed'] = True result['changed'] = True
result['commands'] = commands result['updates'] = commands
return module.exit_json(**result) return module.exit_json(**result)
from ansible.module_utils.basic import * from ansible.module_utils.basic import *

Loading…
Cancel
Save