Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit dbf5ec1a authored by Freezed's avatar Freezed Committed by fred
Browse files

:sparkles: Add OVH/LDP configuration

- TODO: integration to [system_cfg](https://lab.frogg.it/fcode/ansible/debian/-/tree/stable/tasks/system_cfg)
- Product details: [OVH Log data platform](https://docs.ovh.com/fr/logs-data-platform/)
- Tutorial followed: [How to log your Linux with syslog-ng 3.8+](https://docs.ovh.com/fr/logs-data-platform/how-to-log-your-linux/)
parent c20bbae5
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ open_all:
${EDITOR} .gitignore inv* Makefile README.md
${EDITOR} tasks/*.yml
${EDITOR} tasks/files/sshd_config
${EDITOR} tasks/templates/*.j2
${EDITOR} tasks/system_cfg/*.yml
${EDITOR} tasks/system_cfg/templates/*.j2
${EDITOR} tasks/user_cfg/*.yml
......
......@@ -20,3 +20,7 @@ timezone="UTC"
[workstation:vars]
timezone="Europe/Paris"
[all:vars]
ldp_token="put-yours-here"
ldp_zone="put-yours-here"
---
- hosts: "{{ host_list }}"
remote_user: root
tasks:
- name: LDP | install packages
ansible.builtin.apt:
cache_valid_time: 3600
force_apt_get: yes
pkg:
- syslog-ng
- ca-certificates
state: present
update_cache: true
- name: LDP | syslog-ng config
ansible.builtin.template:
src: templates/ldp.conf.j2
dest: "/etc/syslog-ng/conf.d/ldp.conf"
mode: 0640
owner: root
group: root
- name: LDP | restart syslog-ng deamon
ansible.builtin.systemd:
state: restarted
daemon_reload: yes
name: syslog-ng
template ovhTemplate {
# Source: https://docs.ovh.com/fr/logs-data-platform/how-to-log-your-linux/
template("<${LEVEL_NUM}>1 ${ISODATE} ${HOST} ${PROGRAM} ${PID} - [sdid@32473 X-OVH-TOKEN=\"{{ ldp_token }}\" pid=\"${PID}\" facility=\"${FACILITY}\" priority=\"${PRIORITY}\"] ${MSG}\n");
template_escape(no);
};
destination ovhPaaSLogs {
network("{{ ldp_zone }}.logs.ovh.com"
port(6514),
template(ovhTemplate),
ts_format("iso"),
transport("tls"),
tls(peer-verify("required-trusted") ca_dir("/etc/ssl/certs/")),
keep-alive(yes),
so_keepalive(yes),
);
};
destination localfile {
file("/var/log/temporaryfiletochecklogs.log");
};
log {
source(s_src);
destination(ovhPaaSLogs);
};
log {
source(s_src);
destination(localfile);
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment