-
Notifications
You must be signed in to change notification settings - Fork 1k
[deploy] Wait for vEOS to come back after restart #906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,12 @@ | ||
| - name: Restart the box | ||
| command: /sbin/shutdown -r now "Ansible updates triggered" | ||
|
|
||
| - name: Pause for reboot | ||
| pause: seconds=30 | ||
|
|
||
| - name: Wait for VM to come up | ||
| local_action: shell ansible -m ping -i veos {{ inventory_hostname }} | ||
| register: wait_result | ||
| until: wait_result.rc == 0 | ||
| retries: 30 | ||
| delay: 30 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,8 @@ | |
| - name: build a startup config | ||
| template: src="{{ topo }}-{{ props.swrole }}.j2" | ||
| dest=/mnt/flash/startup-config | ||
| when: configuration is defined | ||
| when: hostname in configuration | ||
| notify: | ||
| - Restart the box | ||
| - Pause for reboot | ||
| - Wait for VM to come up | ||
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 'ping' module? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure of ping module would cause playbook fail. Replaced the ping command with the ansible wait_for module which is designed for this kind of job.