diff --git a/salt/suricata/init.sls b/salt/suricata/init.sls index 5802e2b38..65b80c9ae 100644 --- a/salt/suricata/init.sls +++ b/salt/suricata/init.sls @@ -18,7 +18,6 @@ {% set VERSION = salt['pillar.get']('static:soversion', 'HH1.1.4') %} {% set MASTER = salt['grains.get']('master') %} {% set BPF_NIDS = salt['pillar.get']('nids:bpf') %} -{% set BPF_STATUS = 0 %} # Suricata @@ -86,9 +85,7 @@ surithresholding: # BPF compilation and configuration {% if BPF_NIDS %} {% set BPF_CALC = salt['cmd.script']('/usr/sbin/so-bpf-compile', interface + ' ' + BPF_NIDS|join(" ") ) %} - {% if BPF_CALC['stderr'] == "" %} - {% set BPF_STATUS = 1 %} - {% else %} + {% if BPF_CALC['stderr'] != "" %} suribpfcompilationfailure: test.configurable_test_state: - changes: False @@ -102,7 +99,7 @@ suribpf: - name: /opt/so/conf/suricata/bpf - user: 940 - group: 940 - {% if BPF_STATUS %} + {% if BPF_CALC['stderr'] == "" %} - contents_pillar: nids:bpf {% else %} - contents: