tpsio/testansible/syslog-cli.yml
“cameron.desrayaud” 928fda2aa8 ajout yml
2022-01-24 14:24:14 +01:00

26 lines
649 B
YAML

- hosts: web
tasks:
- name: on decommente l'option ForwardToSyslog=yes dans /etc/systemd/journald>
replace:
path: /etc/systemd/journald.conf
regexp: '^#ForwardToSyslog=yes'
replace: 'ForwardToSyslog=yes'
notify:
- restart journald
- name: Ajoute l'indication de serveur syslog distant
lineinfile:
path: /etc/rsyslog.conf
line: '*.* @192.168.0.37:514'
create: yes
notify:
- restart rsyslog
handlers:
- name: restart journald
service:
name: systemd-journald.service
state: restarted
- name: restart rsyslog
service:
name: rsyslog
state: restarted