From 2a4a7307f70d2b39229b3abb545d80554999a51f Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Wed, 8 Jul 2026 07:51:13 -0500 Subject: [PATCH] uninstall agent after downloading new one and getting gridtoken --- salt/elasticfleet/tools/sbin/so-elastic-agent-install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/elasticfleet/tools/sbin/so-elastic-agent-install b/salt/elasticfleet/tools/sbin/so-elastic-agent-install index 920b17137..bda8306f0 100644 --- a/salt/elasticfleet/tools/sbin/so-elastic-agent-install +++ b/salt/elasticfleet/tools/sbin/so-elastic-agent-install @@ -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