From 183027fbb699b8551add62c3877543fd689fc22a Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Wed, 29 Apr 2026 23:47:06 -0500 Subject: [PATCH] Fedora 43, 44, Alma 10, CentOS 10, Oracle 10 and Rocky 10 --- templates/AlmaLinux/10/etc/logrotate.conf | 20 +++++++++++++ templates/AlmaLinux/10/etc/logrotate.d/btmp | 7 +++++ templates/AlmaLinux/10/etc/logrotate.d/wtmp | 8 +++++ templates/CentOS/10/etc/logrotate.conf | 20 +++++++++++++ templates/CentOS/10/etc/logrotate.d/btmp | 7 +++++ templates/CentOS/10/etc/logrotate.d/wtmp | 8 +++++ templates/Fedora/43/etc/logrotate.conf | 23 +++++++++++++++ templates/Fedora/43/etc/logrotate.d/btmp | 7 +++++ templates/Fedora/43/etc/logrotate.d/wtmp | 8 +++++ templates/Fedora/44/etc/logrotate.conf | 23 +++++++++++++++ templates/Fedora/44/etc/logrotate.d/btmp | 7 +++++ templates/Fedora/44/etc/logrotate.d/wtmp | 8 +++++ templates/OracleLinux/10/etc/logrotate.conf | 20 +++++++++++++ templates/OracleLinux/10/etc/logrotate.d/btmp | 7 +++++ templates/OracleLinux/10/etc/logrotate.d/wtmp | 8 +++++ templates/Rocky/10/etc/logrotate.conf | 20 +++++++++++++ templates/Rocky/10/etc/logrotate.d/btmp | 7 +++++ templates/Rocky/10/etc/logrotate.d/wtmp | 8 +++++ vars/AlmaLinux-10-default.yml | 25 ++++++++++++++++ vars/CentOS-10-default.yml | 25 ++++++++++++++++ vars/Fedora-43-default.yml | 29 +++++++++++++++++++ vars/Fedora-44-default.yml | 29 +++++++++++++++++++ vars/OracleLinux-10-default.yml | 25 ++++++++++++++++ vars/Rocky-10-default.yml | 25 ++++++++++++++++ 24 files changed, 374 insertions(+) create mode 100644 templates/AlmaLinux/10/etc/logrotate.conf create mode 100644 templates/AlmaLinux/10/etc/logrotate.d/btmp create mode 100644 templates/AlmaLinux/10/etc/logrotate.d/wtmp create mode 100644 templates/CentOS/10/etc/logrotate.conf create mode 100644 templates/CentOS/10/etc/logrotate.d/btmp create mode 100644 templates/CentOS/10/etc/logrotate.d/wtmp create mode 100644 templates/Fedora/43/etc/logrotate.conf create mode 100644 templates/Fedora/43/etc/logrotate.d/btmp create mode 100644 templates/Fedora/43/etc/logrotate.d/wtmp create mode 100644 templates/Fedora/44/etc/logrotate.conf create mode 100644 templates/Fedora/44/etc/logrotate.d/btmp create mode 100644 templates/Fedora/44/etc/logrotate.d/wtmp create mode 100644 templates/OracleLinux/10/etc/logrotate.conf create mode 100644 templates/OracleLinux/10/etc/logrotate.d/btmp create mode 100644 templates/OracleLinux/10/etc/logrotate.d/wtmp create mode 100644 templates/Rocky/10/etc/logrotate.conf create mode 100644 templates/Rocky/10/etc/logrotate.d/btmp create mode 100644 templates/Rocky/10/etc/logrotate.d/wtmp create mode 100644 vars/AlmaLinux-10-default.yml create mode 100644 vars/CentOS-10-default.yml create mode 100644 vars/Fedora-43-default.yml create mode 100644 vars/Fedora-44-default.yml create mode 100644 vars/OracleLinux-10-default.yml create mode 100644 vars/Rocky-10-default.yml diff --git a/templates/AlmaLinux/10/etc/logrotate.conf b/templates/AlmaLinux/10/etc/logrotate.conf new file mode 100644 index 0000000..8cba9ae --- /dev/null +++ b/templates/AlmaLinux/10/etc/logrotate.conf @@ -0,0 +1,20 @@ +# see "man logrotate" for details +# rotate log files weekly +daily + +# keep 4 weeks worth of backlogs +rotate {{ log_retention_days }} + +# create new (empty) log files after rotating old ones +create + +# use date as a suffix of the rotated file +dateext + +# uncomment this if you want your log files compressed +compress + +# packages drop log rotation information into this directory +include /etc/logrotate.d + +# system-specific logs may be also be configured here. diff --git a/templates/AlmaLinux/10/etc/logrotate.d/btmp b/templates/AlmaLinux/10/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/AlmaLinux/10/etc/logrotate.d/btmp @@ -0,0 +1,7 @@ +# no packages own btmp -- we'll rotate it here +/var/log/btmp { + missingok + monthly + create 0660 root utmp + rotate 1 +} diff --git a/templates/AlmaLinux/10/etc/logrotate.d/wtmp b/templates/AlmaLinux/10/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/AlmaLinux/10/etc/logrotate.d/wtmp @@ -0,0 +1,8 @@ +# no packages own wtmp -- we'll rotate it here +/var/log/wtmp { + missingok + monthly + create 0664 root utmp + minsize 1M + rotate 1 +} diff --git a/templates/CentOS/10/etc/logrotate.conf b/templates/CentOS/10/etc/logrotate.conf new file mode 100644 index 0000000..8cba9ae --- /dev/null +++ b/templates/CentOS/10/etc/logrotate.conf @@ -0,0 +1,20 @@ +# see "man logrotate" for details +# rotate log files weekly +daily + +# keep 4 weeks worth of backlogs +rotate {{ log_retention_days }} + +# create new (empty) log files after rotating old ones +create + +# use date as a suffix of the rotated file +dateext + +# uncomment this if you want your log files compressed +compress + +# packages drop log rotation information into this directory +include /etc/logrotate.d + +# system-specific logs may be also be configured here. diff --git a/templates/CentOS/10/etc/logrotate.d/btmp b/templates/CentOS/10/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/CentOS/10/etc/logrotate.d/btmp @@ -0,0 +1,7 @@ +# no packages own btmp -- we'll rotate it here +/var/log/btmp { + missingok + monthly + create 0660 root utmp + rotate 1 +} diff --git a/templates/CentOS/10/etc/logrotate.d/wtmp b/templates/CentOS/10/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/CentOS/10/etc/logrotate.d/wtmp @@ -0,0 +1,8 @@ +# no packages own wtmp -- we'll rotate it here +/var/log/wtmp { + missingok + monthly + create 0664 root utmp + minsize 1M + rotate 1 +} diff --git a/templates/Fedora/43/etc/logrotate.conf b/templates/Fedora/43/etc/logrotate.conf new file mode 100644 index 0000000..170c8a8 --- /dev/null +++ b/templates/Fedora/43/etc/logrotate.conf @@ -0,0 +1,23 @@ +# see "man logrotate" for details + +# global options do not affect preceding include directives + +# rotate log files weekly +daily + +# keep 4 weeks worth of backlogs +rotate 90 + +# create new (empty) log files after rotating old ones +create + +# use date as a suffix of the rotated file +dateext + +# uncomment this if you want your log files compressed +compress + +# packages drop log rotation information into this directory +include /etc/logrotate.d + +# system-specific logs may also be configured here. diff --git a/templates/Fedora/43/etc/logrotate.d/btmp b/templates/Fedora/43/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/Fedora/43/etc/logrotate.d/btmp @@ -0,0 +1,7 @@ +# no packages own btmp -- we'll rotate it here +/var/log/btmp { + missingok + monthly + create 0660 root utmp + rotate 1 +} diff --git a/templates/Fedora/43/etc/logrotate.d/wtmp b/templates/Fedora/43/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/Fedora/43/etc/logrotate.d/wtmp @@ -0,0 +1,8 @@ +# no packages own wtmp -- we'll rotate it here +/var/log/wtmp { + missingok + monthly + create 0664 root utmp + minsize 1M + rotate 1 +} diff --git a/templates/Fedora/44/etc/logrotate.conf b/templates/Fedora/44/etc/logrotate.conf new file mode 100644 index 0000000..170c8a8 --- /dev/null +++ b/templates/Fedora/44/etc/logrotate.conf @@ -0,0 +1,23 @@ +# see "man logrotate" for details + +# global options do not affect preceding include directives + +# rotate log files weekly +daily + +# keep 4 weeks worth of backlogs +rotate 90 + +# create new (empty) log files after rotating old ones +create + +# use date as a suffix of the rotated file +dateext + +# uncomment this if you want your log files compressed +compress + +# packages drop log rotation information into this directory +include /etc/logrotate.d + +# system-specific logs may also be configured here. diff --git a/templates/Fedora/44/etc/logrotate.d/btmp b/templates/Fedora/44/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/Fedora/44/etc/logrotate.d/btmp @@ -0,0 +1,7 @@ +# no packages own btmp -- we'll rotate it here +/var/log/btmp { + missingok + monthly + create 0660 root utmp + rotate 1 +} diff --git a/templates/Fedora/44/etc/logrotate.d/wtmp b/templates/Fedora/44/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/Fedora/44/etc/logrotate.d/wtmp @@ -0,0 +1,8 @@ +# no packages own wtmp -- we'll rotate it here +/var/log/wtmp { + missingok + monthly + create 0664 root utmp + minsize 1M + rotate 1 +} diff --git a/templates/OracleLinux/10/etc/logrotate.conf b/templates/OracleLinux/10/etc/logrotate.conf new file mode 100644 index 0000000..8cba9ae --- /dev/null +++ b/templates/OracleLinux/10/etc/logrotate.conf @@ -0,0 +1,20 @@ +# see "man logrotate" for details +# rotate log files weekly +daily + +# keep 4 weeks worth of backlogs +rotate {{ log_retention_days }} + +# create new (empty) log files after rotating old ones +create + +# use date as a suffix of the rotated file +dateext + +# uncomment this if you want your log files compressed +compress + +# packages drop log rotation information into this directory +include /etc/logrotate.d + +# system-specific logs may be also be configured here. diff --git a/templates/OracleLinux/10/etc/logrotate.d/btmp b/templates/OracleLinux/10/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/OracleLinux/10/etc/logrotate.d/btmp @@ -0,0 +1,7 @@ +# no packages own btmp -- we'll rotate it here +/var/log/btmp { + missingok + monthly + create 0660 root utmp + rotate 1 +} diff --git a/templates/OracleLinux/10/etc/logrotate.d/wtmp b/templates/OracleLinux/10/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/OracleLinux/10/etc/logrotate.d/wtmp @@ -0,0 +1,8 @@ +# no packages own wtmp -- we'll rotate it here +/var/log/wtmp { + missingok + monthly + create 0664 root utmp + minsize 1M + rotate 1 +} diff --git a/templates/Rocky/10/etc/logrotate.conf b/templates/Rocky/10/etc/logrotate.conf new file mode 100644 index 0000000..8cba9ae --- /dev/null +++ b/templates/Rocky/10/etc/logrotate.conf @@ -0,0 +1,20 @@ +# see "man logrotate" for details +# rotate log files weekly +daily + +# keep 4 weeks worth of backlogs +rotate {{ log_retention_days }} + +# create new (empty) log files after rotating old ones +create + +# use date as a suffix of the rotated file +dateext + +# uncomment this if you want your log files compressed +compress + +# packages drop log rotation information into this directory +include /etc/logrotate.d + +# system-specific logs may be also be configured here. diff --git a/templates/Rocky/10/etc/logrotate.d/btmp b/templates/Rocky/10/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/Rocky/10/etc/logrotate.d/btmp @@ -0,0 +1,7 @@ +# no packages own btmp -- we'll rotate it here +/var/log/btmp { + missingok + monthly + create 0660 root utmp + rotate 1 +} diff --git a/templates/Rocky/10/etc/logrotate.d/wtmp b/templates/Rocky/10/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/Rocky/10/etc/logrotate.d/wtmp @@ -0,0 +1,8 @@ +# no packages own wtmp -- we'll rotate it here +/var/log/wtmp { + missingok + monthly + create 0664 root utmp + minsize 1M + rotate 1 +} diff --git a/vars/AlmaLinux-10-default.yml b/vars/AlmaLinux-10-default.yml new file mode 100644 index 0000000..e4a906c --- /dev/null +++ b/vars/AlmaLinux-10-default.yml @@ -0,0 +1,25 @@ +--- +# vars file for ensure_log_rotation +package_list: + - name: 'logrotate' + state: 'present' +template_list: + - dest: '/etc/logrotate.conf' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.conf' + - dest: '/etc/logrotate.d/btmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/btmp' + - dest: '/etc/logrotate.d/wtmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/wtmp' + diff --git a/vars/CentOS-10-default.yml b/vars/CentOS-10-default.yml new file mode 100644 index 0000000..e4a906c --- /dev/null +++ b/vars/CentOS-10-default.yml @@ -0,0 +1,25 @@ +--- +# vars file for ensure_log_rotation +package_list: + - name: 'logrotate' + state: 'present' +template_list: + - dest: '/etc/logrotate.conf' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.conf' + - dest: '/etc/logrotate.d/btmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/btmp' + - dest: '/etc/logrotate.d/wtmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/wtmp' + diff --git a/vars/Fedora-43-default.yml b/vars/Fedora-43-default.yml new file mode 100644 index 0000000..96c7d46 --- /dev/null +++ b/vars/Fedora-43-default.yml @@ -0,0 +1,29 @@ +--- +# vars file for ensure_log_rotation +package_list: + - name: 'logrotate' + state: 'present' +service_list: + - name: 'logrotate.timer' + state: 'started' + enabled: 'yes' +template_list: + - dest: '/etc/logrotate.conf' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.conf' + - dest: '/etc/logrotate.d/btmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/btmp' + - dest: '/etc/logrotate.d/wtmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/wtmp' + diff --git a/vars/Fedora-44-default.yml b/vars/Fedora-44-default.yml new file mode 100644 index 0000000..96c7d46 --- /dev/null +++ b/vars/Fedora-44-default.yml @@ -0,0 +1,29 @@ +--- +# vars file for ensure_log_rotation +package_list: + - name: 'logrotate' + state: 'present' +service_list: + - name: 'logrotate.timer' + state: 'started' + enabled: 'yes' +template_list: + - dest: '/etc/logrotate.conf' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.conf' + - dest: '/etc/logrotate.d/btmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/btmp' + - dest: '/etc/logrotate.d/wtmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/wtmp' + diff --git a/vars/OracleLinux-10-default.yml b/vars/OracleLinux-10-default.yml new file mode 100644 index 0000000..e4a906c --- /dev/null +++ b/vars/OracleLinux-10-default.yml @@ -0,0 +1,25 @@ +--- +# vars file for ensure_log_rotation +package_list: + - name: 'logrotate' + state: 'present' +template_list: + - dest: '/etc/logrotate.conf' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.conf' + - dest: '/etc/logrotate.d/btmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/btmp' + - dest: '/etc/logrotate.d/wtmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/wtmp' + diff --git a/vars/Rocky-10-default.yml b/vars/Rocky-10-default.yml new file mode 100644 index 0000000..e4a906c --- /dev/null +++ b/vars/Rocky-10-default.yml @@ -0,0 +1,25 @@ +--- +# vars file for ensure_log_rotation +package_list: + - name: 'logrotate' + state: 'present' +template_list: + - dest: '/etc/logrotate.conf' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.conf' + - dest: '/etc/logrotate.d/btmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/btmp' + - dest: '/etc/logrotate.d/wtmp' + force: 'yes' + group: 'root' + mode: '0644' + owner: 'root' + src: '{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/etc/logrotate.d/wtmp' +