diff --git a/ansible/roles/eos/handlers/main.yml b/ansible/roles/eos/handlers/main.yml deleted file mode 100644 index ddd945ccf1b..00000000000 --- a/ansible/roles/eos/handlers/main.yml +++ /dev/null @@ -1,3 +0,0 @@ -- name: Restart the box - command: /sbin/shutdown -r now "Ansible updates triggered" - diff --git a/ansible/roles/eos/tasks/main.yml b/ansible/roles/eos/tasks/main.yml index c5ade3bdced..e3c64d6f805 100644 --- a/ansible/roles/eos/tasks/main.yml +++ b/ansible/roles/eos/tasks/main.yml @@ -53,6 +53,22 @@ - name: build a startup config template: src="{{ topo }}-{{ props.swrole }}.j2" dest=/mnt/flash/startup-config - when: configuration is defined - notify: - - Restart the box + when: hostname in configuration + +- name: Restart the box + command: /sbin/shutdown -r now "Ansible updates triggered" + when: hostname in configuration + +- name: Pause for reboot + pause: seconds=30 + when: hostname in configuration + +- name: Wait for VM to come up + wait_for: + host: "{{ ansible_ssh_host }}" + port: 22 + state: started + delay: 10 + timeout: 600 + connection: local + when: hostname in configuration