From 1737d91e1979e2673300e940f301c49edee164d4 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Wed, 3 Jan 2024 13:29:44 +0100 Subject: [PATCH] updated haproxy state --- states/haproxy/defaults.yaml | 5 ++--- states/haproxy/install.sls | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/states/haproxy/defaults.yaml b/states/haproxy/defaults.yaml index 0402cd7..053b817 100644 --- a/states/haproxy/defaults.yaml +++ b/states/haproxy/defaults.yaml @@ -30,7 +30,7 @@ haproxy: countries: FR: OK dbs: - - name: geoip/GeoLite2-City.mmdb + - name: /var/lib/haproxy/geoip/GeoLite2-City.mmdb url: https://git.paulbsd.com/paulbsd/GeoLite.mmdb/releases/download/2023.03.26/GeoLite2-City.mmdb lua_max_mem: 1024 peers: @@ -39,7 +39,6 @@ haproxy: servers: hosts: [] dirs: - - geoip - maps - scripts - mods @@ -53,7 +52,7 @@ haproxy: - name: scripts/geoip.lua lib: false args: - - /etc/haproxy/geoip/GeoLite2-City.mmdb + - /var/lib/haproxy/geoip/GeoLite2-City.mmdb - name: scripts/json.lua lib: true - name: scripts/collector.lua diff --git a/states/haproxy/install.sls b/states/haproxy/install.sls index 6cb23cd..03df9b2 100644 --- a/states/haproxy/install.sls +++ b/states/haproxy/install.sls @@ -40,14 +40,13 @@ haproxy-script-{{ file.name }}: {% for file in haproxy.config.geoip.dbs %} haproxy-geoip-{{ file.name }}: file.managed: - - name: {{ haproxy.config.dir }}/{{ file.name }} + - name: {{ file.name }} - source: {{ file.url }} - skip_verify: True + - makedirs: True - user: {{ haproxy.config.user }} - group: {{ haproxy.config.group }} - mode: "0600" - - require: - - file: haproxy-config-geoip-dir - watch_in: - service: haproxy-service {% endfor %}