summaryrefslogtreecommitdiffstats
path: root/salt/profile/apparmor/local.sls
blob: 3ae5d1f9a3b73c70d9f8995708d657f966278529 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{%- set aapillar = salt['pillar.get']('profile:apparmor') %}

{%- if 'local' in aapillar %}
{%- for profile, lines in aapillar['local'].items() %}
/etc/apparmor.d/local/{{ profile }}:
  file.managed:
    - contents: {{ lines }}
    - watch_in:
      - module: apparmor_reload
{%- endfor %}

{%- if aapillar['local'] | length %}
apparmor_reload:
  module.run:
    - name: service.reload
    - m_name: apparmor
    - onchanges:
      {%- for profile in aapillar['local'] %}
      - file: /etc/apparmor.d/local/{{ profile }}
      {%- endfor %}
{%- endif %}
{%- endif %}