2017-03-09 12:44:32 +01:00
|
|
|
{% from "apache/map.jinja" import apache with context %}
|
|
|
|
|
2018-05-22 15:19:50 +02:00
|
|
|
{% if 'mod_geoip' in apache %}
|
2017-03-09 12:44:32 +01:00
|
|
|
|
|
|
|
include:
|
|
|
|
- apache
|
|
|
|
|
|
|
|
mod-geoip:
|
|
|
|
pkg.installed:
|
|
|
|
- pkgs:
|
2018-05-22 15:19:50 +02:00
|
|
|
- {{ apache.mod_geoip }}
|
|
|
|
- {{ apache.mod_geoip_database }}
|
2017-03-09 12:44:32 +01:00
|
|
|
- require:
|
|
|
|
- pkg: apache
|
|
|
|
- watch_in:
|
|
|
|
- module: apache-restart
|
2018-11-09 00:25:52 +01:00
|
|
|
- require_in:
|
|
|
|
- module: apache-restart
|
|
|
|
- module: apache-reload
|
|
|
|
- service: apache
|
|
|
|
|
2017-03-09 12:44:32 +01:00
|
|
|
|
2018-05-22 15:19:50 +02:00
|
|
|
{% if grains['os_family']=="RedHat" %}
|
2017-03-09 12:44:32 +01:00
|
|
|
geoip conf:
|
|
|
|
file.managed:
|
|
|
|
- name: {{ apache.confdir }}/geoip.conf
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- mode: 644
|
2019-10-17 08:50:55 +02:00
|
|
|
- source:
|
2017-03-09 12:44:32 +01:00
|
|
|
- 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 %}
|