# CrowdSec firewall bouncer (nftables) on the host. It reads decisions from # the crowdsec container's LAPI (127.0.0.1:8080). If it stops, its tables go # away (nothing is blocked); it never touches ufw's or Docker's rules. # packagecloud has no trixie dist, so use the generic any/any repo. - name: crowdsec apt repository ansible.builtin.deb822_repository: name: crowdsec types: deb uris: https://packagecloud.io/crowdsec/crowdsec/any suites: any components: main signed_by: https://packagecloud.io/crowdsec/crowdsec/gpgkey # Written before the package: its postinst starts the service right away. - name: crowdsec bouncer config directory ansible.builtin.file: path: /etc/crowdsec/bouncers state: directory mode: '0755' - name: firewall bouncer config overrides ansible.builtin.template: src: crowdsec-firewall-bouncer.yaml.local.j2 dest: /etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml.local owner: root mode: '0600' diff: false # contains the bouncer key notify: restart crowdsec-firewall-bouncer - name: install the nftables firewall bouncer ansible.builtin.apt: name: crowdsec-firewall-bouncer-nftables update_cache: true - name: firewall bouncer running ansible.builtin.systemd_service: name: crowdsec-firewall-bouncer state: started enabled: true