diff --git a/roles/crowdsec/tasks/conf.yml b/roles/crowdsec/tasks/conf.yml index c87fadb..d818049 100644 --- a/roles/crowdsec/tasks/conf.yml +++ b/roles/crowdsec/tasks/conf.yml @@ -31,7 +31,7 @@ register: cs_lapi_credentials delegate_to: "{{ cs_lapi_server }}" - set_fact: cs_lapi_credentials_yaml={{ cs_lapi_credentials.stdout | from_yaml }} - - copy: content={{ cs_lapi_credentials_yaml.password }} dest=/etc/crowdsec/meta/lapi_pass mode=600 + - copy: content={{ cs_lapi_credentials_yaml.password }} dest={{ cs_root_dir }}/meta/lapi_pass mode=600 - set_fact: cs_lapi_pass={{ cs_lapi_credentials_yaml.password }} tags: cs @@ -44,8 +44,8 @@ command: cscli capi register -o raw -f /dev/stdout register: cs_capi_credentials - set_fact: cs_capi_credentials_yaml={{ cs_capi_credentials.stdout | from_yaml }} - - copy: content={{ cs_capi_credentials_yaml.login }} dest=/etc/crowdsec/meta/capi_user mode=600 - - copy: content={{ cs_capi_credentials_yaml.password }} dest=/etc/crowdsec/meta/capi_pass mode=600 + - copy: content={{ cs_capi_credentials_yaml.login }} dest={{ cs_root_dir }}/meta/capi_user mode=600 + - copy: content={{ cs_capi_credentials_yaml.password }} dest={{ cs_root_dir }}/meta/capi_pass mode=600 - set_fact: cs_capi_user={{ cs_capi_credentials_yaml.login }} - set_fact: cs_capi_pass={{ cs_capi_credentials_yaml.password }} tags: cs diff --git a/roles/crowdsec/tasks/directories.yml b/roles/crowdsec/tasks/directories.yml index e5ddfdc..5184210 100644 --- a/roles/crowdsec/tasks/directories.yml +++ b/roles/crowdsec/tasks/directories.yml @@ -8,7 +8,7 @@ - dir: "{{ cs_root_dir }}" - dir: "{{ cs_root_dir }}/meta" mode: 700 - - dir: "{{ cs_root_dir }}/backups" + - dir: "{{ cs_root_dir }}/backup" mode: 700 - dir: "{{ cs_root_dir }}/data" - dir: /etc/crowdsec/parsers/s00-raw diff --git a/roles/crowdsec/templates/config.yaml.j2 b/roles/crowdsec/templates/config.yaml.j2 index c3112ea..fa42a33 100644 --- a/roles/crowdsec/templates/config.yaml.j2 +++ b/roles/crowdsec/templates/config.yaml.j2 @@ -34,6 +34,7 @@ db_config: host: {{ cs_db_server }} port: {{ cs_db_port }} {% else %} + type: sqlite db_path: {{ cs_root_dir }}/data/crowdsec.db {% endif %} flush: diff --git a/roles/crowdsec/templates/dev.yaml.j2 b/roles/crowdsec/templates/dev.yaml.j2 index db88c82..5d6f302 100644 --- a/roles/crowdsec/templates/dev.yaml.j2 +++ b/roles/crowdsec/templates/dev.yaml.j2 @@ -21,6 +21,7 @@ cscli: db_config: log_level: info + type: sqlite db_path: {{ cs_root_dir }}/data/dev.db flush: max_items: 1000 @@ -30,6 +31,8 @@ api: client: insecure_skip_verify: false credentials_path: /etc/crowdsec/local_api_credentials.yaml + server: + profiles_path: /etc/crowdsec/profiles.yaml prometheus: enabled: false