mirror of https://github.com/ansible/ansible.git
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
)
pull/49461/head
parent
faa5a73c73
commit
d1a38f1f72
@ -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 }}"
|
@ -1,6 +0,0 @@
|
||||
---
|
||||
- name: "Setup - Turn on feature scp-server using provider"
|
||||
nxos_feature:
|
||||
feature: scp-server
|
||||
state: enabled
|
||||
provider: "{{ connection }}"
|
@ -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'] }}"
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
|
Loading…
Reference in New Issue