diff --git a/basic-system/defaults/main.yml b/basic-system/defaults/main.yml index 70f052396f56d79f536f441c60f7f994b4b0d23b..a3ccba2c1d6bc5778efb3bfba4a2b7c1c1b0fae6 100644 --- a/basic-system/defaults/main.yml +++ b/basic-system/defaults/main.yml @@ -6,7 +6,7 @@ hosts_additionals: [] etckeeper: true rsyslog_needed: false hosts_precious: false -journal_persitent_with_package: true +journal_persistent_with_package: true logrotate_period: 'daily' # 'weekly' is newer default logrotate_backlogs: 7 # default is 7 for daily, 4 for weekly common_sysctl_file: '/etc/sysctl.conf' diff --git a/basic-system/tasks/logging.yml b/basic-system/tasks/logging.yml index 608ae54fc3392c7611e2883484fdae54432f6c71..f3753264469286871264d49bd3fbaab7015b4931 100644 --- a/basic-system/tasks/logging.yml +++ b/basic-system/tasks/logging.yml @@ -17,11 +17,8 @@ name: systemd-journal-persistent state: present when: - - syslogserver is not defined or syslogserver.split(":")[0] != ansible_fqdn - - ansible_distribution_major_version|int >= 9 - - not rsyslog_needed - - journal_persitent_with_package - register: syslog_provider + - ansible_distribution_major_version|int(default=99) < 11 + - journal_persistent_with_package tags: - syslog - journal @@ -31,9 +28,8 @@ path: /var/log/journal state: directory when: - - (ansible_distribution_major_version|int < 9) or - (not journal_persitent_with_package) - register: syslog_provider + - ansible_distribution_major_version|int(default=99) < 11 + - not journal_persistent_with_package notify: - configure journal directory tags: @@ -47,8 +43,6 @@ purge: true dpkg_options: "force-confdef,force-confold,force-depends" when: - - not syslog_provider is skipped - - ansible_distribution_major_version|int >= 9 - syslogserver is not defined or syslogserver.split(":")[0] != ansible_fqdn tags: - syslog @@ -73,35 +67,6 @@ - syslog - service -- name: ensure rsyslog is running and enabled - service: - name: rsyslog - state: started - enabled: true - when: - - syslogserver is defined - - syslogserver|length > 0 - - ansible_distribution_major_version|int < 9 - tags: - - syslog - -- name: ensure that central logging works - template: - src: rsyslog.conf.j2 - dest: /etc/rsyslog.conf - owner: root - group: root - mode: '0644' - when: - - syslogserver is defined - - syslogserver|length > 0 - - syslogserver.split(":")[0] != ansible_fqdn - - ansible_distribution_major_version|int < 9 - notify: - - restart rsyslogd - tags: - - syslog - - name: ensure our logrotate.conf is present template: src: logrotate.conf.j2