Fix issues with nxos_os_install module (#48811)

* Use expect module to copy files

* Remove old and redundant upgrade files

* Return error message instead of code

* Cleanup copy command code

* Fix force issue in nxos_install_os

* new nxos_install_os integration tests

* Uncomment transport tests

* Revert negative test change

* Remove combined option that is no longer required

* Make shippable happy

* Add n5k test files

(cherry picked from commit a721572206)
This commit is contained in:
Mike Wiebe 2018-11-19 23:44:15 -05:00 committed by Matt Clay
parent 424c68f15a
commit e3c4e49f59
31 changed files with 486 additions and 182 deletions

View file

@ -181,7 +181,7 @@ class Cli:
message = getattr(e, 'err', e)
err = to_text(message, errors='surrogate_then_replace')
if opts.get('ignore_timeout') and code:
msgs.append(code)
msgs.append(err)
return msgs
elif code and 'no graceful-restart' in err:
if 'ISSU/HA will be affected if Graceful Restart is disabled' in err:

View file

@ -205,6 +205,7 @@ def parse_show_install(data):
ud['disruptive'] = False
ud['upgrade_needed'] = False
ud['error'] = False
ud['invalid_command'] = False
ud['install_in_progress'] = False
ud['server_error'] = False
ud['upgrade_succeeded'] = False
@ -228,6 +229,7 @@ def parse_show_install(data):
ud['error'] = True
break
if re.search(r'[I|i]nvalid command', x):
ud['invalid_command'] = True
ud['error'] = True
break
if re.search(r'No install all data found', x):
@ -241,6 +243,9 @@ def parse_show_install(data):
if re.search(r'Backend processing error', x):
ud['server_error'] = True
break
if re.search(r'timed out', x):
ud['server_error'] = True
break
if re.search(r'^(-1|5\d\d)$', x):
ud['server_error'] = True
break
@ -343,7 +348,7 @@ def massage_install_data(data):
return result_data
def build_install_cmd_set(issu, image, kick, type):
def build_install_cmd_set(issu, image, kick, type, force=True):
commands = ['terminal dont-ask']
# Different NX-OS plaforms behave differently for
@ -355,6 +360,7 @@ def build_install_cmd_set(issu, image, kick, type):
# 2) Separate kickstart + system images.
# * Omit hidden 'force' option for issu.
# * Use hidden 'force' option for disruptive upgrades.
# * Note: Not supported on all platforms
if re.search(r'required|desired|yes', issu):
if kick is None:
issu_cmd = 'non-disruptive'
@ -364,7 +370,7 @@ def build_install_cmd_set(issu, image, kick, type):
if kick is None:
issu_cmd = ''
else:
issu_cmd = 'force'
issu_cmd = 'force' if force else ''
if type == 'impact':
rootcmd = 'show install all impact'
@ -411,6 +417,7 @@ def check_mode_legacy(module, issu, image, kick=None):
# Process System Image
data['error'] = False
tsver = 'show version image bootflash:%s' % image
data['upgrade_cmd'] = [tsver]
target_image = parse_show_version(execute_show_command(module, tsver))
if target_image['error']:
data['error'] = True
@ -423,6 +430,7 @@ def check_mode_legacy(module, issu, image, kick=None):
# Process Kickstart Image
if kick is not None and not data['error']:
tkver = 'show version image bootflash:%s' % kick
data['upgrade_cmd'].append(tsver)
target_kick = parse_show_version(execute_show_command(module, tkver))
if target_kick['error']:
data['error'] = True
@ -432,6 +440,7 @@ def check_mode_legacy(module, issu, image, kick=None):
data['disruptive'] = True
upgrade_msg = upgrade_msg + ' kickstart: %s' % tkver
data['list_data'] = data['raw']
data['processed'] = upgrade_msg
return data
@ -451,6 +460,7 @@ def check_mode_nextgen(module, issu, image, kick=None):
data = check_install_in_progress(module, commands, opts)
if data['server_error']:
data['error'] = True
data['upgrade_cmd'] = commands
return data
@ -472,6 +482,11 @@ def check_mode(module, issu, image, kick=None):
# impact data from the 'show install all impact' command.
# Fallback to legacy method.
data = check_mode_legacy(module, issu, image, kick)
if data['invalid_command']:
# If we are upgrading from a device running a separate kickstart and
# system image the impact command will fail.
# Fallback to legacy method.
data = check_mode_legacy(module, issu, image, kick)
return data
@ -501,6 +516,12 @@ def do_install_all(module, issu, image, kick=None):
# The system may be busy from the call to check_mode so loop until
# it's done.
upgrade = check_install_in_progress(module, commands, opts)
if upgrade['invalid_command'] and 'force' in commands[1]:
# Not all platforms support the 'force' keyword. Check for this
# condition and re-try without the 'force' keyword if needed.
commands = build_install_cmd_set(issu, image, kick, 'install', False)
upgrade = check_install_in_progress(module, commands, opts)
upgrade['upgrade_cmd'] = commands
# Special case: If we encounter a server error at this stage
# it means the command was sent and the upgrade was started but
@ -549,11 +570,8 @@ def main():
install_result = do_install_all(module, issu, sif, kick=kif)
if install_result['error']:
msg = "Failed to upgrade device using image "
if kif:
msg = msg + "files: kickstart: %s, system: %s" % (kif, sif)
else:
msg = msg + "file: system: %s" % sif
cmd = install_result['upgrade_cmd']
msg = 'Failed to upgrade device using command: %s' % cmd
module.fail_json(msg=msg, raw_data=install_result['list_data'])
state = install_result['processed']

View file

@ -10,7 +10,7 @@
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test cases (ansible_connection=httpapi)
include: "{{ test_case_to_run }} ansible_connection=httpapi"
include: "{{ test_case_to_run }} ansible_connection=httpapi connection={{ nxapi }}"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run

View file

@ -10,7 +10,7 @@
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test cases (ansible_connection=network_cli)
include: "{{ test_case_to_run }} ansible_connection=network_cli"
include: "{{ test_case_to_run }} ansible_connection=network_cli connection={{ cli }}"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run

View file

@ -4,24 +4,25 @@
when: ansible_connection == 'httpapi'
- include: targets/nxos_install_os/tasks/upgrade/enable_scp_server.yaml
when: connection is not defined
- include: targets/nxos_install_os/tasks/upgrade/enable_scp_server_provider.yaml
when: connection is defined
- name: "Copy {{ si }} to bootflash"
nxos_file_copy:
local_file: "{{image_dir}}{{ si }}"
file_system: "bootflash:"
file_pull: True
file_pull_timeout: 1200
remote_file: "{{image_dir}}{{ si }}"
remote_scp_server: 192.168.1.1
remote_scp_server_user: scp_user
remote_scp_server_password: scp_password
register: result
ignore_errors: "{{ ignore_errors_httpapi }}"
- name: "Copy {{ si }} to bootflash"
nxos_file_copy:
local_file: "{{image_dir}}{{ si }}"
file_system: "bootflash:"
register: result
ignore_errors: "{{ ignore_errors_httpapi }}"
#- name: "Copy {{ si }} to bootflash"
# expect:
# command: "scp {{image_dir}}{{ si }} {{ ansible_ssh_user }}@{{ ansible_ssh_host }}:"
# responses:
# (?i)Are you sure you want to continue connecting.*: yes
# (?i)password: "{{ ansible_ssh_pass }}"
# timeout: 1800
# register: result
- debug:
msg: "{{ item.key }} {{ item.value }}"
@ -29,11 +30,24 @@
- name: "Copy {{ ki }} to bootflash"
nxos_file_copy:
local_file: "{{image_dir}}/{{ ki }}"
file_system: "bootflash:"
register: result
file_pull: True
file_pull_timeout: 1200
remote_file: "{{image_dir}}{{ ki }}"
remote_scp_server: 192.168.1.1
remote_scp_server_user: scp_user
remote_scp_server_password: scp_password
when: ki is defined
ignore_errors: "{{ ignore_errors_httpapi }}"
register: result
#- name: "Copy {{ ki }} to bootflash"
# expect:
# command: "scp {{image_dir}}{{ ki }} {{ ansible_ssh_user }}@{{ ansible_ssh_host }}:"
# responses:
# (?i)Are you sure you want to continue connecting.*: yes
# (?i)password: "{{ ansible_ssh_pass }}"
# timeout: 1800
# when: ki is defined
# register: result
- debug:
msg: "{{ item.key }} {{ item.value }}"

View file

@ -6,5 +6,6 @@
- allow delete boot-image
- "delete {{ item }}"
match: none
provider: "{{ connection }}"
ignore_errors: yes
with_items: "{{ delete_image_list }}"

View file

@ -1,11 +0,0 @@
---
- name: "Delete Files To Make Room On Bootflash using provider"
nxos_config: &remove_file
lines:
- terminal dont-ask
- allow delete boot-image
- "delete {{ item }}"
match: none
provider: "{{ connection }}"
ignore_errors: yes
with_items: "{{ delete_image_list }}"

View file

@ -3,3 +3,4 @@
nxos_feature:
feature: scp-server
state: enabled
provider: "{{ connection }}"

View file

@ -1,6 +0,0 @@
---
- name: "Setup - Turn on feature scp-server using provider"
nxos_feature:
feature: scp-server
state: enabled
provider: "{{ connection }}"

View file

@ -1,15 +1,15 @@
---
- include: targets/nxos_install_os/tasks/upgrade/delete_files.yaml
when: delete_image_list is defined
when: delete_files
- include: targets/nxos_install_os/tasks/upgrade/copy_kick_system_images.yaml
when: copy_images is defined
- include: "targets/nxos_install_os/tasks/upgrade/copy_kick_system_images.yaml ansible_connection=network_cli connection={{ cli }}"
when: copy_images
- include: targets/nxos_install_os/tasks/upgrade/install_with_kick.yaml
when: ki is defined and combined is undefined
when: ki is defined
- include: targets/nxos_install_os/tasks/upgrade/install_system.yaml
when: combined is defined
when: ki is undefined
# Only needed when - meta: reset_connection does not work. Fixed in 2.6
#- include: targets/nxos_install_os/tasks/upgrade/clear_persistent_sockets.yaml
@ -19,6 +19,7 @@
- name: "Check installed OS for newly installed version {{ tv }}"
nxos_command:
commands: ['show version | json']
provider: "{{ connection }}"
register: output
- debug: msg="Version detected {{ output['stdout_lines'][0]['kickstart_ver_str'] }}"

View file

@ -1,25 +0,0 @@
---
- include: targets/nxos_install_os/tasks/upgrade/delete_files_provider.yaml
when: delete_image_list is defined
- include: targets/nxos_install_os/tasks/upgrade/copy_kick_system_images.yaml
when: copy_images is defined
- include: targets/nxos_install_os/tasks/upgrade/install_with_kick_provider.yaml
when: ki is defined and combined is undefined
- include: targets/nxos_install_os/tasks/upgrade/install_system_provider.yaml
when: combined is defined
# Only needed when - meta: reset_connection does not work. Fixed in 2.6
#- include: targets/nxos_install_os/tasks/upgrade/clear_persistent_sockets.yaml
- meta: reset_connection
- name: "Check installed OS for newly installed version {{ tv }}"
nxos_command:
commands: ['show version | json']
provider: "{{ connection }}"
register: output
- debug: msg="Version detected {{ output['stdout_lines'][0]['kickstart_ver_str'] }}"

View file

@ -4,9 +4,31 @@
nxos_install_os:
system_image_file: "{{ si }}"
issu: "{{ issu }}"
provider: "{{ connection }}"
register: result
when: not force
- name: "Set OS image {{ si }} boot pointers"
nxos_config:
lines:
- no boot nxos
- no boot kickstart
- no boot system
- "boot nxos bootflash:{{ si }}"
- copy run start
match: line
provider: "{{ connection }}"
when: force
- name: "Boot image {{ si }} using reload"
nxos_command:
commands: 'terminal dont-ask ; reload'
provider: "{{ connection }}"
ignore_errors: yes
when: force
- debug: msg=" {{ result['install_state'] }}"
when: not force
- name: Wait for device to come back up with new image
wait_for:

View file

@ -1,25 +0,0 @@
---
- name: "Install OS image {{ si }} using provider"
check_mode: "{{ checkmode }}"
nxos_install_os:
system_image_file: "{{ si }}"
issu: "{{ issu }}"
provider: "{{ connection }}"
register: result
- debug: msg=" {{ result['install_state'] }}"
- name: Wait for device to come back up with new image
wait_for:
port: 22
state: started
timeout: 500
delay: 60
host: "{{ inventory_hostname }}"
when: result.changed and not checkmode
- debug: msg='Wait 5 mins to allow system to stabilize'
when: result.changed and not checkmode
- pause:
seconds: 300
when: result.changed and not checkmode

View file

@ -5,9 +5,31 @@
system_image_file: "{{ si }}"
kickstart_image_file: "{{ ki }}"
issu: "{{ issu }}"
provider: "{{ connection }}"
register: result
when: not force
- name: "Set OS image {{ si }} boot pointers"
nxos_config:
lines:
- no boot kickstart
- no boot system
- "boot kickstart bootflash:{{ ki }}"
- "boot system bootflash:{{ si }}"
- copy run start
match: line
provider: "{{ connection }}"
when: force
- name: "Boot image {{ si }} using reload"
nxos_command:
commands: 'terminal dont-ask ; reload'
provider: "{{ connection }}"
ignore_errors: yes
when: force
- debug: msg=" {{ result['install_state'] }}"
when: not force
- name: Wait for device to come back up with new image
wait_for:

View file

@ -1,26 +0,0 @@
---
- name: "Install OS image {{ si }} using provider"
check_mode: "{{ checkmode }}"
nxos_install_os:
system_image_file: "{{ si }}"
kickstart_image_file: "{{ ki }}"
issu: "{{ issu }}"
provider: "{{ connection }}"
register: result
- debug: msg=" {{ result['install_state'] }}"
- name: Wait for device to come back up with new image
wait_for:
port: 22
state: started
timeout: 500
delay: 60
host: "{{ inventory_hostname }}"
when: result.changed and not checkmode
- debug: msg='Wait 5 mins to allow system to stabilize'
when: result.changed and not checkmode
- pause:
seconds: 300
when: result.changed and not checkmode

View file

@ -4,7 +4,3 @@
- meta: end_play
- include: targets/nxos_install_os/tasks/upgrade/install_os.yaml
when: connection is not defined
- include: targets/nxos_install_os/tasks/upgrade/install_os_provider.yaml
when: connection is defined

View file

@ -1,22 +0,0 @@
---
- name: "Reload to upgrade to OS image {{ si }}"
nxos_config:
lines:
- terminal dont-ask
- no boot nxos
- "boot nxos bootflash:{{ si }}"
- reload
match: none
ignore_errors: yes
- name: Wait for device to come back up with new image
wait_for:
port: 22
state: started
timeout: 500
delay: 60
host: "{{ inventory_hostname }}"
- debug: msg='Wait 5 mins to allow system to stabilize'
- pause:
seconds: 300

View file

@ -1,23 +0,0 @@
---
- name: "Reload to upgrade to OS image {{ si }} using provider"
nxos_config:
lines:
- terminal dont-ask
- no boot nxos
- "boot nxos bootflash:{{ si }}"
- reload
match: none
provider: "{{ connection }}"
ignore_errors: yes
- name: Wait for device to come back up with new image
wait_for:
port: 22
state: started
timeout: 500
delay: 60
host: "{{ inventory_hostname }}"
- debug: msg='Wait 5 mins to allow system to stabilize'
- pause:
seconds: 300

View file

@ -3,12 +3,16 @@
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
- set_fact: checkmode='no'
- set_fact: issu='desired'
- set_fact: copy_images='yes'
- set_fact: image_dir='/Users/mwiebe/Projects/nxos_ansible/images/'
- set_fact: checkmode='no'
- set_fact: issu='desired'
- set_fact: copy_images=True
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=True
- set_fact:
delete_image_list:
- nxos.7.0.3.I7.2.bin
@ -38,18 +42,17 @@
# Upgrade to 6.0(2)U6(3a) #
#---------------------------------------------------------#
- set_fact: si='n3000-uk9.6.0.2.U6.3a.bin'
- set_fact: ki='n3000-uk9-kickstart.6.0.2.U6.3a.bin'
- set_fact: si='n3000-s2-dk9.8.0.1.bin'
- set_fact: ki='n3000-s2-kickstart.8.0.1.bin'
- name: Upgrade to U6.3a
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml
#---------------------------------------------------------#
# Upgrade to 7.0(3)I7(3) #
# Upgrade to 7.0(3)I7(2) #
#---------------------------------------------------------#
- set_fact: si='nxos.7.0.3.I7.2.bin'
- set_fact: combined='true'
- name: Upgrade to 7.0.3.I7.2
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,28 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/greensboro/REL_7_0_3_I7_4/'
- set_fact: checkmode='no'
- set_fact: issu='no'
- set_fact: copy_images=True
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=True
- set_fact:
delete_image_list:
- nxos*.bin
- n3000*.bin
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='nxos.7.0.3.I7.4.bin'
- name: Upgrade N3172 Device to Greensboro Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,29 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/602U6_1/'
- set_fact: checkmode='no'
- set_fact: issu='desired'
- set_fact: copy_images=True
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=True
- set_fact:
delete_image_list:
- n3000*.bin
- nxos*.bin
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='n3000-uk9.6.0.2.U6.1a.bin'
- set_fact: ki='n3000-uk9-kickstart.6.0.2.U6.1a.bin'
- name: Upgrade N3500 Device to U61a Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,29 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/602U6_2/'
- set_fact: checkmode='no'
- set_fact: issu='no'
- set_fact: copy_images=True
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=True
- set_fact:
delete_image_list:
- n3000*.bin
- nxos*.bin
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='n3000-uk9.6.0.2.U6.2a.bin'
- set_fact: ki='n3000-uk9-kickstart.6.0.2.U6.2a.bin'
- name: Upgrade N3500 Device to U62a Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,29 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/602U6_3/'
- set_fact: checkmode='no'
- set_fact: issu='desired'
- set_fact: copy_images=True
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=True
- set_fact:
delete_image_list:
- n3000*.bin
- nxos*.bin
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='n3000-uk9.6.0.2.U6.3a.bin'
- set_fact: ki='n3000-uk9-kickstart.6.0.2.U6.3a.bin'
- name: Upgrade N3500 Device to U63a Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,29 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/602A8_8/'
- set_fact: checkmode='no'
- set_fact: issu='desired'
- set_fact: copy_images=True
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=True
- set_fact:
delete_image_list:
- n3000*.bin
- n3500*.bin
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='n3500-uk9.6.0.2.A8.8.bin'
- set_fact: ki='n3500-uk9-kickstart.6.0.2.A8.8.bin'
- name: Upgrade N3500 Device to A8_8 Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,28 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/greensboro/REL_7_0_3_I7_4/'
- set_fact: checkmode='no'
- set_fact: issu='desired'
- set_fact: copy_images=False
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=False
- set_fact:
delete_image_list:
- nxos*.bin
- n3500*.bin
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='nxos.7.0.3.I7.4.bin'
- name: Upgrade N3500 Device to Greensboro Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,28 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/730_N11/'
- set_fact: checkmode='no'
- set_fact: issu='no'
- set_fact: copy_images=True
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=True
- set_fact:
delete_image_list:
- n6000*.bin
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='n6000-uk9.7.3.0.N1.1.bin'
- set_fact: ki='n6000-uk9-kickstart.7.3.0.N1.1.bin'
- name: Upgrade N5k Device to 7.3(0)N1(1) Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,28 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/733_N11/'
- set_fact: checkmode='no'
- set_fact: issu='no'
- set_fact: copy_images=False
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=False
- set_fact:
delete_image_list:
- n6000*.bin
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='n6000-uk9.7.3.3.N1.1.bin'
- set_fact: ki='n6000-uk9-kickstart.7.3.3.N1.1.bin'
- name: Upgrade N5k Device to 7.3(3)N1(1) Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,28 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/atherton/REL_8_0_1/'
- set_fact: checkmode='no'
- set_fact: issu='no'
- set_fact: copy_images=True
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=True
- set_fact:
delete_image_list:
- n7000*.bin
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='n7000-s2-dk9.8.0.1.bin'
- set_fact: ki='n7000-s2-kickstart.8.0.1.bin'
- name: Upgrade N7k Device to Atherton Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,28 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/helsinki/REL_7_3_0_D1_1/'
- set_fact: checkmode='no'
- set_fact: issu='no'
- set_fact: copy_images=True
# Set boot pointers and reload
- set_fact: force=True
- set_fact: delete_files=True
- set_fact:
delete_image_list:
- n7000*.bin
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='n7000-s2-dk9.7.3.0.D1.1.bin'
- set_fact: ki='n7000-s2-kickstart.7.3.0.D1.1.bin'
- name: Upgrade N7k Device to Helsinki Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,41 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/greensboro/REL_7_0_3_I7_4/'
- set_fact: checkmode='no'
- set_fact: issu='yes'
- set_fact: copy_images=False
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=False
- set_fact:
delete_image_list:
- nxos*.bin
#---------------------------------------------------------#
# Remove incompatible features #
#---------------------------------------------------------#
- name: Unconfigure features that will conflict with upgrade
nxos_config:
lines:
- terminal dont-ask
- no feature nv overlay
- no nxapi ssl protocols
- no nxapi ssl ciphers weak
match: none
provider: "{{ connection }}"
ignore_errors: yes
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='nxos.7.0.3.I7.4.bin'
- name: Upgrade N9k Device to Greensboro Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml

View file

@ -0,0 +1,39 @@
---
- debug: msg="START connection={{ ansible_connection }} nxos_os_install upgrade"
- debug: msg="Using provider={{ connection.transport }}"
when: connection is defined
# Set directory pointer to software images
- set_fact: image_dir='/auto/fe_ssr/agents-ci/agents_images/release_images/hamilton/REL_9_2_1/'
- set_fact: checkmode='no'
- set_fact: issu='desired'
- set_fact: copy_images=False
# Set boot pointers and reload
- set_fact: force=False
- set_fact: delete_files=False
- set_fact:
delete_image_list:
- nxos*.bin
#---------------------------------------------------------#
# Remove incompatible features #
#---------------------------------------------------------#
- name: Unconfigure features that will conflict with upgrade
nxos_config:
lines:
- terminal dont-ask
- no feature ngmvpn
match: none
provider: "{{ connection }}"
ignore_errors: yes
#---------------------------------------------------------#
# Upgrade Device #
#---------------------------------------------------------#
- set_fact: si='nxos.9.2.1.bin'
- name: Upgrade N9k Device to Hamilton Release Image
include: targets/nxos_install_os/tasks/upgrade/main_os_install.yaml