From 5a8ea57a1b663abd0bfdbc6e92ed6441e547e7c8 Mon Sep 17 00:00:00 2001 From: reyesj2 <94730068+reyesj2@users.noreply.github.com> Date: Mon, 3 Nov 2025 15:31:14 -0600 Subject: [PATCH] move off of cmd.script with args \ https://github.com/saltstack/salt/issues/68298 --- salt/elasticfleet/install_agent_grid.sls | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/salt/elasticfleet/install_agent_grid.sls b/salt/elasticfleet/install_agent_grid.sls index 8b5bb4c3e..57164b74d 100644 --- a/salt/elasticfleet/install_agent_grid.sls +++ b/salt/elasticfleet/install_agent_grid.sls @@ -8,20 +8,28 @@ {% set AGENT_STATUS = salt['service.available']('elastic-agent') %} {% if not AGENT_STATUS %} +pull_agent_installer: + file.managed: + - name: /opt/so/so-elastic-agent_linux_amd64 + - source: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64 + - mode: 755 + - makedirs: True + {% if grains.role not in ['so-heavynode'] %} run_installer: - cmd.script: - - name: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64 + cmd.run: + - name: ./so-elastic-agent_linux_amd64 -token={{ GRIDNODETOKENGENERAL }} - cwd: /opt/so - - args: -token={{ GRIDNODETOKENGENERAL }} - retry: True {% else %} run_installer: - cmd.script: - - name: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64 + cmd.run: + - name: ./so-elastic-agent_linux_amd64 -token={{ GRIDNODETOKENHEAVY }} - cwd: /opt/so - - args: -token={{ GRIDNODETOKENHEAVY }} - retry: True {% endif %} +cleanup_agent_installer: + file.absent: + - name: /opt/so/so-elastic-agent_linux_amd64 {% endif %}