|
|
@ -92,6 +92,7 @@ EXAMPLES = """
|
|
|
|
src: junos-vsrx-12.1X46-D10.2-domestic.tgz
|
|
|
|
src: junos-vsrx-12.1X46-D10.2-domestic.tgz
|
|
|
|
reboot: no
|
|
|
|
reboot: no
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
from ansible.module_utils.junos import NetworkModule
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
from jnpr.junos.utils.sw import SW
|
|
|
|
from jnpr.junos.utils.sw import SW
|
|
|
@ -127,7 +128,7 @@ def main():
|
|
|
|
transport=dict(default='netconf', choices=['netconf'])
|
|
|
|
transport=dict(default='netconf', choices=['netconf'])
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
module = get_module(argument_spec=spec,
|
|
|
|
module = NetworkModule(argument_spec=spec,
|
|
|
|
supports_check_mode=True)
|
|
|
|
supports_check_mode=True)
|
|
|
|
|
|
|
|
|
|
|
|
if not HAS_SW:
|
|
|
|
if not HAS_SW:
|
|
|
@ -137,8 +138,8 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
do_upgrade = module.params['force'] or False
|
|
|
|
do_upgrade = module.params['force'] or False
|
|
|
|
if not module.params['force']:
|
|
|
|
if not module.params['force']:
|
|
|
|
has_ver = module.get_facts().get('version')
|
|
|
|
has_ver = module.connection.get_facts().get('version')
|
|
|
|
wants_ver = module.params['version'] or package_version(module)
|
|
|
|
wants_ver = module.params['version']
|
|
|
|
do_upgrade = has_ver != wants_ver
|
|
|
|
do_upgrade = has_ver != wants_ver
|
|
|
|
|
|
|
|
|
|
|
|
if do_upgrade:
|
|
|
|
if do_upgrade:
|
|
|
@ -148,8 +149,6 @@ def main():
|
|
|
|
|
|
|
|
|
|
|
|
module.exit_json(**result)
|
|
|
|
module.exit_json(**result)
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.module_utils.basic import *
|
|
|
|
|
|
|
|
from ansible.module_utils.junos import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|