Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

fix typo #181

Merged
merged 3 commits into from
Nov 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions install/salt/salt/install/script/getip.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[ -f "/tmp/LOCAL_IP" ] && ip=$(cat /tmp/LOCAL_IP 2> /dev/null) || ip=$(cat /tmp/salt-minion-uuid | grep "hostip" | awk -F+ '{print $2}')
[ -f "/tmp/.role" ] && role="worker" || cat /etc/hostname | grep compute && role="worker" || role="master"

host=$(hostname)
#ip=$(cat /tmp/salt-minion-uuid | grep "hostip" | awk -F+ '{print $2}')
[ -f "/tmp/LOCAL_IP" ] && ip=$(cat /tmp/LOCAL_IP 2> /dev/null) || ip=$(cat /tmp/salt-minion-uuid | grep "$host=" | awk -F= '{print $2}')
uuid=$(cat /tmp/salt-minion-uuid | grep "$ip+" | awk -F+ '{print $2}')

[ -z "$ip" ] && ip=$(ip ad|grep inet|egrep ' 10.|172.|192.168'|awk '{print $2}'|cut -d '/' -f 1|grep -v '172.30.42.1'|head -1)
if [ -z "$uuid" ];then
cat > /etc/salt/minion.d/minion.ex.conf <<EOF
Expand All @@ -16,10 +16,10 @@ EOF
else
cat > /etc/salt/minion.d/minion.ex.conf <<EOF
grains:
uuid: $uuid
uuid: $uuid
mip:
- $ip
node_role:
- $role
EOF
fi
fi
2 changes: 1 addition & 1 deletion scripts/compute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ uuid=$5

yq w -i /srv/salt/salt/install/script/hosts.yaml compute.$1.hostname $1
yq w -i /srv/salt/salt/install/script/hosts.yaml compute.$1.ip $2
yq w -i /srv/salt/salt/install/script/hosts.yaml compute.$1.hostip "$1+$2"
yq w -i /srv/salt/salt/install/script/hosts.yaml compute.$1.hostip "$1=$2"

[ -z "$uuid" ] || (
yq w -i /srv/salt/salt/install/script/hosts.yaml compute.$1.uuid $5
Expand Down
2 changes: 1 addition & 1 deletion scripts/manage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
uuid=$5
yq w -i /srv/salt/salt/install/script/hosts.yaml manage.$1.hostname $1
yq w -i /srv/salt/salt/install/script/hosts.yaml manage.$1.ip $2
yq w -i /srv/salt/salt/install/script/hosts.yaml manage.$1.hostip "$1+$2"
yq w -i /srv/salt/salt/install/script/hosts.yaml manage.$1.hostip "$1=$2"

[ -z "$uuid" ] || (
yq w -i /srv/salt/salt/install/script/hosts.yaml manage.$1.uuid $5
Expand Down
14 changes: 7 additions & 7 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Check_Internet(){
if [ "$?" -eq 0 ];then
return 0
else
Echo_Error "Unable to connect to internet."
error "Unable to connect to internet."
fi
}

Expand All @@ -352,7 +352,7 @@ Check_Docker_Version(){
existDocker=$(docker -v | awk '{print $3$5}' 2>/dev/null)
grDocker=$(Read_Sls_File docker.version)
if [ "$existDocker" != "$grDocker" ];then
Echo_Error "Rainbond integrated customized docker, Please stop and uninstall it first."
error "Rainbond integrated customized docker, Please stop and uninstall it first."
fi
fi

Expand All @@ -363,20 +363,20 @@ Check_System_Version(){
"centos")
[ "$SYS_VER" == "7" ] \
&& return 0 \
|| Echo_Error "$SYS_NAME:$SYS_VER is not supported temporarily."
|| error "$SYS_NAME:$SYS_VER is not supported temporarily."
;;
"ubuntu")
[ "$SYS_VER" == "16.04" ] \
&& return 0 \
|| Echo_Error "$SYS_NAME:$SYS_VER is not supported temporarily."
|| error "$SYS_NAME:$SYS_VER is not supported temporarily."
;;
"debian")
[ "$SYS_VER" == "8" -o "$SYS_VER" == "9" ] \
&& return 0 \
|| Echo_Error "$SYS_NAME:$SYS_VER is not supported temporarily."
|| error "$SYS_NAME:$SYS_VER is not supported temporarily."
;;
*)
Echo_Error "$SYS_NAME:$SYS_VER is not supported temporarily."
error "$SYS_NAME:$SYS_VER is not supported temporarily."
;;
esac
}
Expand All @@ -397,7 +397,7 @@ Get_Hardware_Info(){
if [ "$CPU_STATUS" == '0' -a "$MEM_STATUS" == '0' ];then
info "Rainbond minimum requirement is ${CPU_LIMIT} CPUs,${MEM_LIMIT}G memory.You Have ${CPU_NUM} CPUs,${MEM_SIZE}G memory."
else
Echo_Error "Rainbond minimum requirement is ${CPU_LIMIT} CPUs,${MEM_LIMIT}G memory.You Have ${CPU_NUM} CPUs,${MEM_SIZE}G memory."
error "Rainbond minimum requirement is ${CPU_LIMIT} CPUs,${MEM_LIMIT}G memory.You Have ${CPU_NUM} CPUs,${MEM_SIZE}G memory."
fi
}

Expand Down