mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
merge defaults with pillar
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
{%- import_yaml 'influxdb/defaults.yaml' as influx %}
|
{%- import_yaml 'influxdb/defaults.yaml' as INFLUXDEFAULTS %}
|
||||||
|
{%- set INFLUXMERGED = salt['pillar.get']('influxdb', default=INFLUXDEFAULTS.influxdb, merge=true) %}
|
||||||
|
|
||||||
{%- for header in influx.influxdb.config.keys() %}
|
{%- for header in INFLUXMERGED.config.keys() %}
|
||||||
{%- if header in ['graphite', 'collectd', 'opentsdb', 'udp'] %}
|
{%- if header in ['graphite', 'collectd', 'opentsdb', 'udp'] %}
|
||||||
[[{{header}}]]
|
[[{{header}}]]
|
||||||
{%- else %}
|
{%- else %}
|
||||||
[{{header}}]
|
[{{header}}]
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- for k, v in influx.influxdb.config[header].items() %}
|
{%- for k, v in INFLUXMERGED.config[header].items() %}
|
||||||
{#- is v a list? #}
|
{#- is v a list? #}
|
||||||
{%- if v is iterable and (v is not string and v is not mapping) %}
|
{%- if v is iterable and (v is not string and v is not mapping) %}
|
||||||
{{k}} = [
|
{{k}} = [
|
||||||
@@ -14,14 +15,12 @@
|
|||||||
"{{li}}",
|
"{{li}}",
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
]
|
]
|
||||||
{%- else %}
|
{%- elif v is string %}
|
||||||
{%- if v is string %}
|
|
||||||
{{k}} = "{{v}}"
|
{{k}} = "{{v}}"
|
||||||
{%- elif v is boolean %}
|
{%- elif v is boolean %}
|
||||||
{{k}} = {{v|string|lower}}
|
{{k}} = {{v|string|lower}}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{{k}} = {{v}}
|
{{k}} = {{v}}
|
||||||
{%- endif %}
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{% import_yaml 'redis/defaults.yaml' as redis %}
|
{%- import_yaml 'redis/defaults.yaml' as REDISDEFAULTS %}
|
||||||
|
{%- set REDISMERGED = salt['pillar.get']('redis', default=REDISDEFAULTS.redis, merge=true) %}
|
||||||
|
|
||||||
{%- for k, v in redis.redis.config.items() %}
|
{%- for k, v in REDISMERGED.config.items() %}
|
||||||
{%- if v is iterable and v is not string %}
|
{%- if v is iterable and v is not string %}
|
||||||
{%- for v1, v2 in v.items() %}
|
{%- for v1, v2 in v.items() %}
|
||||||
{{k}} {{v1}} {{v2}}
|
{{k}} {{v1}} {{v2}}
|
||||||
|
|||||||
Reference in New Issue
Block a user