paulbsd-salt/states/apparmor/init.sls
Paul Lecuq 9267a8f78e
All checks were successful
continuous-integration/drone/push Build is passing
updated apparmor state
2023-06-27 11:45:14 +02:00

24 lines
575 B
Plaintext

---
{%- from "apparmor/map.jinja" import apparmor with context %}
{%- if not salt['grains.get']('container') %}
{%- if apparmor.enabled is defined and apparmor.enabled %}
{%- for cfg in apparmor.configs %}
apparmor-{{ cfg }}:
file.managed:
- name: /etc/apparmor.d/{{ cfg }}
- source: salt://apparmor/templates/{{ cfg }}.j2
- user: root
- group: root
- mode: "0644"
- template: jinja
- watch_in:
- service: apparmor-reload
{%- endfor %}
apparmor-reload:
service.running:
- name: apparmor
- enable: true
{%- endif %}
{%- endif %}