summaryrefslogtreecommitdiffstats
path: root/salt/profile/apache-httpd/init.sls
blob: f30337ccb11cbe323f18f6f89bdaa1e83e1dfb26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{%- set snippetsdir = '/etc/apache2/snippets.d' -%}
{%- set mypillar = salt['pillar.get']('profile:apache-httpd', {}) -%}

{{ snippetsdir }}:
  file.directory:
    - makedirs: True

{%- if 'snippets' in mypillar %}
{%- for snippet, config in mypillar['snippets'].items() %}
{{ snippetsdir }}/{{ snippet }}.conf:
  file.managed:
    - contents:
      {%- for line in config %}
      - {{ line }}
      {%- endfor %}
    - require:
      - file: {{ snippetsdir }}
    {#- formula dependencies #}
    - watch_in:
      - service: apache-service-running
{%- endfor %}
{%- endif %}

include:
  - apache.config