Browse Source

Handle loglevel

tags/v0.2.0
Alexandre Anriot 6 years ago
parent
commit
38e788ceb5
2 changed files with 6 additions and 3 deletions
  1. +1
    -0
      pillar.example
  2. +5
    -3
      ufw/init.sls

+ 1
- 0
pillar.example View File

enabled: True enabled: True


settings: settings:
loglevel: low
ipv6: True ipv6: True
default_input_policy: 'DROP' default_input_policy: 'DROP'
default_output_policy: 'ACCEPT' default_output_policy: 'ACCEPT'

+ 5
- 3
ufw/init.sls View File

{% from "ufw/map.jinja" import ufwmap with context %} {% from "ufw/map.jinja" import ufwmap with context %}
{% set default_template = ufw.get('default_template', 'salt://ufw/templates/default.jinja') -%} {% set default_template = ufw.get('default_template', 'salt://ufw/templates/default.jinja') -%}
{% set sysctl_template = ufw.get('sysctl_template', 'salt://ufw/templates/sysctl.jinja') -%} {% set sysctl_template = ufw.get('sysctl_template', 'salt://ufw/templates/sysctl.jinja') -%}
{% set settings_cfg = ufw.get('settings', {}) -%}
{% set loglevel = settings_cfg.get('loglevel', 'low') -%}


ufw: ufw:
pkg.installed: pkg.installed:
cmd.wait: cmd.wait:
- name: ufw reload - name: ufw reload


disable-logging:
set-logging:
cmd.run: cmd.run:
- name: ufw logging off
- unless: "grep 'LOGLEVEL=off' /etc/ufw/ufw.conf"
- name: ufw logging {{ loglevel }}
- unless: "grep 'LOGLEVEL={{ loglevel }}' /etc/ufw/ufw.conf"


{% else %} {% else %}
#ufw: #ufw:

Loading…
Cancel
Save