On 10.11.2017 07:42, SHUBHAM JAIN wrote:
For example

[brokers]
ansible-slave node_id=1 kafka_port=9092
ansible-slave node_id=2 kafka_port=9093
ansible-slave node_id=3 kafka_port=9094

I started playbook but it is running only once not three times.

How to achieve this thing using ansible?

The name must be uniqe, if the appear more than once only the last one count.

To archive this you can do this.

[brokers]
ansible-slave node_id=1 kafka_port=9092
ansible-slave-v1 node_id=2 kafka_port=9093 ansible_host=ansible-slave
ansible-slave-v2 node_id=3 kafka_port=9094 ansible_host=ansible-slave

But remember, if you are using inventory_hostname it will be the name in the inventory and not ansible-slave for the two last ones.


--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/08169fb1d4810f9c3fea5913a3ef340c%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to