|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- {% from "apache/map.jinja" import apache with context %}
-
- include:
- - apache
-
- {{ apache.logdir }}:
- file.directory:
- - makedirs: True
- - require:
- - pkg: apache
- - watch_in:
- - module: apache-restart
- - require_in:
- - module: apache-restart
- - module: apache-reload
- - service: apache
-
- {{ apache.configfile }}:
- file.managed:
- - template: jinja
- - source:
- - salt://apache/files/{{ salt['grains.get']('os_family') }}/apache-{{ apache.version }}.config.jinja
- - require:
- - pkg: apache
- - watch_in:
- - module: apache-restart
- - require_in:
- - module: apache-restart
- - module: apache-reload
- - service: apache
- - context:
- apache: {{ apache | json }}
-
- {{ apache.vhostdir }}:
- file.directory:
- - makedirs: True
- - require:
- - pkg: apache
- - watch_in:
- - module: apache-restart
- - require_in:
- - module: apache-restart
- - module: apache-reload
- - service: apache
-
- {% if grains['os_family']=="Debian" %}
- /etc/apache2/envvars:
- file.managed:
- - template: jinja
- - source:
- - salt://apache/files/{{ salt['grains.get']('os_family') }}/envvars-{{ apache.version }}.jinja
- - require:
- - pkg: apache
- - watch_in:
- - module: apache-restart
- - require_in:
- - module: apache-restart
- - module: apache-reload
- - service: apache
-
- {{ apache.portsfile }}:
- file.managed:
- - template: jinja
- - source:
- - salt://apache/files/{{ salt['grains.get']('os_family') }}/ports-{{ apache.version }}.conf.jinja
- - require:
- - pkg: apache
- - watch_in:
- - module: apache-restart
- - require_in:
- - module: apache-restart
- - module: apache-reload
- - service: apache
- - context:
- apache: {{ apache | json }}
-
- {% endif %}
-
- {% if grains['os_family']=="RedHat" %}
- {{ apache.confdir }}/welcome.conf:
- file.absent:
- - require:
- - pkg: apache
- - watch_in:
- - module: apache-restart
- - require_in:
- - module: apache-restart
- - module: apache-reload
- - service: apache
- {% endif %}
-
- {% if grains['os_family']=="Suse" or salt['grains.get']('os') == 'SUSE' %}
- /etc/apache2/global.conf:
- file.managed:
- - template: jinja
- - source:
- - salt://apache/files/{{ salt['grains.get']('os_family') }}/global.config.jinja
- - require:
- - pkg: apache
- - watch_in:
- - module: apache-restart
- - require_in:
- - module: apache-restart
- - module: apache-reload
- - service: apache
- - context:
- apache: {{ apache | json }}
- {% endif %}
-
- {% if grains['os_family']=="FreeBSD" %}
- /usr/local/etc/{{ apache.service }}/envvars.d/by_salt.env:
- file.managed:
- - template: jinja
- - source:
- - salt://apache/files/{{ salt['grains.get']('os_family') }}/envvars-{{ apache.version }}.jinja
- - require:
- - pkg: apache
- - watch_in:
- - module: apache-restart
- - require_in:
- - module: apache-restart
- - module: apache-reload
- - service: apache
-
- {{ apache.portsfile }}:
- file.managed:
- - template: jinja
- - source:
- - salt://apache/files/{{ salt['grains.get']('os_family') }}/ports-{{ apache.version }}.conf.jinja
- - require:
- - pkg: apache
- - watch_in:
- - module: apache-restart
- - require_in:
- - module: apache-restart
- - module: apache-reload
- - service: apache
- - context:
- apache: {{ apache | json }}
- {% endif %}
|