1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

'ansible --version' output was being truncated

This commit is contained in:
root 2021-04-13 12:14:27 -04:00
parent 5fba4fb3bf
commit 2ebf8aefc9
3 changed files with 12 additions and 5 deletions

View file

@ -74,7 +74,10 @@ echo -e "IIAB INSTALL INSTRUCTIONS: (OLDER, MANUAL APPROACH)"
echo -e "https://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n"
if [ $(command -v ansible) ]; then # "command -v" is POSIX compliant; also catches built-in commands like "cd"
CURR_VER=`ansible --version | head -1 | awk '{print $2}'` # To match iiab-install. Was: CURR_VER=`ansible --version | head -n 1 | cut -f 2 -d " "`
CURR_VER=$(ansible --version | head -1 | cut -f 2- -d " ")
# Above works with 'ansible [core 2.11.0rc2]' -- these old ways do not:
#CURR_VER=$(ansible --version | head -1 | awk '{print $2}')
#CURR_VER=$(ansible --version | head -1 | sed -e 's/.* //')
echo -e "CURRENTLY INSTALLED ANSIBLE: $CURR_VER -- LET'S TRY TO UPGRADE IT!"
else
echo -e "ANSIBLE NOT FOUND ON THIS COMPUTER -- LET'S TRY TO INSTALL IT!"

View file

@ -89,7 +89,10 @@ tmp=$(cat /proc/device-tree/model) &&
RPI_MODEL=$tmp
tmp=$(ansible --version) &&
ANSIBLE_VERSION=$(echo "$tmp" | head -n 1 | cut -f 2 -d " ")
ANSIBLE_VERSION=$(echo "$tmp" | head -1 | cut -f 2- -d " ")
# Above works with 'ansible [core 2.11.0rc2]' -- these old ways do not:
#ANSIBLE_VERSION=$(echo "$tmp" | head -1 | awk '{print $2}')
#ANSIBLE_VERSION=$(echo "$tmp" | head -1 | sed -e 's/.* //')
# THE LAST 3 BELOW ARE DIFFERENT as "systemctl is-enabled" unhelpfully returns