From d1b1add1764133fe8d0abb9fc3fb4c0b22750a7a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Julien=20Pervill=C3=A9?=
 <julien.perville@perfect-memory.com>
Date: Wed, 16 Oct 2019 13:25:42 +0200
Subject: [PATCH] contrib/heketi: use inventory node ip in topology instead of
 guessing it (#5233)

---
 .../heketi/roles/provision/templates/heketi-storage.json.j2     | 2 +-
 .../heketi/roles/provision/templates/topology.json.j2           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/network-storage/heketi/roles/provision/templates/heketi-storage.json.j2 b/contrib/network-storage/heketi/roles/provision/templates/heketi-storage.json.j2
index 3089256c9..e985d255f 100644
--- a/contrib/network-storage/heketi/roles/provision/templates/heketi-storage.json.j2
+++ b/contrib/network-storage/heketi/roles/provision/templates/heketi-storage.json.j2
@@ -16,7 +16,7 @@
         {
           "addresses": [
             {
-              "ip": "{{ hostvars[node]['ansible_facts']['default_ipv4']['address'] }}"
+              "ip": "{{ hostvars[node].ip }}"
             }
           ],
           "ports": [
diff --git a/contrib/network-storage/heketi/roles/provision/templates/topology.json.j2 b/contrib/network-storage/heketi/roles/provision/templates/topology.json.j2
index b0ac29d7b..c19ce3286 100644
--- a/contrib/network-storage/heketi/roles/provision/templates/topology.json.j2
+++ b/contrib/network-storage/heketi/roles/provision/templates/topology.json.j2
@@ -12,7 +12,7 @@
                 "{{ node }}"
               ],
               "storage": [
-                "{{ hostvars[node]['ansible_facts']['default_ipv4']['address'] }}"
+                "{{ hostvars[node].ip }}"
               ]
             },
             "zone": 1
-- 
GitLab