mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 18:22:47 +01:00
Merge pull request #4188 from Security-Onion-Solutions/issue/3264
install influxdb and grafana during setup prior to final highstate
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
{% if sls in allowed_states %}
|
{% if sls in allowed_states %}
|
||||||
|
|
||||||
{% set GRAFANA = salt['pillar.get']('manager:grafana', '0') %}
|
{% set GRAFANA = salt['pillar.get']('manager:grafana', '0') %}
|
||||||
|
|
||||||
|
{% if grains['role'] in ['so-manager', 'so-managersearch', 'so-eval', 'so-standalone'] and GRAFANA == 1 %}
|
||||||
|
|
||||||
{% set MANAGER = salt['grains.get']('master') %}
|
{% set MANAGER = salt['grains.get']('master') %}
|
||||||
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
|
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
|
||||||
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
|
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
|
||||||
@@ -9,9 +12,7 @@
|
|||||||
{% set influxdb = salt['grains.filter_by'](default_settings, default='influxdb', merge=salt['pillar.get']('influxdb', {})) %}
|
{% set influxdb = salt['grains.filter_by'](default_settings, default='influxdb', merge=salt['pillar.get']('influxdb', {})) %}
|
||||||
{% from 'salt/map.jinja' import PYTHON3INFLUX with context %}
|
{% from 'salt/map.jinja' import PYTHON3INFLUX with context %}
|
||||||
{% from 'salt/map.jinja' import PYTHONINFLUXVERSION with context %}
|
{% from 'salt/map.jinja' import PYTHONINFLUXVERSION with context %}
|
||||||
{% set PYTHONINFLUXVERSIONINSTALLED = salt['cmd.run']("python3 -c 'import influxdb; print (influxdb.__version__)'", python_shell=True) %}
|
{% set PYTHONINFLUXVERSIONINSTALLED = salt['cmd.run']("python3 -c \"exec('try:import influxdb; print (influxdb.__version__)\\nexcept:print(\\'Module Not Found\\')')\"", python_shell=True) %}
|
||||||
|
|
||||||
{% if grains['role'] in ['so-manager', 'so-managersearch', 'so-eval', 'so-standalone'] and GRAFANA == 1 %}
|
|
||||||
|
|
||||||
include:
|
include:
|
||||||
- salt.minion
|
- salt.minion
|
||||||
|
|||||||
@@ -837,6 +837,13 @@ echo "1" > /root/accept_changes
|
|||||||
set_progress_str 73 "Update playbook rules"
|
set_progress_str 73 "Update playbook rules"
|
||||||
so-playbook-ruleupdate >> /root/setup_playbook_rule_update.log 2>&1 &
|
so-playbook-ruleupdate >> /root/setup_playbook_rule_update.log 2>&1 &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$GRAFANA" = 1 ]]; then
|
||||||
|
set_progress_str 74 "Installing InfluxDB and Grafana"
|
||||||
|
salt-call state.apply -l info influxdb >> $setup_log 2>&1
|
||||||
|
salt-call state.apply -l info grafana >> $setup_log 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$OSQUERY" = 1 ]]; then
|
if [[ "$OSQUERY" = 1 ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user