summaryrefslogtreecommitdiff
path: root/test/integration/targets/nxos_install_os/tasks/upgrade/install_with_kick.yaml
blob: 8d02cb9a7802da37a14a4664dbbb35f409658243 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
- name: "Install OS image {{ si }}"
  check_mode: "{{ checkmode }}"
  nxos_install_os:
    system_image_file: "{{ si }}"
    kickstart_image_file: "{{ ki }}"
    issu: "{{ issu }}"
  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
  when: force

- name: "Boot image {{ si }} using reload"
  nxos_command:
    commands: 'terminal dont-ask ; reload'
  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:
    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