From f6a85be0c6ef983476cc782bf7fe8949aefd1772 Mon Sep 17 00:00:00 2001 From: Parker McGee Date: Fri, 19 Feb 2021 08:21:25 -0500 Subject: [PATCH] Fix Fleet install in ESXi to use the latest fleet.zip release --- ESXi/ansible/roles/logger/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ESXi/ansible/roles/logger/tasks/main.yml b/ESXi/ansible/roles/logger/tasks/main.yml index 8f33d0e90..40bf5f3f8 100644 --- a/ESXi/ansible/roles/logger/tasks/main.yml +++ b/ESXi/ansible/roles/logger/tasks/main.yml @@ -300,7 +300,7 @@ executable: /bin/bash become: yes shell: | - if [ -f "/opt/fleet" ]; then + if [ -d "/opt/fleet" ]; then echo "[$(date +%H:%M:%S)]: Fleet is already installed" else cd /opt || exit 1 @@ -314,7 +314,7 @@ mysql -uroot -pkolide -e "create database kolide;" # Always download the latest release of Fleet - curl -s https://api.github.com/repos/fleetdm/fleet/releases/latest | grep 'https://github.com' | grep "/fleet.zip" | cut -d ':' -f 2,3 | tr -d '"' | wget --progress=bar:force -i - + curl -s https://api.github.com/repos/fleetdm/fleet/releases | grep 'https://github.com' | grep "/fleet.zip" | cut -d ':' -f 2,3 | tr -d '"' | tr -d ' ' | head -1 | wget --progress=bar:force -i - unzip fleet.zip -d fleet cp fleet/linux/fleetctl /usr/local/bin/fleetctl && chmod +x /usr/local/bin/fleetctl cp fleet/linux/fleet /usr/local/bin/fleet && chmod +x /usr/local/bin/fleet