Update ansible code
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
156561e633
commit
18e86f8687
5 changed files with 120 additions and 118 deletions
|
|
@ -1,17 +1,17 @@
|
|||
---
|
||||
- name: Check if agent is already registered
|
||||
shell: cscli machines list -o raw | grep {{ inventory_hostname }} | grep true || echo "Not found"
|
||||
ansible.builtin.shell: cscli machines list -o raw | grep {{ inventory_hostname }} | grep true || echo "Not found"
|
||||
register: _csmachines
|
||||
delegate_to: "{{ crowdsec_delegate_server_hostname }}"
|
||||
changed_when: false
|
||||
|
||||
- block:
|
||||
- name: Register agent to server
|
||||
command: cscli lapi register -u {{ crowdsec_lapi_url }} --machine {{ inventory_hostname }}
|
||||
ansible.builtin.command: cscli lapi register -u {{ crowdsec_lapi_url }} --machine {{ inventory_hostname }}
|
||||
notify: restart crowdsec
|
||||
|
||||
- name: Validate agent on server
|
||||
command: cscli machines validate {{ inventory_hostname }}
|
||||
ansible.builtin.command: cscli machines validate {{ inventory_hostname }}
|
||||
delegate_to: "{{ crowdsec_delegate_server_hostname }}"
|
||||
when:
|
||||
- _csmachines.rc == 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue