|
|
@ -35,7 +35,7 @@ |
|
|
|
- block: |
|
|
|
- block: |
|
|
|
- import_tasks: ../includes/get_rand_pass.yml |
|
|
|
- import_tasks: ../includes/get_rand_pass.yml |
|
|
|
vars: |
|
|
|
vars: |
|
|
|
- pass_file: "/etc/crowdsec/meta/ansible_db_pass" |
|
|
|
- pass_file: "{{ cs_root_dir }}/meta/ansible_db_pass" |
|
|
|
- complex: False |
|
|
|
- complex: False |
|
|
|
- set_fact: cs_db_pass={{ rand_pass }} |
|
|
|
- set_fact: cs_db_pass={{ rand_pass }} |
|
|
|
when: |
|
|
|
when: |
|
|
@ -45,13 +45,13 @@ |
|
|
|
|
|
|
|
|
|
|
|
# Check if local API credentials are available in the meta dir |
|
|
|
# Check if local API credentials are available in the meta dir |
|
|
|
- name: Check local API credential files |
|
|
|
- name: Check local API credential files |
|
|
|
stat: path=/etc/crowdsec/meta/lapi_pass |
|
|
|
stat: path={{ cs_root_dir }}/meta/lapi_pass |
|
|
|
register: cs_lapi_pass_file |
|
|
|
register: cs_lapi_pass_file |
|
|
|
tags: cs |
|
|
|
tags: cs |
|
|
|
|
|
|
|
|
|
|
|
- name: Read the local API pass |
|
|
|
- name: Read the local API pass |
|
|
|
block: |
|
|
|
block: |
|
|
|
- slurp: src=/etc/crowdsec/meta/lapi_pass |
|
|
|
- slurp: src={{ cs_root_dir }}/meta/lapi_pass |
|
|
|
register: cs_lapi_pass_meta |
|
|
|
register: cs_lapi_pass_meta |
|
|
|
- set_fact: cs_lapi_pass={{ cs_lapi_pass_meta.content | b64decode | trim }} |
|
|
|
- set_fact: cs_lapi_pass={{ cs_lapi_pass_meta.content | b64decode | trim }} |
|
|
|
when: cs_lapi_pass is not defined and cs_lapi_pass_file.stat.exists |
|
|
|
when: cs_lapi_pass is not defined and cs_lapi_pass_file.stat.exists |
|
|
@ -60,15 +60,15 @@ |
|
|
|
# Check if central API credentials are available in the meta dir |
|
|
|
# Check if central API credentials are available in the meta dir |
|
|
|
- name: Check central API credential files |
|
|
|
- name: Check central API credential files |
|
|
|
block: |
|
|
|
block: |
|
|
|
- stat: path=/etc/crowdsec/meta/capi_user |
|
|
|
- stat: path={{ cs_root_dir }}/meta/capi_user |
|
|
|
register: cs_capi_user_file |
|
|
|
register: cs_capi_user_file |
|
|
|
- stat: path=/etc/crowdsec/meta/capi_pass |
|
|
|
- stat: path={{ cs_root_dir }}/meta/capi_pass |
|
|
|
register: cs_capi_pass_file |
|
|
|
register: cs_capi_pass_file |
|
|
|
tags: cs |
|
|
|
tags: cs |
|
|
|
|
|
|
|
|
|
|
|
- name: Read the central API user |
|
|
|
- name: Read the central API user |
|
|
|
block: |
|
|
|
block: |
|
|
|
- slurp: src=/etc/crowdsec/meta/capi_user |
|
|
|
- slurp: src={{ cs_root_dir }}/meta/capi_user |
|
|
|
register: cs_capi_user_meta |
|
|
|
register: cs_capi_user_meta |
|
|
|
- set_fact: cs_capi_user={{ cs_capi_user_meta.content | b64decode | trim }} |
|
|
|
- set_fact: cs_capi_user={{ cs_capi_user_meta.content | b64decode | trim }} |
|
|
|
when: cs_capi_user is not defined and cs_capi_user_file.stat.exists |
|
|
|
when: cs_capi_user is not defined and cs_capi_user_file.stat.exists |
|
|
@ -76,7 +76,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
- name: Read the central API pass |
|
|
|
- name: Read the central API pass |
|
|
|
block: |
|
|
|
block: |
|
|
|
- slurp: src=/etc/crowdsec/meta/capi_pass |
|
|
|
- slurp: src={{ cs_root_dir }}/meta/capi_pass |
|
|
|
register: cs_capi_pass_meta |
|
|
|
register: cs_capi_pass_meta |
|
|
|
- set_fact: cs_capi_pass={{ cs_capi_pass_meta.content | b64decode | trim }} |
|
|
|
- set_fact: cs_capi_pass={{ cs_capi_pass_meta.content | b64decode | trim }} |
|
|
|
when: cs_capi_pass is not defined and cs_capi_pass_file.stat.exists |
|
|
|
when: cs_capi_pass is not defined and cs_capi_pass_file.stat.exists |
|
|
|