From 67c5fbca24ee9e0553c647e100a39299a13121d1 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 19 Feb 2021 20:00:06 +0100 Subject: [PATCH] Update to 2021-02-19 20:00 --- roles/crowdsec/tasks/conf.yml | 1 + roles/crowdsec/tasks/install.yml | 2 +- roles/crowdsec/templates/local_api_credentials.yaml.j2 | 2 +- roles/crowdsec_bouncer_firewall/templates/cs-firewall-bouncer.yaml.j2 | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/crowdsec/tasks/conf.yml b/roles/crowdsec/tasks/conf.yml index 8dec80f..3af2bf8 100644 --- a/roles/crowdsec/tasks/conf.yml +++ b/roles/crowdsec/tasks/conf.yml @@ -35,6 +35,7 @@ tags: crowdsec - when: + - crowdsec_lapi_enabled - crowdsec_capi_enabled - crowdsec_capi_user is not defined or crowdsec_capi_pass is not defined block: diff --git a/roles/crowdsec/tasks/install.yml b/roles/crowdsec/tasks/install.yml index 6e1fc90..9d58de3 100644 --- a/roles/crowdsec/tasks/install.yml +++ b/roles/crowdsec/tasks/install.yml @@ -38,7 +38,7 @@ RestartSec=30 dest: /etc/systemd/system/crowdsec.service.d/restart.conf register: crodwsec_unit - notify: restart crodwsec + notify: restart crowdsec tags: crowdsec - name: Reload systemd diff --git a/roles/crowdsec/templates/local_api_credentials.yaml.j2 b/roles/crowdsec/templates/local_api_credentials.yaml.j2 index 078363e..45d5d4b 100644 --- a/roles/crowdsec/templates/local_api_credentials.yaml.j2 +++ b/roles/crowdsec/templates/local_api_credentials.yaml.j2 @@ -1,3 +1,3 @@ -url: {{ crowdsec_lapi_enabled | ternary('http://127.0.0.1:' ~ crowdsec_lapi_port,crowdsec_lapi_url) }} +url: {{ crowdsec_lapi_enabled | ternary('http://127.0.0.1:' ~ crowdsec_lapi_port,(crowdsec_lapi_url is search('/$')) | ternary(crowdsec_lapi_url, crowdsec_lapi_url ~ '/')) }} login: {{ crowdsec_lapi_user }} password: {{ crowdsec_lapi_pass }} diff --git a/roles/crowdsec_bouncer_firewall/templates/cs-firewall-bouncer.yaml.j2 b/roles/crowdsec_bouncer_firewall/templates/cs-firewall-bouncer.yaml.j2 index b22302d..03113ed 100644 --- a/roles/crowdsec_bouncer_firewall/templates/cs-firewall-bouncer.yaml.j2 +++ b/roles/crowdsec_bouncer_firewall/templates/cs-firewall-bouncer.yaml.j2 @@ -6,7 +6,7 @@ update_frequency: 10s daemonize: true log_mode: stdout log_level: info -api_url: {{ crowdsec_fw_lapi_url }} +api_url: {{ (crowdsec_fw_lapi_url is search('/$')) | ternary(crowdsec_fw_lapi_url,crowdsec_fw_lapi_url ~ '/') }} api_key: {{ crowdsec_fw_lapi_key }} disable_ipv6: false