variable within a variable in template

I am trying to push a property file template like the below

schema.registry.url=http://{{ schemaregis_host{{ play_hosts.index(inventory_hostname) }} }}:8081

I pass extra variables like these in the ansible input command

schemaregis0=host1 schemaregis1=host2

[inventory-hosts]
server1
server2

i want server1 property file to have the schemaregis0=host1 and server2 to have the other

ansible doesnt like the variable within a variable. how can i get around this?