1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

minor bug fixes in eos_template

* fixes issue where configuration was not being loaded (#4704)
* fixes issue where defaults were not included when argument was set to True

tested on EOS 4.15.4F
This commit is contained in:
Peter Sprygada 2016-09-06 22:51:40 -04:00 committed by Matt Clay
parent 009ebf619b
commit bfdc5098cb

View file

@ -122,8 +122,9 @@ from ansible.module_utils.eos import NetworkModule
def get_config(module):
config = module.params.get('config')
defaults = module.params['include_defaults']
if not config and not module.params['force']:
config = module.config.get_config()
config = module.config.get_config(include_defaults=defaults)
return config
def filter_exit(commands):
@ -198,7 +199,12 @@ def main():
commands = filter_exit(commands)
if commands:
if not module.check_mode:
response = module.config(commands, replace=replace)
response = module.config.load_config(commands,
replace=replace,
session='eos_template',
commit=True)
module.cli('no configure session eos_template')
result['responses'] = response
result['changed'] = True