paulbsd-salt/states/haproxy/install.sls

39 lines
983 B
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 }}
- mode: "0700"
- watch_in:
- service: haproxy-service
2022-10-23 16:37:53 +02:00
{% endfor %}