Let a host name its CrowdSec machine at the LAPI with crowdsec.machine_name, the short hostname of doris is dev
This commit is contained in:
@@ -4,6 +4,8 @@ crowdsec:
|
||||
lapi_url: ""
|
||||
registration_token: ""
|
||||
bouncer_api_key: ""
|
||||
# Machine name at the LAPI; empty is the short hostname.
|
||||
machine_name: ""
|
||||
# name -> hub collection, merged across group_vars/host_vars (null drops one).
|
||||
collections: {}
|
||||
# name -> hub scenario outside the collections.
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
- name: Register the agent at the LAPI
|
||||
ansible.builtin.command: >-
|
||||
cscli lapi register --url {{ crowdsec.lapi_url }}
|
||||
--token {{ crowdsec.registration_token }} --machine {{ ansible_hostname }}
|
||||
--token {{ crowdsec.registration_token }} --machine {{ crowdsec.machine_name | default(ansible_hostname, true) }}
|
||||
when: crowdsec_registered.rc != 0
|
||||
no_log: true
|
||||
notify: Restart crowdsec
|
||||
|
||||
Reference in New Issue
Block a user