diff --git a/salt/pcap/config.map.jinja b/salt/pcap/config.map.jinja index 918c400b1..f335c9380 100644 --- a/salt/pcap/config.map.jinja +++ b/salt/pcap/config.map.jinja @@ -1,3 +1,3 @@ {% import_yaml 'pcap/defaults.yaml' as pcap_defaults with context %} {% set pcap_pillar = pillar.pcap %} -{% set pcapmerge = salt['defaults.merge'](pcap_defaults, pcap_pillar, in_place=False) %} +{% set PCAPMERGED = salt['defaults.merge'](pcap_defaults, pcap_pillar, in_place=False) %} diff --git a/salt/pcap/files/config.jinja b/salt/pcap/files/config.jinja index d6046e0bb..47a18ed8b 100644 --- a/salt/pcap/files/config.jinja +++ b/salt/pcap/files/config.jinja @@ -1,16 +1,10 @@ -{%- set INTERFACE = salt['pillar.get']('sensor:interface') %} -{%- set DISKFREEPERCENTAGE = salt['pillar.get']('pcap:config:diskfreepercentage') %} -{%- set MAXFILES = salt['pillar.get']('pcap:config:maxdirectoryfiles') %} -{%- set BLOCKS = salt['pillar.get']('pcap:config:blocks') %} -{%- set FILEMB = salt['pillar.get']('pcap:config:preallocate_file_mb') %} -{%- set AIOPS = salt['pillar.get']('pcap:config:aiops') %} { "Threads": [ - { "PacketsDirectory": "/nsm/pcap", "IndexDirectory": "/nsm/pcapindex", "MaxDirectoryFiles": {{ MAXFILES }}, "DiskFreePercentage": {{ DISKFREEPERCENTAGE }} } + { "PacketsDirectory": "/nsm/pcap", "IndexDirectory": "/nsm/pcapindex", "MaxDirectoryFiles": {{ PCAPMERGED.pcap.config.maxdirectoryfiles }}, "DiskFreePercentage": {{ PCAPMERGED.pcap.config.DISKFREEPERCENTAGE }} } , "StenotypePath": "/usr/bin/stenotype" - , "Interface": "{{ INTERFACE }}" + , "Interface": "{{ pillar.sensor.interface }}" , "Port": 1234 , "Host": "127.0.0.1" - , "Flags": ["-v", "--blocks={{ BLOCKS }}", "--preallocate_file_mb={{ FILEMB }}", "--aiops={{ AIOPS }}", "--uid=stenographer", "--gid=stenographer"{{ BPF_COMPILED }}] + , "Flags": ["-v", "--blocks={{ PCAPMERGED.pcap.config.blocks }}", "--preallocate_file_mb={{ PCAPMERGED.pcap.config.preallocate_file_mb }}", "--aiops={{ PCAPMERGED.pcap.config.aiops }}", "--uid=stenographer", "--gid=stenographer"{{ BPF_COMPILED }}] , "CertPath": "/etc/stenographer/certs" } diff --git a/salt/pcap/init.sls b/salt/pcap/init.sls index 2d047e731..75af50ad6 100644 --- a/salt/pcap/init.sls +++ b/salt/pcap/init.sls @@ -7,6 +7,7 @@ {% if sls in allowed_states %} {% from "pcap/map.jinja" import STENOOPTIONS with context %} +{% from "pcap/config.map.jinja" import PCAPMERGED with context %} {% set VERSION = salt['pillar.get']('global:soversion') %} {% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %} @@ -58,6 +59,7 @@ stenoconf: - mode: 644 - template: jinja - defaults: + PCAPMERGED: {{ PCAPMERGED }} BPF_COMPILED: "{{ BPF_COMPILED }}" stenoca: