From 109362d663f0fda720f0014dcd17686e7297f8a2 Mon Sep 17 00:00:00 2001 From: Edoardo Putti Date: Sun, 2 Jul 2017 18:55:03 +0200 Subject: [PATCH] get reverse proxy ip from hostname with filter --- roles/reverse_proxy/templates/http.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/reverse_proxy/templates/http.j2 b/roles/reverse_proxy/templates/http.j2 index 8925a46..4988904 100644 --- a/roles/reverse_proxy/templates/http.j2 +++ b/roles/reverse_proxy/templates/http.j2 @@ -8,7 +8,7 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_set_header X-NginX-Proxy true; - proxy_pass http://{{ hostvars[ansible_hostname]['ansible_host'] }}; + proxy_pass http://{{ hostvars | ip_from_inventory(ansible_hostname) }}; } location / {