Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ansible/upgrade_sonic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
gather_facts: no
tasks:

- name: Gather minigraph facts about the device
- name: Gather minigraph facts for the switch {{ inventory_hostname }}
minigraph_facts: host={{ inventory_hostname }}
connection: local

- fail: msg="image_url is not defined"
when: image_url is not defined

- name: Install the target image
- name: Install the target image from {{ image_url }}
become: true
shell: sonic_installer install -y {{ image_url }}
register: output
failed_when: output.rc != 0

- name: Reboot
- name: Reboot the switch {{ inventory_hostname }}
become: true
shell: shutdown -r now "Reboot"
async: 1
poll: 0
ignore_errors: true

- name: Wait for switch to come back
- name: Wait for switch {{ inventory_hostname }} to come back
local_action:
wait_for host={{ inventory_hostname }}
wait_for host={{ ansible_host }}
port=22
state=started
delay=30
Expand Down