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