Private
Public Access
2
0

add crowdsec role, move config logs site -> global, remove caddy_ca_root, modularized Caddy build and config
Some checks failed
Publish collection to Galaxy / publish (push) Failing after 42s

This commit is contained in:
2026-03-16 21:52:36 +03:00
parent 46089e1d7a
commit 5199567bda
17 changed files with 420 additions and 172 deletions

View File

@@ -37,11 +37,26 @@
ansible.builtin.set_fact:
caddy_build_command: >
/usr/local/xcaddy-{{ caddy_xcaddy_version }}/xcaddy build v{{ caddy_version }}
--with github.com/pteich/caddy-tlsconsul
{% if caddy_coraza %}
--with github.com/corazawaf/coraza-caddy/{{ caddy_coraza_caddy_version }}
{% endif %}
{% if caddy_ratelimit %}
--with github.com/mholt/caddy-ratelimit
{% endif %}
{% if caddy_consul %}
--with github.com/pteich/caddy-tlsconsul
{% endif %}
{% if caddy_bot_barrier %}
--with github.com/steffenbusch/caddy-bot-barrier
{% endif %}
{% if caddy_geoip %}
--with github.com/zhangjiayin/caddy-geoip2
{% endif %}
{% if caddy_crowdsec %}
--with github.com/hslatman/caddy-crowdsec-bouncer/http
--with github.com/hslatman/caddy-crowdsec-bouncer/layer4
--with github.com/hslatman/caddy-crowdsec-bouncer/appsec
{% endif %}
--output {{ caddy_binary }}
- name: Remember and test Caddy version
@@ -95,7 +110,8 @@
owner: "{{ caddy_system_user }}"
- name: Install OWASP CRS
loop: "{{ caddy_owasp_crs_versions }}"
when: "caddy_coraza"
loop: "{{ caddy_coraza_crs_versions }}"
ansible.builtin.unarchive:
src: "https://github.com/coreruleset/coreruleset/archive/refs/tags/v{{ item }}.tar.gz"
dest: "{{ caddy_config_dir }}"
@@ -103,8 +119,9 @@
group: "{{ caddy_system_group }}"
remote_src: true
- name: Install plugins
loop: "{{ caddy_crs_plugins }}"
- name: Install CRS plugins
when: "caddy_coraza"
loop: "{{ caddy_coraza_crs_plugins }}"
ansible.builtin.unarchive:
src: "https://github.com/{{ item.provider | default('coreruleset') }}/{{ item.name }}-plugin/archive/refs/tags/v{{ item.version }}.tar.gz"
dest: "{{ caddy_crs_plugins_dir }}"
@@ -118,9 +135,9 @@
group: "{{ caddy_system_group }}"
remote_src: true
- name: Create plugins after config
loop: "{{ caddy_crs_plugins }}"
when: "not(item.has_after_config | default(false))"
- name: Create CRS plugins after config
loop: "{{ caddy_coraza_crs_plugins }}"
when: "caddy_coraza and not(item.has_after_config | default(false))"
ansible.builtin.copy:
content: ""
dest: "{{ caddy_crs_plugins_dir }}/{{ item.name }}-after.conf"