move off of cmd.script with args \

https://github.com/saltstack/salt/issues/68298
This commit is contained in:
reyesj2
2025-11-03 15:31:14 -06:00
parent 2f6c1b82a6
commit 5a8ea57a1b

View File

@@ -8,20 +8,28 @@
{% set AGENT_STATUS = salt['service.available']('elastic-agent') %} {% set AGENT_STATUS = salt['service.available']('elastic-agent') %}
{% if not AGENT_STATUS %} {% 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'] %} {% if grains.role not in ['so-heavynode'] %}
run_installer: run_installer:
cmd.script: cmd.run:
- name: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64 - name: ./so-elastic-agent_linux_amd64 -token={{ GRIDNODETOKENGENERAL }}
- cwd: /opt/so - cwd: /opt/so
- args: -token={{ GRIDNODETOKENGENERAL }}
- retry: True - retry: True
{% else %} {% else %}
run_installer: run_installer:
cmd.script: cmd.run:
- name: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64 - name: ./so-elastic-agent_linux_amd64 -token={{ GRIDNODETOKENHEAVY }}
- cwd: /opt/so - cwd: /opt/so
- args: -token={{ GRIDNODETOKENHEAVY }}
- retry: True - retry: True
{% endif %} {% endif %}
cleanup_agent_installer:
file.absent:
- name: /opt/so/so-elastic-agent_linux_amd64
{% endif %} {% endif %}