40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
- name: Restarting SystemD service
|
|
become: true
|
|
ansible.builtin.systemd_service:
|
|
name: crowdsec
|
|
scope: system
|
|
enabled: true
|
|
state: started
|
|
- name: Changing the address and port of the Crowdsec server
|
|
become: true
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/crowdsec/config.yaml
|
|
regexp: "^ {4}listen_uri"
|
|
line: " listen_uri: localhost:{{ crowdsec.port }}"
|
|
owner: root
|
|
group: root
|
|
mode: "644"
|
|
- name: Changing the address of the Crowdsec Prometheus server
|
|
become: true
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/crowdsec/config.yaml
|
|
regexp: "^ {2}listen_addr"
|
|
line: " listen_addr: localhost"
|
|
owner: root
|
|
group: root
|
|
mode: "644"
|
|
- name: Changing target or expected address for credentials of the Crowdsec local API
|
|
become: true
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/crowdsec/local_api_credentials.yaml
|
|
regexp: "^url"
|
|
line: "url: http://localhost:{{ crowdsec.port }}"
|
|
owner: root
|
|
group: root
|
|
mode: "644"
|
|
- name: Restarting SystemD service
|
|
become: true
|
|
ansible.builtin.systemd_service:
|
|
name: crowdsec
|
|
scope: system
|
|
state: restarted |