Force pseudo-terminal when running addhost

so that addhost also works on Debian
(also contains another small sync with nunoc-ops).
This commit is contained in:
John Van de Meulebrouck Brendgard 2019-02-13 15:46:57 +01:00
parent 56c8355c17
commit 3f56de1355
No known key found for this signature in database
GPG key ID: 807A5FD4B3337B77

11
addhost
View file

@ -37,6 +37,11 @@ defrepo=`git remote -v | grep ${remote:="ro"} | grep fetch | awk '{print $2}'`
rrepo=${repo:="$defrepo"} rrepo=${repo:="$defrepo"}
rtag=${tag:="changeme"} rtag=${tag:="changeme"}
if [ "x$rrepo" = "x" ]; then
echo "$0: repo not set in cosmos.conf and no git remote named 'ro' found"
exit 1
fi
if [ ! -d $cmd_hostname ]; then if [ ! -d $cmd_hostname ]; then
cp -pr default $cmd_fqdn cp -pr default $cmd_fqdn
git add $cmd_fqdn git add $cmd_fqdn
@ -46,7 +51,7 @@ fi
if [ "$cmd_do_bootstrap" = "yes" ]; then if [ "$cmd_do_bootstrap" = "yes" ]; then
scp apt/cosmos_1.5-1_all.deb apt/bootstrap-cosmos.sh root@$cmd_hostname: scp apt/cosmos_1.5-1_all.deb apt/bootstrap-cosmos.sh root@$cmd_hostname:
ssh root@$cmd_hostname ./bootstrap-cosmos.sh $cmd_fqdn $rrepo $rtag ssh -t root@$cmd_hostname ./bootstrap-cosmos.sh $cmd_fqdn $rrepo $rtag
ssh root@$cmd_hostname cosmos update ssh -t root@$cmd_hostname cosmos update
ssh root@$cmd_hostname cosmos apply ssh -t root@$cmd_hostname cosmos apply
fi fi