Thanks a lot, Petetin.

My bad; the variable format suggested by you works fine. Please ignore my
previous email.

Regards,
Dinesh


On Thu, Dec 20, 2018 at 9:33 AM Dineshkumar Ramasamy <
dineshkumarr.ramas...@gmail.com> wrote:

> Hi Petetin,
>
> Thanks for your response.
>
> The proposed code fails to get the actual value from hostvar; instead, the
> code itself placed in the 'path'.
>
> *Result:*
>
> *cat /tmp/test_params.yaml*
> *private_ip: hostvars['server1.com <http://server1.com>'].host_ip*
>
> Looks like we need some other way to eval '*hostvars['server1.com
> <http://server1.com>'].host_ip*'.
>
> I did try *replace: "{{ "private_ip: {{ hostvars[serverFqdn]['host_ip']
> }}"}}"* but no luck.
>
> Regards,
> Dinesh
>
> On Wed, Dec 19, 2018 at 11:44 PM 'Ludovic Petetin' via Ansible Development
> <ansible-devel@googlegroups.com> wrote:
>
>> Hi,
>>
>> the variable syntax seems to be wrong.
>>
>> Could you please try to replace:
>> replace: 'private_ip: {{ hostvars.[serverFqdn]['host_ip'] }}'
>>
>> by :
>> replace: "private_ip: {{ hostvars[serverFqdn]['host_ip'] }}"
>>
>> Thanks,
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ansible-devel+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> *Regards,*
> *Dineshkumar R*
> | M: +91 9590 332211| Mail:dineshkumarr.ramas...@gmail.com |
> *7* *Switch off as you go* *|**q* *Recycle always* *|* *P* *Your child
> deserves better world*
>


-- 
*Regards,*
*Dineshkumar R*
| M: +91 9590 332211| Mail:dineshkumarr.ramas...@gmail.com |
*7* *Switch off as you go* *|**q* *Recycle always* *|* *P* *Your child
deserves better world*

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to