diff --git a/states/haproxy/defaults.yaml b/states/haproxy/defaults.yaml index b2db205..966378b 100644 --- a/states/haproxy/defaults.yaml +++ b/states/haproxy/defaults.yaml @@ -30,9 +30,6 @@ haproxy: enabled: true countries: FR: OK - dbs: - GeoLite2-City.mmdb: - url: https://git.paulbsd.com/paulbsd/GeoLite.mmdb/releases/download/2023.03.26/GeoLite2-City.mmdb lua_max_mem: 1024 peers: hosts: [] @@ -55,7 +52,7 @@ haproxy: path: scripts/geoip.lua lib: false args: - - /var/lib/haproxy/geoip/GeoLite2-City.mmdb + - /usr/share/geoip/GeoLite2-City.mmdb json: path: scripts/json.lua lib: true diff --git a/states/haproxy/init.sls b/states/haproxy/init.sls index 5adcc1d..9b5d76f 100644 --- a/states/haproxy/init.sls +++ b/states/haproxy/init.sls @@ -3,6 +3,9 @@ include: {%- if haproxy.acme %} - acme +{%- endif %} +{%- if haproxy.config.geoip.enabled %} + - geoip {%- endif %} - .install - .config diff --git a/states/haproxy/install.sls b/states/haproxy/install.sls index 5481288..073a883 100644 --- a/states/haproxy/install.sls +++ b/states/haproxy/install.sls @@ -37,20 +37,6 @@ haproxy-script-{{ script }}: - service: haproxy-service {% endfor %} -{% for dbname, params in haproxy.config.geoip.dbs.items() %} -haproxy-geoip-{{ dbname }}: - file.managed: - - name: /var/lib/haproxy/geoip/{{ dbname }} - - source: {{ params.url }} - - skip_verify: True - - makedirs: True - - user: {{ haproxy.config.user }} - - group: {{ haproxy.config.group }} - - mode: "0600" - - watch_in: - - service: haproxy-service -{% endfor %} - haproxy-hatop-download: file.managed: - name: /usr/bin/hatop