Cumulus Ansbile Reboot

  • 1
  • Question
  • Updated 2 years ago
  • (Edited)
Hi folks, me again :D

Did someone managed to issue a reboot of vxCumulus (ie binded on the loopback) and get the playbook keep running ?
I've the impression that the ssh context is lost while doing so:

fatal: [test2 -> localhost]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_name": "wait_for"}, "module_stderr": "Sorry, try again.\n[sudo via ansible, key=sueltqpxdezomjhgfsyuqwclsnyzvlsj] password: \nsudo: 1 incorrect password attempt\n", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}

Any idea ?

Photo of David Ramahefason

David Ramahefason

  • 400 Points 250 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Eric Pulvino

Eric Pulvino, Official Rep

  • 3,868 Points 3k badge 2x thumb
I hadn't tried to do this yet but was able to get it working. In this example I'm running Ansible from my local laptop. Followed guide here: and extra options here:

My playbook looks like this:
- hosts: leaf1
remote_user: vagrant
- name: restart machine
shell: sleep 2 && shutdown -r now "Ansible updates triggered"
async: 1
poll: 0
sudo: true
ignore_errors: true

- name: waiting for server to come back
module: wait_for
host: localhost
port: 2222 finished on leaf1

TASK: [waiting for server to come back] ***************************************
ok: [leaf1 ->]

PLAY RECAP ********************************************************************
leaf1 : ok=4 changed=0 unreachable=0 failed=0