From 4948ada609fd742208a08e3786c9bd1b7fdaee8d Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Wed, 5 Apr 2023 12:26:11 +0200 Subject: [PATCH] Use facter --- templates/redis_cluster/reset_cluster.erb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/redis_cluster/reset_cluster.erb.sh b/templates/redis_cluster/reset_cluster.erb.sh index 634a1ff..dd608f1 100644 --- a/templates/redis_cluster/reset_cluster.erb.sh +++ b/templates/redis_cluster/reset_cluster.erb.sh @@ -5,7 +5,7 @@ redis_password="<%= @redis_password %>" for index in 1 2 3; do cur_host="redis${index}.$(hostname -d)" if [[ "${my_host}" == "${cur_host}" ]]; then - ip="$(hostname -I | awk '{print $1}')" + ip="$(facter networking.ip)" else ip="$(host "${cur_host}" | grep "has address" | awk '{print $NF}')" fi