paulbsd-salt/states/haproxy/install.sls
2023-03-21 19:42:51 +01:00

48 lines
1.2 KiB
Plaintext

---
{%- from "haproxy/map.jinja" import haproxy with context %}
haproxy-pkg:
pkg.installed:
- pkgs: {{ haproxy.packages }}
- watch_in:
- service: haproxy-service
haproxy-config-dir:
file.directory:
- name: {{ haproxy.config.dir }}
- user: {{ haproxy.config.user }}
- group: {{ haproxy.config.group }}
- mode: "0700"
- recurse:
- user
- group
{% for dir in haproxy.config.dirs %}
haproxy-config-{{ dir }}-dir:
file.directory:
- name: {{ haproxy.config.dir }}/{{ dir }}
- user: {{ haproxy.config.user }}
- group: {{ haproxy.config.group }}
- mode: "0700"
{% endfor %}
{% for file in haproxy.config.scripts %}
haproxy-script-{{ file.name }}:
file.managed:
- name: {{ haproxy.config.dir }}/{{ file.name }}
- source: salt://haproxy/{{ file.name }}
- user: {{ haproxy.config.user }}
- group: {{ haproxy.config.group }}
- mode: "0700"
- watch_in:
- service: haproxy-service
{% endfor %}
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"