mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Merge pull request #15194 from Security-Onion-Solutions/reyesj2/ea-policy
move off of cmd.script with args \
This commit is contained in:
@@ -2,26 +2,30 @@
|
|||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use
|
# 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.
|
# this file except in compliance with the Elastic License 2.0.
|
||||||
|
|
||||||
{%- set GRIDNODETOKENGENERAL = salt['pillar.get']('global:fleet_grid_enrollment_token_general') -%}
|
{% set GRIDNODETOKEN = salt['pillar.get']('global:fleet_grid_enrollment_token_general') -%}
|
||||||
{%- set GRIDNODETOKENHEAVY = salt['pillar.get']('global:fleet_grid_enrollment_token_heavy') -%}
|
{% 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') %}
|
{% set AGENT_STATUS = salt['service.available']('elastic-agent') %}
|
||||||
{% if not AGENT_STATUS %}
|
{% if not AGENT_STATUS %}
|
||||||
|
|
||||||
{% if grains.role not in ['so-heavynode'] %}
|
pull_agent_installer:
|
||||||
run_installer:
|
file.managed:
|
||||||
cmd.script:
|
- name: /opt/so/so-elastic-agent_linux_amd64
|
||||||
- name: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64
|
- source: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64
|
||||||
- cwd: /opt/so
|
- mode: 755
|
||||||
- args: -token={{ GRIDNODETOKENGENERAL }}
|
- makedirs: True
|
||||||
- retry: True
|
|
||||||
{% else %}
|
|
||||||
run_installer:
|
|
||||||
cmd.script:
|
|
||||||
- name: salt://elasticfleet/files/so_agent-installers/so-elastic-agent_linux_amd64
|
|
||||||
- cwd: /opt/so
|
|
||||||
- args: -token={{ GRIDNODETOKENHEAVY }}
|
|
||||||
- retry: True
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
|
run_installer:
|
||||||
|
cmd.run:
|
||||||
|
- name: ./so-elastic-agent_linux_amd64 -token={{ GRIDNODETOKEN }}
|
||||||
|
- cwd: /opt/so
|
||||||
|
- retry:
|
||||||
|
attempts: 3
|
||||||
|
interval: 20
|
||||||
|
|
||||||
|
cleanup_agent_installer:
|
||||||
|
file.absent:
|
||||||
|
- name: /opt/so/so-elastic-agent_linux_amd64
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user