syslogd: ansible-lint fixes

This commit is contained in:
Timo Makinen 2022-10-29 18:36:13 +00:00
parent 1bd5bfdcb7
commit 560587d612
3 changed files with 48 additions and 49 deletions

View file

@ -1,7 +1,6 @@
---
- name: create data directories
file:
- name: Create data directories
ansible.builtin.file:
dest: "{{ item }}"
state: directory
mode: 0750
@ -11,36 +10,36 @@
- /export/log
- /export/log/archive
- name: link data directory
file:
- name: Link data directory
ansible.builtin.file:
dest: /srv/log
src: /export/log
state: link
owner: root
group: "{{ ansible_wheel }}"
- name: copy server key
copy:
- name: Copy server key
ansible.builtin.copy:
dest: "{{ tls_private }}/0.0.0.0:6514.key"
src: /srv/letsencrypt/live/loghost.foo.sh/privkey.pem
mode: 0600
owner: root
group: "{{ ansible_wheel }}"
notify: restart syslogd
notify: Restart syslogd
tags: certificates
- name: copy server crt
copy:
- name: Copy server crt
ansible.builtin.copy:
dest: "{{ tls_certs }}/0.0.0.0:6514.crt"
src: /srv/letsencrypt/live/loghost.foo.sh/fullchain.pem
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
notify: restart syslogd
notify: Restart syslogd
tags: certificates
- name: add archiving to syslog.conf
blockinfile:
- name: Add archiving to syslog.conf
ansible.builtin.blockinfile:
path: /etc/syslog.conf
insertbefore: BOF
block: |
@ -49,31 +48,31 @@
# only local goes to the standard logs
+{{ inventory_hostname }}
marker: "# {mark} ANSIBLE MANAGED BLOCK (syslogd)"
notify: restart syslogd
notify: Restart syslogd
- name: create dummy all.log
- name: Create dummy all.log
shell: umask 027 ; touch /srv/log/all.log
args:
creates: /srv/log/all.log
- name: install log archiver
copy:
- name: Install log archiver
ansible.builtin.copy:
dest: /usr/local/sbin/syslog-archive
src: syslog-archive.sh
mode: 0755
owner: root
group: "{{ ansible_wheel }}"
- name: install log archiver cron
cron:
- name: Install log archiver cron
ansible.builtin.cron:
name: syslog-archive
user: root
hour: "0"
minute: "0"
job: /usr/local/sbin/syslog-archive all.log > /dev/null
- name: enable syslogd remote logging
service:
- name: Enable syslogd remote logging
ansible.builtin.service:
name: syslogd
state: started
enabled: true