20 lines
563 B
YAML
20 lines
563 B
YAML
|
|
- name: Get collections list
|
||
|
|
ansible.builtin.shell:
|
||
|
|
executable: "/usr/bin/bash"
|
||
|
|
cmd: |
|
||
|
|
set -o pipefail
|
||
|
|
cscli collection list --output=json |jq -r '.collections[] |.name'
|
||
|
|
register: "crowdsec_out_list_collections"
|
||
|
|
changed_when: false
|
||
|
|
|
||
|
|
- name: Install collections
|
||
|
|
loop:
|
||
|
|
- "crowdsecurity/caddy"
|
||
|
|
- "barnoux/caddy-coraza"
|
||
|
|
when: "item not in crowdsec_out_list_collections.stdout_lines"
|
||
|
|
ansible.builtin.command:
|
||
|
|
cmd: "cscli collections install {{ item }}"
|
||
|
|
changed_when: true
|
||
|
|
notify:
|
||
|
|
- "Restart Crowdsec Securiy Engine"
|