ansible command to reboot host

23 views
Skip to first unread message

Tony Wong

unread,
Mar 27, 2023, 11:22:55 AM3/27/23
to Ansible Project
I am using follwing command to reboot linux host

ansible -i hosts linux_vms -a "/sbin/shutdown -r now" -Kk --ssh-extra-args='-o StrictHostKeyChecking=no'

but keep getting folowing

Failed to execute operation: Connection timed out

but 
ansible -i hosts linux_vms -a "uptime" -k --ssh-extra-args='-o StrictHostKeyChecking=no'


show the vms are up. any idea?

Atul Nasir

unread,
Aug 22, 2023, 12:53:40 AM8/22/23
to Ansible Project
ansible -i hosts linux_vms -m shell -a "/sbin/shutdown -r now" -u your_username -K --ssh-extra-args='-o StrictHostKeyChecking=no'
Reply all
Reply to author
Forward
0 new messages