paulbsd-salt/states/haproxy/install.sls

44 lines
1.2 KiB
Plaintext
Raw Normal View History

2022-10-01 20:06:19 +02:00
---
{%- from "haproxy/map.jinja" import haproxy with context %}
haproxy-pkg:
pkg.installed:
2022-10-10 10:16:32 +02:00
- pkgs: {{ haproxy.packages }}
2022-10-23 16:37:53 +02:00
haproxy-maps-dir:
file.directory:
- name: {{ haproxy.config.dir }}/maps
- user: {{ haproxy.config.user }}
- group: {{ haproxy.config.group }}
- mode: "0700"
2022-10-10 10:16:32 +02:00
haproxy-script-dir:
file.directory:
- name: {{ haproxy.config.dir }}/scripts
- user: {{ haproxy.config.user }}
- group: {{ haproxy.config.group }}
- mode: "0700"
2022-10-23 16:37:53 +02:00
{% for file in haproxy.scripts %}
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 %}
{% for filename in haproxy.maps %}
haproxy-maps-{{ filename }}:
file.managed:
- name: {{ haproxy.config.dir }}/maps/{{ filename }}
- source: salt://haproxy/templates/{{ filename }}.j2
- user: {{ haproxy.config.user }}
- group: {{ haproxy.config.group }}
- mode: "0600"
- template: jinja
- watch_in:
- service: haproxy-service
2022-10-10 10:16:32 +02:00
{% endfor %}