I see what you're saying. Tried to put it into play, but I'm obviously 
still missing some fundamental knowledge. How do I call the variable?

I tried:
- replace:
    dest=<filename>
    regexp='placeholder'
    replace={{ inventory_hostname }}
    backup =no

and it wouldn't work. I can get the file to work, as an experiment in place 
of {{ inventory_hostname }} I put {{ ansible_eth0.ipv4.address }} and the 
replace worked, putting the IP address of the target system where 
'placeholder' used to be, so I've got that part down, but calling variables 
I haven't got a handle on yet. 

Off to do more reading. Thanks for the help Giovanni!

regards, Richard


>
> I think you should try using the inventory_hostname variable for that. 
> It'll return those serverXX names you defined. 
>
> If you need more vars per host, I would use host_vars. 
>
>
> https://docs.ansible.com/playbooks_best_practices.html#group-and-host-variables
>  
>
> Giovanni 
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0bbd4be3-64ee-4fa2-a850-056c1575dc67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to