Hi, how are you guys?

I got a problem in variable substitution in one template. I don't know if 
I'm doing something wrong or it may be a bug.

Here's the deal:

I've got this playbook:
*---*
*- hosts: server*
*  become: yes*
*  vars:*
*    agent_server: 127.0.0.1*
*  roles:*
*    - server*
*    - agent*

*- hosts: proxy*
*  become: yes*
*  vars:*
*    proxy_server: 192.168.53.10*
*    agent_server: 127.0.0.1*
*  roles:*
*    - proxy*
*    - agent*

*- hosts: agent*
*  become: yes*
*  vars:*
*    agent_server: 192.168.53.11*
*  roles:*
*    - agent*

In one template inside *agent/templates/agent.conf *there's this line:
*server: {{ agent_server }}*

These vars are in */defaults *with a default value of *192.168.53.10*.

The problem is, after everything runs, the *server* host get the variables 
*agent_server *from *agent *host, the value of *192.168.53.11*. It DOES NOT 
get the specified value of *127.0.0.1*.

Can I put the same variable multiple times in a playbook, for different 
hosts with different values?

Thanks! 

____________________________
Jonatas Baldin
deployeveryday.com

-- 
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/0e94e375-9271-4f8a-804b-14ff4f97c329%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to