From ccb8ffd6eb2bba8926649460ad9fc0ed0dd473fa Mon Sep 17 00:00:00 2001 From: Josh Patterson Date: Mon, 3 Nov 2025 17:05:48 -0500 Subject: [PATCH] Update install_agent_grid.sls --- salt/elasticfleet/install_agent_grid.sls | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/salt/elasticfleet/install_agent_grid.sls b/salt/elasticfleet/install_agent_grid.sls index 57164b74d..4a185e0bb 100644 --- a/salt/elasticfleet/install_agent_grid.sls +++ b/salt/elasticfleet/install_agent_grid.sls @@ -2,8 +2,10 @@ # or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use # this file except in compliance with the Elastic License 2.0. -{%- set GRIDNODETOKENGENERAL = salt['pillar.get']('global:fleet_grid_enrollment_token_general') -%} -{%- set GRIDNODETOKENHEAVY = salt['pillar.get']('global:fleet_grid_enrollment_token_heavy') -%} +{% set GRIDNODETOKEN = salt['pillar.get']('global:fleet_grid_enrollment_token_general') -%} +{% if grains.role == 'so-heavynode' %} +{% set GRIDNODETOKEN = salt['pillar.get']('global:fleet_grid_enrollment_token_heavy') -%} +{% endif %} {% set AGENT_STATUS = salt['service.available']('elastic-agent') %} {% if not AGENT_STATUS %} @@ -15,19 +17,13 @@ pull_agent_installer: - mode: 755 - makedirs: True -{% if grains.role not in ['so-heavynode'] %} run_installer: cmd.run: - - name: ./so-elastic-agent_linux_amd64 -token={{ GRIDNODETOKENGENERAL }} + - name: ./so-elastic-agent_linux_amd64 -token={{ GRIDNODETOKEN }} - cwd: /opt/so - - retry: True -{% else %} -run_installer: - cmd.run: - - name: ./so-elastic-agent_linux_amd64 -token={{ GRIDNODETOKENHEAVY }} - - cwd: /opt/so - - retry: True -{% endif %} + - retry: + attempts: 3 + interval: 20 cleanup_agent_installer: file.absent: