diff --git a/roles/init-server/tasks/contingent/pkg/crowdsec.yml b/roles/init-server/tasks/contingent/pkg/crowdsec.yml new file mode 100644 index 0000000..c04db73 --- /dev/null +++ b/roles/init-server/tasks/contingent/pkg/crowdsec.yml @@ -0,0 +1,27 @@ +- 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_uri" + 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" \ No newline at end of file