nxos issu should abort when issu is not possible. (#43793)

* Use expect module to copy files

* Abort when issu not possible

* Update copy_kick_system_images.yaml

* Update platform/version support
This commit is contained in:
Mike Wiebe 2018-08-13 11:06:42 -04:00 committed by Trishna Guha
parent 11f02cbc8e
commit 8f75bb5799

View file

@ -34,7 +34,7 @@ notes:
- Tested against the following platforms and images - Tested against the following platforms and images
- N9k 7.0(3)I4(6), 7.0(3)I5(3), 7.0(3)I6(1), 7.0(3)I7(1), 7.0(3)F2(2), 7.0(3)F3(2) - N9k 7.0(3)I4(6), 7.0(3)I5(3), 7.0(3)I6(1), 7.0(3)I7(1), 7.0(3)F2(2), 7.0(3)F3(2)
- N3k 6.0(2)A8(6), 6.0(2)A8(8), 7.0(3)I6(1), 7.0(3)I7(1) - N3k 6.0(2)A8(6), 6.0(2)A8(8), 7.0(3)I6(1), 7.0(3)I7(1)
- N7k 7.3(0)D1(1), 8.0(1), 8.2(1) - N7k 7.3(0)D1(1), 8.0(1), 8.1(1), 8.2(1)
- This module requires both the ANSIBLE_PERSISTENT_CONNECT_TIMEOUT and - This module requires both the ANSIBLE_PERSISTENT_CONNECT_TIMEOUT and
ANSIBLE_PERSISTENT_COMMAND_TIMEOUT timers to be set to 600 seconds or higher. ANSIBLE_PERSISTENT_COMMAND_TIMEOUT timers to be set to 600 seconds or higher.
The module will exit if the timers are not set properly. The module will exit if the timers are not set properly.
@ -61,7 +61,7 @@ options:
version_added: "2.5" version_added: "2.5"
description: description:
- Upgrade using In Service Software Upgrade (ISSU). - Upgrade using In Service Software Upgrade (ISSU).
(Only supported on N9k platforms) (Supported on N5k, N7k, N9k platforms)
- Selecting 'required' or 'yes' means that upgrades will only - Selecting 'required' or 'yes' means that upgrades will only
proceed if the switch is capable of ISSU. proceed if the switch is capable of ISSU.
- Selecting 'desired' means that upgrades will use ISSU if possible - Selecting 'desired' means that upgrades will use ISSU if possible
@ -474,8 +474,14 @@ def do_install_all(module, issu, image, kick=None):
# needs to be upgraded. # needs to be upgraded.
if impact_data['disruptive']: if impact_data['disruptive']:
# Check mode indicated that ISSU is not possible so issue the # Check mode indicated that ISSU is not possible so issue the
# upgrade command without the non-disruptive flag. # upgrade command without the non-disruptive flag unless the
issu = 'no' # playbook specified issu: yes/required.
if issu == 'yes':
msg = 'ISSU/ISSD requested but impact data indicates ISSU/ISSD is not possible'
module.fail_json(msg=msg, raw_data=impact_data['list_data'])
else:
issu = 'no'
commands = build_install_cmd_set(issu, image, kick, 'install') commands = build_install_cmd_set(issu, image, kick, 'install')
opts = {'ignore_timeout': True} opts = {'ignore_timeout': True}
# The system may be busy from the call to check_mode so loop until # The system may be busy from the call to check_mode so loop until
@ -524,6 +530,9 @@ def main():
kif = module.params['kickstart_image_file'] kif = module.params['kickstart_image_file']
issu = module.params['issu'] issu = module.params['issu']
if re.search(r'(yes|required)', issu):
issu = 'yes'
if kif == 'null' or kif == '': if kif == 'null' or kif == '':
kif = None kif = None