common/tasks/crowdsec.yaml
2024-11-22 11:13:16 +01:00

42 lines
1 KiB
YAML

---
# install crowdsec signing key
- name: "install signing key"
ansible.builtin.get_url:
url: "https://packagecloud.io/crowdsec/crowdsec/gpgkey"
dest: "/etc/apt/keyrings/crowdsec_crowdsec-archive-keyring.gpg"
mode: "0644"
register: "install_crowdsec_key"
tags:
- "crowdsec"
# update apt cache if required
- name: "update apt cache"
ansible.builtin.apt:
update_cache: true
when:
- 'ansible_os_family == "Debian"'
- "install_crowdsec_key.changed"
tags:
- "crowdsec"
# install crowdsec security engine
- name: "install crowdsec security engine"
ansible.builtin.apt:
name: "crowdsec"
state: "present"
cache_valid_time: "120"
when: 'ansible_os_family == "Debian"'
register: "crowdsec_installed"
tags:
- "crowdsec"
# install crowdsec firewall bouncer
- name: "install crowdsec firewall bouncer"
ansible.builtin.apt:
name: "crowdsec-firewall-bouncer"
state: "present"
cache_valid_time: "120"
when: 'ansible_os_family == "Debian"'
tags:
- "crowdsec"