i have a code like this
- template:
src: ../files/kfhost.j2
dest: /app/bin/kafka/server.properties
owner: kafka
group: kafka
mode: 0755
the jinga file has an entry like this
broker.id={{ play_hosts.index(inventory_hostname)+1 }}
when i have an inventory file like this
[all]
server1
server2
server3
and run this playbook from command line. server1
broker.id is set to 1, server2
broker.id is set to 2 and server3
broker.id is set to 3.
when i run the same in ansbile tower, sometimes the server1 gets value 2, server2 gets value 1
the order is getting mismatched.
just fyi there are other tasks before this task in the playbook
any idea as to why this might be happening in tower and never when i run ansible-playbook command line