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

On Saturday, April 14, 2018 at 10:25:50 AM UTC+5:30, Larry Smith wrote:
>
> 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.
>
> On Friday, April 13, 2018 at 1:56:57 PM UTC-4, Bishwajit Samanta wrote:
>>
>> Can anyone help me in my problem please ? 
>>
>>
>> On Friday, April 13, 2018 at 8:21:31 PM UTC+5:30, Bishwajit Samanta wrote:
>>>
>>>
>>>
>>> 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::-
>>> -------------------
>>>
>>> # ---------------------------------- Cluster 
>>> -----------------------------------
>>> #
>>> # Use a descriptive name for your cluster:
>>> #
>>>  cluster.name: {{ my_defined_cluster_name }}
>>> #
>>> # ------------------------------------ Node 
>>> ------------------------------------
>>> #
>>> # Use a descriptive name for the node:
>>> #
>>>  node.name: {{ my_defined_node_name }}
>>> #
>>> # Add custom attributes to the node:
>>> #
>>> # node.rack: r1
>>>
>>> If i am running this jinja2 file, across all the systems the value of 
>>> node.name will be same. But i dont want this, i want to put some other 
>>> values when it runs to other systems. 
>>>
>>> what modification i can do in Jinja2 file , can anyone help me ??
>>>
>>> My ansible playbook looks like this::
>>>
>>>
>>> ---
>>>
>>> ## Task Related to Configuration of Elastic Search :: 
>>>
>>> - name: Copy Configuration file for Elastic Search 
>>>   template:
>>>     src: elasticsearch.jinja2
>>>     dest: /etc/elasticsearch/elasticsearch.yml
>>>     mode: 0750
>>>     owner: root
>>>     group: elasticsearch
>>>
>>>
>>>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f9ea6dd9-fe2a-4cb3-a6a0-c188bed218c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to