From 7c5a06304533ce5b67ce997334923692e593bccb Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Sun, 17 Mar 2019 13:26:44 +0100 Subject: [PATCH] gpg import with --no-tty With recent GPG versions, a TTY seems to be required to import keys. Since importing of keys need to work when running from cron, we pass --no-tty to those commands. This should mean that -t doesn't have to be passed to SSH on bootstrapping for new Debian hosts (tested on Raspbian). --- addhost | 6 +++--- global/post-tasks.d/015cosmos-trust | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addhost b/addhost index f8cbe64..2da1e36 100755 --- a/addhost +++ b/addhost @@ -51,7 +51,7 @@ fi if [ "$cmd_do_bootstrap" = "yes" ]; then scp apt/cosmos_1.5-1_all.deb apt/bootstrap-cosmos.sh root@$cmd_hostname: - ssh -t root@$cmd_hostname ./bootstrap-cosmos.sh $cmd_fqdn $rrepo $rtag - ssh -t root@$cmd_hostname cosmos update - ssh -t root@$cmd_hostname cosmos apply + ssh root@$cmd_hostname ./bootstrap-cosmos.sh $cmd_fqdn $rrepo $rtag + ssh root@$cmd_hostname cosmos update + ssh root@$cmd_hostname cosmos apply fi diff --git a/global/post-tasks.d/015cosmos-trust b/global/post-tasks.d/015cosmos-trust index f9f4667..85649e8 100755 --- a/global/post-tasks.d/015cosmos-trust +++ b/global/post-tasks.d/015cosmos-trust @@ -55,10 +55,10 @@ for k in $COSMOS_KEYS/*.pub; do if [[ ! ${KEYRING[$fp]} ]]; then echo -e "$0: ${bold}Importing new key ${fp}${reset} from ${k}" - cosmos gpg --import < $k + cosmos gpg --no-tty --import < $k elif [[ ${EXPIRED[$fp]} ]]; then echo -e "$0: ${bold}Re-importing expired key ${fp}${reset} from ${k}" - cosmos gpg --import < $k + cosmos gpg --no-tty --import < $k fi done