From 94ebbd157b309e5bf0f3906565148cae4fc97bcd Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 1 Sep 2024 14:39:43 +0200 Subject: [PATCH] updated haproxy state --- states/haproxy/config.sls | 14 ++++++++++++++ states/haproxy/defaults.yaml | 3 +++ states/haproxy/templates/static/security.txt.j2 | 7 +++++++ 3 files changed, 24 insertions(+) create mode 100644 states/haproxy/templates/static/security.txt.j2 diff --git a/states/haproxy/config.sls b/states/haproxy/config.sls index e492f7b..fbb1268 100644 --- a/states/haproxy/config.sls +++ b/states/haproxy/config.sls @@ -13,6 +13,20 @@ haproxy-maps-{{ map }}: - service: haproxy-service {% endfor %} +{% for static in haproxy.static %} +haproxy-static-{{ static }}: + file.managed: + - name: {{ haproxy.config.dir }}/static/{{ static }} + - source: salt://haproxy/templates/static/{{ static }}.j2 + - user: {{ haproxy.config.user }} + - group: {{ haproxy.config.group }} + - mode: "0600" + - template: jinja + - watch_in: + - service: haproxy-service +{% endfor %} + + haproxy-config-main: file.managed: - name: {{ haproxy.config.dir }}/{{ haproxy.config.configfile }} diff --git a/states/haproxy/defaults.yaml b/states/haproxy/defaults.yaml index 6c2dd8a..f3c36aa 100644 --- a/states/haproxy/defaults.yaml +++ b/states/haproxy/defaults.yaml @@ -41,6 +41,9 @@ haproxy: - scripts - mods - errors + - static + static: + - security.txt scripts: haproxy: path: mods/haproxy.c diff --git a/states/haproxy/templates/static/security.txt.j2 b/states/haproxy/templates/static/security.txt.j2 new file mode 100644 index 0000000..6810dae --- /dev/null +++ b/states/haproxy/templates/static/security.txt.j2 @@ -0,0 +1,7 @@ +Contact: mailto:contact@paulbsd.com +Expires: 2024-12-31T23:00:00.000Z +Encryption: https://www.paulbsd.com/paulbsd.public.asc +Acknowledgments: https://www.paulbsd.com/acknowledgments.html +Preferred-Languages: en, fr +Policy: https://www.paulbsd.com/policy.html +Hiring: https://blowjob.ovh