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'] %}
|
||||
[[{{header}}]]
|
||||
{%- else %}
|
||||
[{{header}}]
|
||||
{%- endif %}
|
||||
{%- for k, v in influx.influxdb.config[header].items() %}
|
||||
{%- for k, v in INFLUXMERGED.config[header].items() %}
|
||||
{#- is v a list? #}
|
||||
{%- if v is iterable and (v is not string and v is not mapping) %}
|
||||
{{k}} = [
|
||||
@@ -14,14 +15,12 @@
|
||||
"{{li}}",
|
||||
{%- endfor %}
|
||||
]
|
||||
{%- else %}
|
||||
{%- if v is string %}
|
||||
{%- elif v is string %}
|
||||
{{k}} = "{{v}}"
|
||||
{%- elif v is boolean %}
|
||||
{%- elif v is boolean %}
|
||||
{{k}} = {{v|string|lower}}
|
||||
{%- else %}
|
||||
{%- else %}
|
||||
{{k}} = {{v}}
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
{%- 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 %}
|
||||
{%- for v1, v2 in v.items() %}
|
||||
{{k}} {{v1}} {{v2}}
|
||||
|
||||
Reference in New Issue
Block a user