2022-10-01 20:06:19 +02:00
|
|
|
---
|
|
|
|
{%- from "haproxy/map.jinja" import haproxy with context %}
|
|
|
|
haproxy-pkg:
|
2022-12-24 17:48:15 +01:00
|
|
|
pkg.installed:
|
2023-06-06 09:23:53 +02:00
|
|
|
- pkgs: {{ haproxy.pkgs }}
|
2023-03-10 00:02:52 +01:00
|
|
|
- watch_in:
|
|
|
|
- service: haproxy-service
|
2022-10-10 10:16:32 +02:00
|
|
|
|
2022-11-08 11:04:39 +01:00
|
|
|
haproxy-config-dir:
|
|
|
|
file.directory:
|
|
|
|
- name: {{ haproxy.config.dir }}
|
|
|
|
- user: {{ haproxy.config.user }}
|
|
|
|
- group: {{ haproxy.config.group }}
|
|
|
|
- mode: "0700"
|
2023-03-10 00:02:52 +01:00
|
|
|
- recurse:
|
|
|
|
- user
|
|
|
|
- group
|
2022-11-08 11:04:39 +01:00
|
|
|
|
2023-01-16 12:00:54 +01:00
|
|
|
{% for dir in haproxy.config.dirs %}
|
|
|
|
haproxy-config-{{ dir }}-dir:
|
2022-10-23 16:37:53 +02:00
|
|
|
file.directory:
|
2023-01-16 12:00:54 +01:00
|
|
|
- name: {{ haproxy.config.dir }}/{{ dir }}
|
2023-01-04 23:32:56 +01:00
|
|
|
- user: {{ haproxy.config.user }}
|
|
|
|
- group: {{ haproxy.config.group }}
|
|
|
|
- mode: "0700"
|
2023-01-16 12:00:54 +01:00
|
|
|
{% endfor %}
|
2023-01-04 23:32:56 +01:00
|
|
|
|
2024-03-22 10:10:29 +01:00
|
|
|
{% for script, params in haproxy.config.scripts.items() %}
|
|
|
|
haproxy-script-{{ script }}:
|
2022-10-10 10:16:32 +02:00
|
|
|
file.managed:
|
2024-03-22 10:10:29 +01:00
|
|
|
- name: {{ haproxy.config.dir }}/{{ params.path }}
|
|
|
|
- source: salt://haproxy/{{ params.path }}
|
2022-10-10 10:16:32 +02:00
|
|
|
- user: {{ haproxy.config.user }}
|
|
|
|
- group: {{ haproxy.config.group }}
|
2023-04-13 23:13:34 +02:00
|
|
|
- mode: "0600"
|
|
|
|
- watch_in:
|
|
|
|
- service: haproxy-service
|
|
|
|
{% endfor %}
|
|
|
|
|
2024-03-22 10:10:29 +01:00
|
|
|
{% for dbname, params in haproxy.config.geoip.dbs.items() %}
|
|
|
|
haproxy-geoip-{{ dbname }}:
|
2023-04-13 23:13:34 +02:00
|
|
|
file.managed:
|
2024-03-22 10:10:29 +01:00
|
|
|
- name: /var/lib/haproxy/geoip/{{ dbname }}
|
|
|
|
- source: {{ params.url }}
|
2023-04-13 23:13:34 +02:00
|
|
|
- skip_verify: True
|
2024-01-03 13:29:44 +01:00
|
|
|
- makedirs: True
|
2023-04-13 23:13:34 +02:00
|
|
|
- user: {{ haproxy.config.user }}
|
|
|
|
- group: {{ haproxy.config.group }}
|
|
|
|
- mode: "0600"
|
2022-10-10 10:16:32 +02:00
|
|
|
- watch_in:
|
|
|
|
- service: haproxy-service
|
2022-10-23 16:37:53 +02:00
|
|
|
{% endfor %}
|
2023-03-21 19:42:51 +01:00
|
|
|
|
|
|
|
haproxy-hatop-download:
|
|
|
|
file.managed:
|
|
|
|
- name: /usr/bin/hatop
|
|
|
|
- source: {{ haproxy.hatop.fetchurl }}/v{{ haproxy.hatop.version }}/hatop
|
|
|
|
- source_hash: {{ haproxy.hatop.hash }}
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- mode: "0755"
|