crowdsec: no crowdsec.list when a deb822 crowdsec.sources already defines the repository
This commit is contained in:
@@ -19,6 +19,14 @@
|
|||||||
dest: /etc/apt/keyrings/crowdsec.asc
|
dest: /etc/apt/keyrings/crowdsec.asc
|
||||||
mode: "0644"
|
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
|
- name: Add the CrowdSec apt repository
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /etc/apt/sources.list.d/crowdsec.list
|
dest: /etc/apt/sources.list.d/crowdsec.list
|
||||||
@@ -28,6 +36,7 @@
|
|||||||
https://packagecloud.io/crowdsec/crowdsec/{{ ansible_distribution | lower }}/
|
https://packagecloud.io/crowdsec/crowdsec/{{ ansible_distribution | lower }}/
|
||||||
{{ crowdsec.apt_suite_map[ansible_distribution_release] | default(ansible_distribution_release) }} main
|
{{ crowdsec.apt_suite_map[ansible_distribution_release] | default(ansible_distribution_release) }} main
|
||||||
register: crowdsec_repo
|
register: crowdsec_repo
|
||||||
|
when: not crowdsec_sources.stat.exists
|
||||||
|
|
||||||
# The postinst asks these; without them it registers a local machine for a
|
# The postinst asks these; without them it registers a local machine for a
|
||||||
# local LAPI and enrols in the central CAPI.
|
# local LAPI and enrols in the central CAPI.
|
||||||
|
|||||||
Reference in New Issue
Block a user