deploy ssh:move configuration load and validation into separate function

re-factor in support of adding multiple ssh runs with different
configurations
This commit is contained in:
dharp 2023-02-17 13:59:56 -06:00
parent 6470b0e095
commit 5c8a674d18

View File

@ -43,6 +43,19 @@ ssh_deploy() {
_debug _cca "$_cca" _debug _cca "$_cca"
_debug _cfullchain "$_cfullchain" _debug _cfullchain "$_cfullchain"
if ! _ssh_load_config; then
return 1
fi
_deploy_ssh_servers="$DEPLOY_SSH_SERVER"
for DEPLOY_SSH_SERVER in $_deploy_ssh_servers; do
_ssh_deploy
done
}
_ssh_load_config() {
_deploy_ssh_servers=""
# USER is required to login by SSH to remote host. # USER is required to login by SSH to remote host.
_migratedeployconf Le_Deploy_ssh_user DEPLOY_SSH_USER _migratedeployconf Le_Deploy_ssh_user DEPLOY_SSH_USER
_getdeployconf DEPLOY_SSH_USER _getdeployconf DEPLOY_SSH_USER
@ -169,11 +182,6 @@ ssh_deploy() {
else else
_info "Required commands batched and sent in single call to remote host" _info "Required commands batched and sent in single call to remote host"
fi fi
_deploy_ssh_servers="$DEPLOY_SSH_SERVER"
for DEPLOY_SSH_SERVER in $_deploy_ssh_servers; do
_ssh_deploy
done
} }
_ssh_deploy() { _ssh_deploy() {