update junos_template module

This updates the junos_template module implementing the changes for
Ansible 2.2
reviewable/pr18780/r1
Peter Sprygada 8 years ago
parent 1d48b47cad
commit 0dfd3f177f

@ -100,6 +100,7 @@ EXAMPLES = """
src: config.j2
action: overwrite
"""
from ansible.module_utils.junos import NetworkModule
DEFAULT_COMMENT = 'configured by junos_template'
@ -115,8 +116,8 @@ def main():
transport=dict(default='netconf', choices=['netconf'])
)
module = get_module(argument_spec=argument_spec,
supports_check_mode=True)
module = NetworkModule(argument_spec=argument_spec,
supports_check_mode=True)
comment = module.params['comment']
confirm = module.params['confirm']
@ -132,9 +133,9 @@ def main():
"set per junos documentation")
results = dict(changed=False)
results['_backup'] = str(module.get_config()).strip()
results['_backup'] = str(module.config.get_config()).strip()
diff = module.load_config(src, action=action, comment=comment,
diff = module.config.load_config(src, action=action, comment=comment,
format=fmt, commit=commit, confirm=confirm)
if diff:
@ -144,8 +145,5 @@ def main():
module.exit_json(**results)
from ansible.module_utils.basic import *
from ansible.module_utils.junos import *
if __name__ == '__main__':
main()

Loading…
Cancel
Save