apache-formula/apache/mod_geoip.sls

44 lines
900 B
Plaintext
Raw Normal View History

{% from "apache/map.jinja" import apache with context %}
2018-05-22 15:19:50 +02:00
{% if 'mod_geoip' in apache %}
include:
- apache
mod-geoip:
pkg.installed:
- pkgs:
2018-05-22 15:19:50 +02:00
- {{ apache.mod_geoip }}
- {{ apache.mod_geoip_database }}
- require:
- pkg: apache
- watch_in:
- module: apache-restart
- require_in:
- module: apache-restart
- module: apache-reload
- service: apache
2018-05-22 15:19:50 +02:00
{% if grains['os_family']=="RedHat" %}
geoip conf:
file.managed:
- name: {{ apache.confdir }}/geoip.conf
- user: root
- group: root
- mode: 644
- source:
- salt://apache/files/{{ salt['grains.get']('os_family') }}/geoip.conf
geoip database:
file.managed:
- name: /usr/share/GeoIP/GeoIP.dat
- user: root
- group: root
- mode: 644
- source:
- salt://apache/files/{{ salt['grains.get']('os_family') }}/GeoIP.dat
{% endif %}
2018-05-22 15:19:50 +02:00
{% endif %}