From d2524a593f6cd9888a9f7d04f62cf4753421d2f4 Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Thu, 14 May 2026 17:12:02 -0500 Subject: [PATCH] use -verify flag during grid agent install to ensure agent health --- salt/elasticfleet/install_agent_grid.sls | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/salt/elasticfleet/install_agent_grid.sls b/salt/elasticfleet/install_agent_grid.sls index 482af2e1e..5201eddf2 100644 --- a/salt/elasticfleet/install_agent_grid.sls +++ b/salt/elasticfleet/install_agent_grid.sls @@ -14,20 +14,23 @@ pull_agent_installer: file.managed: - - name: /opt/so/so-elastic-agent_linux_amd64 + - name: /opt/so/log/agents/so-elastic-agent_linux_amd64 - source: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64 - mode: 755 - makedirs: True run_installer: cmd.run: - - name: ./so-elastic-agent_linux_amd64 -token={{ GRIDNODETOKEN }} -force - - cwd: /opt/so + {# Run agent installer and wait for it to report healthy status #} + - name: ./so-elastic-agent_linux_amd64 -token={{ GRIDNODETOKEN }} -force -verify + - cwd: /opt/so/log/agents - retry: attempts: 3 interval: 20 + - require: + - file: pull_agent_installer cleanup_agent_installer: file.absent: - - name: /opt/so/so-elastic-agent_linux_amd64 + - name: /opt/so/log/agents/so-elastic-agent_linux_amd64 {% endif %}