mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #5066 from Security-Onion-Solutions/issue/2806
dont run curator on searchnode if truecluster is enabled
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
{% set MANAGER = salt['grains.get']('master') %}
|
{% set MANAGER = salt['grains.get']('master') %}
|
||||||
{% if grains['role'] in ['so-eval', 'so-node', 'so-managersearch', 'so-heavynode', 'so-standalone'] %}
|
{% if grains['role'] in ['so-eval', 'so-node', 'so-managersearch', 'so-heavynode', 'so-standalone'] %}
|
||||||
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
|
{% from 'elasticsearch/auth.map.jinja' import ELASTICAUTH with context %}
|
||||||
|
{% from "curator/map.jinja" import CURATOROPTIONS with context %}
|
||||||
# Curator
|
# Curator
|
||||||
# Create the group
|
# Create the group
|
||||||
curatorgroup:
|
curatorgroup:
|
||||||
@@ -118,8 +119,10 @@ so-curatordeletecron:
|
|||||||
- dayweek: '*'
|
- dayweek: '*'
|
||||||
|
|
||||||
so-curator:
|
so-curator:
|
||||||
docker_container.running:
|
docker_container.{{ CURATOROPTIONS.status }}:
|
||||||
|
{% if CURATOROPTIONS.status == 'running' %}
|
||||||
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-curator:{{ VERSION }}
|
- image: {{ MANAGER }}:5000/{{ IMAGEREPO }}/so-curator:{{ VERSION }}
|
||||||
|
- start: {{ CURATOROPTIONS.start }}
|
||||||
- hostname: curator
|
- hostname: curator
|
||||||
- name: so-curator
|
- name: so-curator
|
||||||
- user: curator
|
- user: curator
|
||||||
@@ -129,11 +132,27 @@ so-curator:
|
|||||||
- /opt/so/conf/curator/curator.yml:/etc/curator/config/curator.yml:ro
|
- /opt/so/conf/curator/curator.yml:/etc/curator/config/curator.yml:ro
|
||||||
- /opt/so/conf/curator/action/:/etc/curator/action:ro
|
- /opt/so/conf/curator/action/:/etc/curator/action:ro
|
||||||
- /opt/so/log/curator:/var/log/curator:rw
|
- /opt/so/log/curator:/var/log/curator:rw
|
||||||
|
{% else %}
|
||||||
|
- force: True
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
append_so-curator_so-status.conf:
|
append_so-curator_so-status.conf:
|
||||||
file.append:
|
file.append:
|
||||||
- name: /opt/so/conf/so-status/so-status.conf
|
- name: /opt/so/conf/so-status/so-status.conf
|
||||||
- text: so-curator
|
- text: so-curator
|
||||||
|
- unless: grep -q so-curator /opt/so/conf/so-status/so-status.conf
|
||||||
|
|
||||||
|
{% if not CURATOROPTIONS.start %}
|
||||||
|
so-curator_so-status.disabled:
|
||||||
|
file.comment:
|
||||||
|
- name: /opt/so/conf/so-status/so-status.conf
|
||||||
|
- regex: ^so-curator$
|
||||||
|
{% else %}
|
||||||
|
delete_so-curator_so-status.disabled:
|
||||||
|
file.uncomment:
|
||||||
|
- name: /opt/so/conf/so-status/so-status.conf
|
||||||
|
- regex: ^so-curator$
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# Begin Curator Cron Jobs
|
# Begin Curator Cron Jobs
|
||||||
|
|
||||||
|
|||||||
12
salt/curator/map.jinja
Normal file
12
salt/curator/map.jinja
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{% set CURATOROPTIONS = {} %}
|
||||||
|
{% set ENABLED = salt['pillar.get']('curator:enabled', True) %}
|
||||||
|
{% set TRUECLUSTER = salt['pillar.get']('elasticsearch:true_cluster', False) %}
|
||||||
|
|
||||||
|
# don't start the docker container if searchnode and true clustering is enabled or disabled via pillar
|
||||||
|
{% if (grains.id.split('_')|last == 'searchnode' and TRUECLUSTER) or not ENABLED %}
|
||||||
|
{% do CURATOROPTIONS.update({'start': False}) %}
|
||||||
|
{% do CURATOROPTIONS.update({'status': 'absent'}) %}
|
||||||
|
{% else %}
|
||||||
|
{% do CURATOROPTIONS.update({'start': True}) %}
|
||||||
|
{% do CURATOROPTIONS.update({'status': 'running'}) %}
|
||||||
|
{% endif %}
|
||||||
11
salt/top.sls
11
salt/top.sls
@@ -11,7 +11,6 @@
|
|||||||
{% set FILEBEAT = salt['pillar.get']('filebeat:enabled', True) %}
|
{% set FILEBEAT = salt['pillar.get']('filebeat:enabled', True) %}
|
||||||
{% set KIBANA = salt['pillar.get']('kibana:enabled', True) %}
|
{% set KIBANA = salt['pillar.get']('kibana:enabled', True) %}
|
||||||
{% set LOGSTASH = salt['pillar.get']('logstash:enabled', True) %}
|
{% set LOGSTASH = salt['pillar.get']('logstash:enabled', True) %}
|
||||||
{% set CURATOR = salt['pillar.get']('curator:enabled', True) %}
|
|
||||||
{% set REDIS = salt['pillar.get']('redis:enabled', True) %}
|
{% set REDIS = salt['pillar.get']('redis:enabled', True) %}
|
||||||
{% set STRELKA = salt['pillar.get']('strelka:enabled', '0') %}
|
{% set STRELKA = salt['pillar.get']('strelka:enabled', '0') %}
|
||||||
{% import_yaml 'salt/minion.defaults.yaml' as saltversion %}
|
{% import_yaml 'salt/minion.defaults.yaml' as saltversion %}
|
||||||
@@ -127,9 +126,7 @@ base:
|
|||||||
{%- if FILEBEAT %}
|
{%- if FILEBEAT %}
|
||||||
- filebeat
|
- filebeat
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if CURATOR %}
|
|
||||||
- curator
|
- curator
|
||||||
{%- endif %}
|
|
||||||
{%- if ELASTALERT %}
|
{%- if ELASTALERT %}
|
||||||
- elastalert
|
- elastalert
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
@@ -267,9 +264,7 @@ base:
|
|||||||
{%- if FILEBEAT %}
|
{%- if FILEBEAT %}
|
||||||
- filebeat
|
- filebeat
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if CURATOR %}
|
|
||||||
- curator
|
- curator
|
||||||
{%- endif %}
|
|
||||||
{%- if ELASTALERT %}
|
{%- if ELASTALERT %}
|
||||||
- elastalert
|
- elastalert
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
@@ -313,9 +308,7 @@ base:
|
|||||||
{%- if LOGSTASH %}
|
{%- if LOGSTASH %}
|
||||||
- logstash
|
- logstash
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if CURATOR %}
|
|
||||||
- curator
|
- curator
|
||||||
{%- endif %}
|
|
||||||
{%- if FILEBEAT %}
|
{%- if FILEBEAT %}
|
||||||
- filebeat
|
- filebeat
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
@@ -357,9 +350,7 @@ base:
|
|||||||
{%- if REDIS %}
|
{%- if REDIS %}
|
||||||
- redis
|
- redis
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if CURATOR %}
|
|
||||||
- curator
|
- curator
|
||||||
{%- endif %}
|
|
||||||
{%- if KIBANA %}
|
{%- if KIBANA %}
|
||||||
- kibana
|
- kibana
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
@@ -412,9 +403,7 @@ base:
|
|||||||
{%- if REDIS %}
|
{%- if REDIS %}
|
||||||
- redis
|
- redis
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if CURATOR %}
|
|
||||||
- curator
|
- curator
|
||||||
{%- endif %}
|
|
||||||
{%- if FILEBEAT %}
|
{%- if FILEBEAT %}
|
||||||
- filebeat
|
- filebeat
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user