52 lines
1.3 KiB
YAML
52 lines
1.3 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 - debian
|
|
- name: "install crowdsec firewall bouncer - debian"
|
|
ansible.builtin.apt:
|
|
name: "crowdsec-firewall-bouncer"
|
|
state: "present"
|
|
cache_valid_time: "120"
|
|
when: 'ansible_distribution == "Debian"'
|
|
tags:
|
|
- "crowdsec"
|
|
|
|
# install crowdsec firewall bouncer - ubuntu
|
|
- name: "install crowdsec firewall bouncer - ubuntu"
|
|
ansible.builtin.apt:
|
|
name: "crowdsec-firewall-bouncer-iptables"
|
|
state: "present"
|
|
cache_valid_time: "120"
|
|
when: 'ansible_distribution == "Ubuntu"'
|
|
tags:
|
|
- "crowdsec"
|