syslogd: ansible-lint fixes
This commit is contained in:
parent
1bd5bfdcb7
commit
560587d612
3 changed files with 48 additions and 49 deletions
|
@ -1,12 +1,11 @@
|
|||
---
|
||||
|
||||
- name: verify that all.log exists
|
||||
stat:
|
||||
- name: Verify that all.log exists
|
||||
ansible.builtin.stat:
|
||||
path: /var/log/all.log
|
||||
register: result
|
||||
|
||||
- name: create dummy all.log file
|
||||
file:
|
||||
- name: Create dummy all.log file
|
||||
ansible.builtin.file:
|
||||
path: /var/log/all.log
|
||||
state: touch
|
||||
mode: 0644
|
||||
|
@ -14,35 +13,36 @@
|
|||
group: "{{ ansible_wheel }}"
|
||||
when: not result.stat.exists
|
||||
|
||||
- name: enable all.log
|
||||
lineinfile:
|
||||
- name: Enable all.log
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/syslog.conf
|
||||
line: "*.* /var/log/all.log"
|
||||
notify: restart syslogd
|
||||
notify: Restart syslogd
|
||||
|
||||
- name: enable all.log rotation
|
||||
lineinfile:
|
||||
- name: Enable all.log rotation
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/newsyslog.conf
|
||||
regexp: "^/var/log/all.log.*"
|
||||
line: |-
|
||||
/var/log/all.log root:{{ ansible_wheel }} 640 7 * $D0 Z
|
||||
|
||||
- block:
|
||||
- name: configure certificates for remote logging
|
||||
service:
|
||||
name: syslogd
|
||||
arguments: >-
|
||||
-h -c {{ tls_certs }}/{{ inventory_hostname }}.crt
|
||||
-k {{ tls_private }}/{{ inventory_hostname }}.key
|
||||
enabled: true
|
||||
- name: enable remote logging
|
||||
lineinfile:
|
||||
path: /etc/syslog.conf
|
||||
regexp: '^\*\.\* @.*'
|
||||
line: "*.* @tls://{{ log_server }}:6514"
|
||||
notify: restart syslogd
|
||||
- name: Configure certificates for remote logging
|
||||
ansible.builtin.service:
|
||||
name: syslogd
|
||||
arguments: >-
|
||||
-h -c {{ tls_certs }}/{{ inventory_hostname }}.crt
|
||||
-k {{ tls_private }}/{{ inventory_hostname }}.key
|
||||
enabled: true
|
||||
when: inventory_hostname != "log01.home.foo.sh"
|
||||
|
||||
- name: include server config
|
||||
include_tasks: server.yml
|
||||
- name: Enable remote logging
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/syslog.conf
|
||||
regexp: '^\*\.\* @.*'
|
||||
line: "*.* @tls://{{ log_server }}:6514"
|
||||
notify: Restart syslogd
|
||||
when: inventory_hostname != "log01.home.foo.sh"
|
||||
|
||||
- name: Include server config
|
||||
ansible.builtin.include_tasks: server.yml
|
||||
when: inventory_hostname == "log01.home.foo.sh"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue