DEV Community

Anuja Piayadigama
Anuja Piayadigama

Posted on

1

How to run Ansible tasks for each server separately

I have an inventory file like below.

[all:vars]
ansible_user=root
zookeeper_new=true
[zookeepers]
10.16.0.31
10.16.0.32

Inside my .yml file where I have declared the tasks, I would like to run all of those tasks first in the server 31 and after that on server 32. Is that possible and if so, how

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay