uninstall agent after downloading new one and getting gridtoken

This commit is contained in:
reyesj2
2026-07-08 07:51:13 -05:00
parent f8de176f4b
commit 2a4a7307f7
@@ -33,8 +33,6 @@ uninstall_agent() {
fi
}
uninstall_agent
if [[ -z "$GRIDNODETOKEN" ]]; then
noderole=$(so-yaml.py get -r /etc/salt/grains role)
if [[ "$noderole" == "so-heavynode" ]]; then
@@ -55,6 +53,8 @@ if [[ ! -x /opt/so/so-elastic-agent_linux_amd64 ]]; then
salt-call state.sls_id pull_agent_installer elasticfleet.install_agent_grid queue=True
fi
uninstall_agent
if [[ -x /opt/so/so-elastic-agent_linux_amd64 ]]; then
attempts=0
cd /opt/so/ || exit 1