Btw, I already got what was happen. I was trusting the inventory file generated by Vagrant, but it was messing around with the SSH ports, and every time I created the environment it, it was changed. Just bind the private_network IP address on the inventory file and it is working like a charm!
2016-01-25 10:11 GMT-02:00 Jonatas Baldin <[email protected]>: > 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 > <https://groups.google.com/d/msgid/ansible-project/0e94e375-9271-4f8a-804b-14ff4f97c329%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- ____________________________ 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/CAJonpg-BJ3q9ru%3DuBbvpFgEGB7qTzHdVmaMb%2B-aXoRoF1Q%2BhYw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
