siotp/sio1/sisr1/80-ansible/tpansible/syslog-client-configure.yml
2022-10-13 09:05:35 +02:00

31 lines
718 B
YAML

---
- hosts: web
name: syslog-client-configure
tasks:
- name: editing journald.conf...
ansible.builtin.replace:
path: /etc/systemd/journald.conf
regexp: '^#ForwardToSyslog=yes'
replace: 'ForwardToSyslog=yes'
backup: yes
notify: restart journald
- name: editing rsyslog.conf...
ansible.builtin.lineinfile:
path: /etc/rsyslog.conf
line: '*.* @192.168.0.48:514'
create: yes
notify: restart rsyslog
handlers:
- name: restart journald
service:
name: systemd-journald
state: restarted
- name: restart rsyslog
service:
name: rsyslog
state: restarted