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:
2026-10-21 06:10:01 +00:00
parent 1ede3d3329
commit bd24f01110
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -4,6 +4,8 @@ crowdsec:
lapi_url: "" lapi_url: ""
registration_token: "" registration_token: ""
bouncer_api_key: "" 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). # name -> hub collection, merged across group_vars/host_vars (null drops one).
collections: {} collections: {}
# name -> hub scenario outside the collections. # name -> hub scenario outside the collections.
+1 -1
View File
@@ -148,7 +148,7 @@
- name: Register the agent at the LAPI - name: Register the agent at the LAPI
ansible.builtin.command: >- ansible.builtin.command: >-
cscli lapi register --url {{ crowdsec.lapi_url }} 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 when: crowdsec_registered.rc != 0
no_log: true no_log: true
notify: Restart crowdsec notify: Restart crowdsec