ansible with elastic search with Jinja2 Template

Hi, my question is ::--------------------------------

My ansible script will be running for multiple systems. But in elasticsearch.jinja2 how can i change the value of node.name for different systems.

Jinja 2 Code::-

Can anyone help me in my problem please ?

You can use:
node.name: {{ansible_hostname}}

Which will use the hostname defined on the remote host.

Or you can use:

node.name:{{inventory_hostname}}

Which will use the inventory hostname defined in your Ansible inventory.

For reference:
https://github.com/mrlesmithjr/ansible-elasticsearch/blob/master/defaults/main.yml#L74

Hope this helps.

Thanks Larry for such great help… i hope this solves my problem. !! :slight_smile: