Hi Team ,
I have 10 Linux hosts require to run same command at a time. Could you please suggest best way to do this scenario . I tried using ssh module in tasks but I have to create 10 tasks for 10 hosts to execute the same command. Is there a better way to do this ?
Thanks
Ramesh
@ramesh gowru,
try Ansible, it will help you
Once you have installed Ansible and added some hosts to the inventory file, typically /etc/ansible/hosts . you can try to connect to your hosts. By default a connection will be made with ssh keys, but you can also specify a username and password.
https://networklore.com/ansible/
Thanks,
Ajeet
@ajeet_singh,
thanks for the quick reply, I want to include restarts as a part of deployment job . +
ramesh
Yes @ramesh gowru you can restart your host ,
https://www.jeffgeerling.com/blog/2018/reboot-and-wait-reboot-complete-ansible-playbook
https://docs.ansible.com/ansible/latest/modules/reboot_module.html
It looks like you're new here. Sign in or register to get started.