paulbsd-salt/states/haproxy/install.sls

63 lines
1.6 KiB
Plaintext
Raw Normal View History

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:
2022-10-10 10:16:32 +02:00
- pkgs: {{ haproxy.packages }}
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
2023-01-16 12:00:54 +01:00
{% for file in haproxy.config.scripts %}
2022-10-23 16:37:53 +02:00
haproxy-script-{{ file.name }}:
2022-10-10 10:16:32 +02:00
file.managed:
2022-10-23 16:37:53 +02:00
- name: {{ haproxy.config.dir }}/{{ file.name }}
- source: salt://haproxy/{{ file.name }}
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 %}
{% for file in haproxy.config.geoip.dbs %}
haproxy-geoip-{{ file.name }}:
file.managed:
- name: {{ haproxy.config.dir }}/{{ file.name }}
- source: {{ file.url }}
- skip_verify: True
- user: {{ haproxy.config.user }}
- group: {{ haproxy.config.group }}
- mode: "0600"
- require:
- file: haproxy-config-geoip-dir
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"