diff --git a/salt/common/tools/sbin/so-restart b/salt/common/tools/sbin/so-restart index b3864d2d1..14747d134 100755 --- a/salt/common/tools/sbin/so-restart +++ b/salt/common/tools/sbin/so-restart @@ -35,9 +35,6 @@ case $1 in "elastic-fleet"|"elasticfleet") docker_check_running "elastic-fleet" "--stop" docker rm "so-elastic-fleet" 2> /dev/null - # Removing the elastic fleet state directory, so that the next startup re-enrolls with a fresh policy - rm -rf /opt/so/conf/elastic-fleet/state - salt-call state.apply elasticfleet queue=True ;; *) diff --git a/salt/common/tools/sbin/so-stop b/salt/common/tools/sbin/so-stop index 9218b44f7..d036a7b63 100755 --- a/salt/common/tools/sbin/so-stop +++ b/salt/common/tools/sbin/so-stop @@ -29,8 +29,6 @@ case $1 in "elasticfleet"|"elastic-fleet") docker_check_running "elastic-fleet" "--stop" docker rm "so-elastic-fleet" 2> /dev/null - # Removing the elastic fleet state directory, so that the next startup re-enrolls with a fresh policy - rm -rf /opt/so/conf/elastic-fleet/state ;; *) docker_check_running "$1" "--stop" diff --git a/salt/elasticfleet/enabled.sls b/salt/elasticfleet/enabled.sls index d9694f07d..feb83fc2f 100644 --- a/salt/elasticfleet/enabled.sls +++ b/salt/elasticfleet/enabled.sls @@ -11,10 +11,6 @@ {# This value is generated during node install and stored in minion pillar #} {% set SERVICETOKEN = salt['pillar.get']('elasticfleet:config:server:es_token','') %} -{# Prevent Elastic Agent from re-enrolling with a new agent.id everytime the container starts up. - - if a fresh enrollment is needed use 'so-stop elasticfleet' - #} -{% set ENROLLED = salt['file.file_exists']('/opt/so/conf/elastic-fleet/state/fleet.enc') %} include: - ca @@ -70,7 +66,6 @@ so-elastic-fleet: - /etc/pki/elasticfleet-server.crt:/etc/pki/elasticfleet-server.crt:ro - /etc/pki/elasticfleet-server.key:/etc/pki/elasticfleet-server.key:ro - /etc/pki/tls/certs/intca.crt:/etc/pki/tls/certs/intca.crt:ro - - /opt/so/conf/elastic-fleet/state:/usr/share/elastic-agent/state - /opt/so/log/elasticfleet:/usr/share/elastic-agent/logs {% if DOCKERMERGED.containers['so-elastic-fleet'].custom_bind_mounts %} {% for BIND in DOCKERMERGED.containers['so-elastic-fleet'].custom_bind_mounts %} @@ -78,7 +73,6 @@ so-elastic-fleet: {% endfor %} {% endif %} - environment: - {% if not ENROLLED %} - FLEET_SERVER_ENABLE=true - FLEET_URL=https://{{ GLOBALS.hostname }}:8220 - FLEET_SERVER_ELASTICSEARCH_HOST=https://{{ GLOBALS.manager }}:9200 @@ -88,9 +82,6 @@ so-elastic-fleet: - FLEET_SERVER_CERT_KEY=/etc/pki/elasticfleet-server.key - FLEET_CA=/etc/pki/tls/certs/intca.crt - FLEET_SERVER_ELASTICSEARCH_CA=/etc/pki/tls/certs/intca.crt - {% endif %} - - STATE_PATH=/usr/share/elastic-agent/state - - CONFIG_PATH=/usr/share/elastic-agent/state - LOGS_PATH=logs {% if DOCKERMERGED.containers['so-elastic-fleet'].extra_env %} {% for XTRAENV in DOCKERMERGED.containers['so-elastic-fleet'].extra_env %} @@ -109,7 +100,6 @@ so-elastic-fleet: - x509: etc_elasticfleet_crt - require: - file: trusttheca - - file: eastatedir - x509: etc_elasticfleet_key - x509: etc_elasticfleet_crt