Reduce number of ssh connections

Since we implemented multiline admin_node_command the number of
unnecessary ssh connections may be reduced.

Change-Id: Ia8f37b565ecc8448dca847a47eb68803ed535fe7
This commit is contained in:
Sergii Golovatiuk 2017-01-17 11:05:58 +01:00
parent 3490a01dbf
commit 86e13dc310
1 changed files with 5 additions and 4 deletions

View File

@ -279,8 +279,7 @@ if [ "${INVENTORY_REPO}" ]; then
fi
else
echo "Generating ansible inventory on admin node..."
admin_node_command mkdir -p $ADMIN_WORKSPACE/inventory
admin_node_command git init $ADMIN_WORKSPACE/inventory
admin_node_command "sh -c 'mkdir -p $ADMIN_WORKSPACE/inventory && git init $ADMIN_WORKSPACE/inventory'"
fi
echo "Uploading default settings and inventory..."
@ -330,8 +329,10 @@ KARGO_DEFAULTS_OPT="-e @$ADMIN_WORKSPACE/kargo/inventory/group_vars/all.yml"
echo "Committing inventory changes..."
if ! admin_node_command git config --get user.name; then
admin_node_command git config --global user.name "Anonymous User"
admin_node_command git config --global user.email "anon@example.org"
admin_node_command << EOF
git config --global user.name "Anonymous User"
git config --global user.email "anon@example.org"
EOF
fi
# Commit only if there are changes
if ! admin_node_command git -C $ADMIN_WORKSPACE/inventory diff --cached --name-only --exit-code; then