From cc66daba1af3a8bb638ccbccca2d2bf3e7c3ea31 Mon Sep 17 00:00:00 2001 From: weslambert Date: Thu, 11 Jan 2024 14:49:39 -0500 Subject: [PATCH 1/4] Make sure optional integration pillar values are merged with defaults --- salt/elasticfleet/config.sls | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/salt/elasticfleet/config.sls b/salt/elasticfleet/config.sls index 5d5d3e826a..53d838c7cb 100644 --- a/salt/elasticfleet/config.sls +++ b/salt/elasticfleet/config.sls @@ -4,7 +4,7 @@ # Elastic License 2.0. {% from 'allowed_states.map.jinja' import allowed_states %} -{% from 'vars/globals.map.jinja' import GLOBALS %} +{% from 'vars/globals.map.jinja' import GLOBALS % {% if sls.split('.')[0] in allowed_states %} {% set node_data = salt['pillar.get']('node_data') %} @@ -104,8 +104,9 @@ eaoptionalintegrationsdir: {% for minion in node_data %} {% set role = node_data[minion]["role"] %} {% if role in [ "eval","fleet","heavynode","import","manager","managersearch","standalone" ] %} -{% set optional_integrations = salt['pillar.get']('elasticfleet:optional_integrations', {}) %} -{% set integration_keys = salt['pillar.get']('elasticfleet:optional_integrations', {}).keys() %} +{% from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %} +{% set optional_integrations = ELASTICFLEETMERGED.optional_integrations %} +{% set integration_keys = optional_integrations.keys() %} fleet_server_integrations_{{ minion }}: file.directory: - name: /opt/so/conf/elastic-fleet/integrations-optional/FleetServer_{{ minion }} From ea5097f1b4b5887010c34b39ede53e34c633833e Mon Sep 17 00:00:00 2001 From: weslambert Date: Thu, 11 Jan 2024 14:51:01 -0500 Subject: [PATCH 2/4] Add back curly brace --- salt/elasticfleet/config.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/elasticfleet/config.sls b/salt/elasticfleet/config.sls index 53d838c7cb..40f4124882 100644 --- a/salt/elasticfleet/config.sls +++ b/salt/elasticfleet/config.sls @@ -4,7 +4,7 @@ # Elastic License 2.0. {% from 'allowed_states.map.jinja' import allowed_states %} -{% from 'vars/globals.map.jinja' import GLOBALS % +{% from 'vars/globals.map.jinja' import GLOBALS %} {% if sls.split('.')[0] in allowed_states %} {% set node_data = salt['pillar.get']('node_data') %} From f5b59cacec79efbd9027152623a1eb330aedccf2 Mon Sep 17 00:00:00 2001 From: weslambert Date: Thu, 11 Jan 2024 14:56:01 -0500 Subject: [PATCH 3/4] Move ELASTICFLEETMERGED import --- salt/elasticfleet/config.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/elasticfleet/config.sls b/salt/elasticfleet/config.sls index 40f4124882..706f6e5ad7 100644 --- a/salt/elasticfleet/config.sls +++ b/salt/elasticfleet/config.sls @@ -5,6 +5,7 @@ {% from 'allowed_states.map.jinja' import allowed_states %} {% from 'vars/globals.map.jinja' import GLOBALS %} +{% from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %} {% if sls.split('.')[0] in allowed_states %} {% set node_data = salt['pillar.get']('node_data') %} @@ -104,7 +105,6 @@ eaoptionalintegrationsdir: {% for minion in node_data %} {% set role = node_data[minion]["role"] %} {% if role in [ "eval","fleet","heavynode","import","manager","managersearch","standalone" ] %} -{% from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %} {% set optional_integrations = ELASTICFLEETMERGED.optional_integrations %} {% set integration_keys = optional_integrations.keys() %} fleet_server_integrations_{{ minion }}: From 880300d644199e0479b9d60328e5c12d9a10ff0c Mon Sep 17 00:00:00 2001 From: weslambert Date: Thu, 11 Jan 2024 14:58:21 -0500 Subject: [PATCH 4/4] Move ELASTICFLEETMERGED import under allowed states --- salt/elasticfleet/config.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/elasticfleet/config.sls b/salt/elasticfleet/config.sls index 706f6e5ad7..f8566ed945 100644 --- a/salt/elasticfleet/config.sls +++ b/salt/elasticfleet/config.sls @@ -5,8 +5,8 @@ {% from 'allowed_states.map.jinja' import allowed_states %} {% from 'vars/globals.map.jinja' import GLOBALS %} -{% from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %} {% if sls.split('.')[0] in allowed_states %} +{% from 'elasticfleet/map.jinja' import ELASTICFLEETMERGED %} {% set node_data = salt['pillar.get']('node_data') %} # Add EA Group