diff --git a/salt/common/tools/sbin/so-elastic-fleet-setup b/salt/common/tools/sbin/so-elastic-fleet-setup index b82890faa..b7bf1b3c3 100755 --- a/salt/common/tools/sbin/so-elastic-fleet-setup +++ b/salt/common/tools/sbin/so-elastic-fleet-setup @@ -84,6 +84,11 @@ printf '%s\n'\ " url: '{{ GLOBALS.manager_ip }}'"\ "" >> "$pillar_file" +#Store Grid Nodes Enrollment token in Global pillar +global_pillar_file=/opt/so/saltstack/local/pillar/soc_global.sls +printf '%s\n'\ + " fleet_grid_enrollment_token: '$GRIDNODESENROLLMENTOKEN'"\ + "" >> "$global_pillar_file" # Call Elastic-Fleet Salt State salt-call state.apply elastic-fleet queue=True diff --git a/salt/elastic-fleet/install_agent_grid.sls b/salt/elastic-fleet/install_agent_grid.sls index 857e31315..2f848ac2e 100644 --- a/salt/elastic-fleet/install_agent_grid.sls +++ b/salt/elastic-fleet/install_agent_grid.sls @@ -2,7 +2,7 @@ # 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 GRIDNODETOKEN = salt['pillar.get']('elasticfleet:server:grid_enrollment') -%} +{%- set GRIDNODETOKEN = salt['pillar.get']('global:fleet_grid_enrollment_token') -%} {% set AGENT_STATUS = salt['service.available']('elastic-agent') %} {% if not AGENT_STATUS %} diff --git a/salt/firewall/ports/ports.yaml b/salt/firewall/ports/ports.yaml index 22c6c8b09..de0539258 100644 --- a/salt/firewall/ports/ports.yaml +++ b/salt/firewall/ports/ports.yaml @@ -32,6 +32,7 @@ firewall: elastic_agent_data: tcp: - 5055 + - 9200 endgame: tcp: - 3765 diff --git a/salt/top.sls b/salt/top.sls index 25ec1ccd4..0a57f6e4e 100644 --- a/salt/top.sls +++ b/salt/top.sls @@ -63,6 +63,7 @@ base: {%- endif %} - schedule - docker_clean + - elastic-fleet.install_agent_grid '*_eval and G@saltversion:{{saltversion}}': - match: compound @@ -108,6 +109,7 @@ base: - playbook - redis {%- endif %} + - elastic-fleet.install_agent_grid - docker_clean '*_manager and G@saltversion:{{saltversion}}': @@ -148,6 +150,7 @@ base: - schedule - soctopus - playbook + - elastic-fleet.install_agent_grid - docker_clean '*_standalone and G@saltversion:{{saltversion}}': @@ -199,6 +202,7 @@ base: - playbook - docker_clean - elastic-fleet + - elastic-fleet.install_agent_grid '*_searchnode and G@saltversion:{{saltversion}}': - match: compound @@ -214,6 +218,7 @@ base: - logstash {%- endif %} - schedule + - elastic-fleet.install_agent_grid - docker_clean '*_managersearch and G@saltversion:{{saltversion}}': @@ -254,6 +259,7 @@ base: - schedule - soctopus - playbook + - elastic-fleet.install_agent_grid - docker_clean '*_heavynode and G@saltversion:{{saltversion}}': @@ -282,6 +288,7 @@ base: - zeek {%- endif %} - schedule + - elastic-fleet.install_agent_grid - docker_clean '*_import and G@saltversion:{{saltversion}}': @@ -312,6 +319,7 @@ base: - zeek - schedule - docker_clean + - elastic-fleet.install_agent_grid - elastic-fleet '*_receiver and G@saltversion:{{saltversion}}': @@ -327,6 +335,7 @@ base: - redis {%- endif %} - schedule + - elastic-fleet.install_agent_grid - docker_clean '*_idh and G@saltversion:{{saltversion}}': @@ -336,6 +345,7 @@ base: - telegraf - firewall - schedule + - elastic-fleet.install_agent_grid - docker_clean - idh