From f257396bc2f7abeecedfcef77728e3d84f54d99f Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Sat, 23 Jul 2022 20:47:16 +0200 Subject: [PATCH] Add syslog setup for shuttercontrol.log --- files/platon/syslog-shuttercontrol.conf | 4 ++++ platon.yml | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 files/platon/syslog-shuttercontrol.conf diff --git a/files/platon/syslog-shuttercontrol.conf b/files/platon/syslog-shuttercontrol.conf new file mode 100644 index 0000000..c35ff71 --- /dev/null +++ b/files/platon/syslog-shuttercontrol.conf @@ -0,0 +1,4 @@ +if $programname == 'lockfailsafe' then /var/log/shuttercontrol.log +if $programname == 'shuttercontrol' then /var/log/shuttercontrol.log +if $programname == 'doorservice' then /var/log/shuttercontrol.log +& ~ diff --git a/platon.yml b/platon.yml index 3b0265c..8900299 100644 --- a/platon.yml +++ b/platon.yml @@ -209,9 +209,31 @@ creates: "/home/{{ gatekeeper_user }}/mqtt-tools/agents/mqtt-clock" + ### Syslog setup for shuttercontrol.log + + - name: Make sure shuttercontrol.log exists + ansible.builtin.file: + path: /var/log/shuttercontrol.log + state: touch + + - name: Copy syslog setting for shuttercontrol + ansible.builtin.copy: + src: files/platon/syslog-shuttercontrol.conf + dest: /etc/rsyslog.d/20-shuttercontrol.conf + owner: root + group: root + mode: "0644" + notify: restart rsyslog + handlers: - name: restart mosquitto service: name: mosquitto state: restarted enabled: yes + + - name: restart rsyslog + service: + name: rsyslog + state: restarted + enabled: yes