From dd56d7d2d1b10b3fd982667b511f4242c7eb954d Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Wed, 16 Sep 2020 09:48:38 -0400 Subject: [PATCH] change how we determine the ip. run script on search and import nodes as well --- salt/common/tools/sbin/so-elasticsearch-templates | 6 ++++-- salt/elasticsearch/init.sls | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/salt/common/tools/sbin/so-elasticsearch-templates b/salt/common/tools/sbin/so-elasticsearch-templates index dfbf07c42..2f1ebb82e 100755 --- a/salt/common/tools/sbin/so-elasticsearch-templates +++ b/salt/common/tools/sbin/so-elasticsearch-templates @@ -1,4 +1,6 @@ -{% set MANAGERIP = salt['pillar.get']('manager:mainip', '') %} +{%- set mainint = salt['pillar.get']('host:mainint') %} +{%- set MYIP = salt['grains.get']('ip_interfaces:' ~ mainint[0]) %} + #!/bin/bash # Copyright 2014,2015,2016,2017,2018,2019 Security Onion Solutions, LLC # @@ -16,7 +18,7 @@ # along with this program. If not, see . default_conf_dir=/opt/so/conf -ELASTICSEARCH_HOST="{{ MANAGERIP}}" +ELASTICSEARCH_HOST="{{ MYIP }}" ELASTICSEARCH_PORT=9200 #ELASTICSEARCH_AUTH="" diff --git a/salt/elasticsearch/init.sls b/salt/elasticsearch/init.sls index 75415990b..43db556fa 100644 --- a/salt/elasticsearch/init.sls +++ b/salt/elasticsearch/init.sls @@ -237,7 +237,7 @@ so-elasticsearch-pipelines: - file: esyml - file: so-elasticsearch-pipelines-file -{% if grains['role'] in ['so-manager', 'so-eval', 'so-managersearch', 'so-standalone', 'so-heavynode'] and TEMPLATES %} +{% if grains['role'] in ['so-manager', 'so-eval', 'so-managersearch', 'so-standalone', 'so-heavynode', 'so-searchnode', 'so-import'] and TEMPLATES %} so-elasticsearch-templates: cmd.run: - name: /usr/sbin/so-elasticsearch-templates