summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--blueprints/centos_vm.yaml-template1
1 files changed, 1 insertions, 0 deletions
diff --git a/blueprints/centos_vm.yaml-template b/blueprints/centos_vm.yaml-template
index 1211625..aa3bdb4 100644
--- a/blueprints/centos_vm.yaml-template
+++ b/blueprints/centos_vm.yaml-template
@@ -75,6 +75,7 @@ inputs:
CONSULNAME=consul_${CONSULVER}_linux_amd64
MYIP=`curl -Ss http://169.254.169.254/2009-04-04/meta-data/local-ipv4`
MYNAME=`hostname`
+ if [ ! -z "$(echo $MYNAME |grep '.')" ]; then MYNAME="$(echo $MYNAME | cut -f1 -d '.')"; fi
echo >>/etc/hosts
echo $MYIP $MYNAME >>/etc/hosts
mkdir -p /opt/consul/config /opt/consul/data /opt/consul/bin