Use facter
This commit is contained in:
parent
e220a1b1c6
commit
4948ada609
|
@ -5,7 +5,7 @@ redis_password="<%= @redis_password %>"
|
||||||
for index in 1 2 3; do
|
for index in 1 2 3; do
|
||||||
cur_host="redis${index}.$(hostname -d)"
|
cur_host="redis${index}.$(hostname -d)"
|
||||||
if [[ "${my_host}" == "${cur_host}" ]]; then
|
if [[ "${my_host}" == "${cur_host}" ]]; then
|
||||||
ip="$(hostname -I | awk '{print $1}')"
|
ip="$(facter networking.ip)"
|
||||||
else
|
else
|
||||||
ip="$(host "${cur_host}" | grep "has address" | awk '{print $NF}')"
|
ip="$(host "${cur_host}" | grep "has address" | awk '{print $NF}')"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue