crowdsec: no crowdsec.list when a deb822 crowdsec.sources already defines the repository

This commit is contained in:
2026-10-26 19:15:46 +00:00
parent 923cd85020
commit 7464f4da0a
+9
View File
@@ -19,6 +19,14 @@
dest: /etc/apt/keyrings/crowdsec.asc
mode: "0644"
# A deb822 crowdsec.sources (written by the package or by hand) already
# defines the repository; a second crowdsec.list makes apt warn about
# duplicate targets.
- name: Check for an existing deb822 CrowdSec apt source
ansible.builtin.stat:
path: /etc/apt/sources.list.d/crowdsec.sources
register: crowdsec_sources
- name: Add the CrowdSec apt repository
ansible.builtin.copy:
dest: /etc/apt/sources.list.d/crowdsec.list
@@ -28,6 +36,7 @@
https://packagecloud.io/crowdsec/crowdsec/{{ ansible_distribution | lower }}/
{{ crowdsec.apt_suite_map[ansible_distribution_release] | default(ansible_distribution_release) }} main
register: crowdsec_repo
when: not crowdsec_sources.stat.exists
# The postinst asks these; without them it registers a local machine for a
# local LAPI and enrols in the central CAPI.