From 59cd41be51ebeec526054c13b2c956143aba08ff Mon Sep 17 00:00:00 2001 From: Jason Rothstein Date: Sun, 30 Jun 2024 13:45:17 -0500 Subject: [PATCH] Add Alma/Oracle/Rocky 8 and 9 Signed-off-by: Jason Rothstein --- templates/AlmaLinux/8/etc/logrotate.conf | 20 ++++++++++++++++ templates/AlmaLinux/8/etc/logrotate.d/btmp | 7 ++++++ templates/AlmaLinux/8/etc/logrotate.d/wtmp | 8 +++++++ templates/AlmaLinux/9/etc/logrotate.conf | 20 ++++++++++++++++ templates/AlmaLinux/9/etc/logrotate.d/btmp | 7 ++++++ templates/AlmaLinux/9/etc/logrotate.d/wtmp | 8 +++++++ templates/OracleLinux/8/etc/logrotate.conf | 20 ++++++++++++++++ templates/OracleLinux/8/etc/logrotate.d/btmp | 7 ++++++ templates/OracleLinux/8/etc/logrotate.d/wtmp | 8 +++++++ templates/OracleLinux/9/etc/logrotate.conf | 20 ++++++++++++++++ templates/OracleLinux/9/etc/logrotate.d/btmp | 7 ++++++ templates/OracleLinux/9/etc/logrotate.d/wtmp | 8 +++++++ templates/Rocky/8/etc/logrotate.conf | 20 ++++++++++++++++ templates/Rocky/8/etc/logrotate.d/btmp | 7 ++++++ templates/Rocky/8/etc/logrotate.d/wtmp | 8 +++++++ templates/Rocky/9/etc/logrotate.conf | 20 ++++++++++++++++ templates/Rocky/9/etc/logrotate.d/btmp | 7 ++++++ templates/Rocky/9/etc/logrotate.d/wtmp | 8 +++++++ vars/AlmaLinux-8-default.yml | 25 ++++++++++++++++++++ vars/AlmaLinux-9-default.yml | 25 ++++++++++++++++++++ vars/OracleLinux-8-default.yml | 25 ++++++++++++++++++++ vars/OracleLinux-9-default.yml | 25 ++++++++++++++++++++ vars/Rocky-8-default.yml | 25 ++++++++++++++++++++ vars/Rocky-9-default.yml | 25 ++++++++++++++++++++ 24 files changed, 360 insertions(+) create mode 100644 templates/AlmaLinux/8/etc/logrotate.conf create mode 100644 templates/AlmaLinux/8/etc/logrotate.d/btmp create mode 100644 templates/AlmaLinux/8/etc/logrotate.d/wtmp create mode 100644 templates/AlmaLinux/9/etc/logrotate.conf create mode 100644 templates/AlmaLinux/9/etc/logrotate.d/btmp create mode 100644 templates/AlmaLinux/9/etc/logrotate.d/wtmp create mode 100644 templates/OracleLinux/8/etc/logrotate.conf create mode 100644 templates/OracleLinux/8/etc/logrotate.d/btmp create mode 100644 templates/OracleLinux/8/etc/logrotate.d/wtmp create mode 100644 templates/OracleLinux/9/etc/logrotate.conf create mode 100644 templates/OracleLinux/9/etc/logrotate.d/btmp create mode 100644 templates/OracleLinux/9/etc/logrotate.d/wtmp create mode 100644 templates/Rocky/8/etc/logrotate.conf create mode 100644 templates/Rocky/8/etc/logrotate.d/btmp create mode 100644 templates/Rocky/8/etc/logrotate.d/wtmp create mode 100644 templates/Rocky/9/etc/logrotate.conf create mode 100644 templates/Rocky/9/etc/logrotate.d/btmp create mode 100644 templates/Rocky/9/etc/logrotate.d/wtmp create mode 100644 vars/AlmaLinux-8-default.yml create mode 100644 vars/AlmaLinux-9-default.yml create mode 100644 vars/OracleLinux-8-default.yml create mode 100644 vars/OracleLinux-9-default.yml create mode 100644 vars/Rocky-8-default.yml create mode 100644 vars/Rocky-9-default.yml diff --git a/templates/AlmaLinux/8/etc/logrotate.conf b/templates/AlmaLinux/8/etc/logrotate.conf new file mode 100644 index 0000000..8cba9ae --- /dev/null +++ b/templates/AlmaLinux/8/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/8/etc/logrotate.d/btmp b/templates/AlmaLinux/8/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/AlmaLinux/8/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/8/etc/logrotate.d/wtmp b/templates/AlmaLinux/8/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/AlmaLinux/8/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/AlmaLinux/9/etc/logrotate.conf b/templates/AlmaLinux/9/etc/logrotate.conf new file mode 100644 index 0000000..8cba9ae --- /dev/null +++ b/templates/AlmaLinux/9/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/9/etc/logrotate.d/btmp b/templates/AlmaLinux/9/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/AlmaLinux/9/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/9/etc/logrotate.d/wtmp b/templates/AlmaLinux/9/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/AlmaLinux/9/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/8/etc/logrotate.conf b/templates/OracleLinux/8/etc/logrotate.conf new file mode 100644 index 0000000..8cba9ae --- /dev/null +++ b/templates/OracleLinux/8/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/8/etc/logrotate.d/btmp b/templates/OracleLinux/8/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/OracleLinux/8/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/8/etc/logrotate.d/wtmp b/templates/OracleLinux/8/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/OracleLinux/8/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/9/etc/logrotate.conf b/templates/OracleLinux/9/etc/logrotate.conf new file mode 100644 index 0000000..8cba9ae --- /dev/null +++ b/templates/OracleLinux/9/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/9/etc/logrotate.d/btmp b/templates/OracleLinux/9/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/OracleLinux/9/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/9/etc/logrotate.d/wtmp b/templates/OracleLinux/9/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/OracleLinux/9/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/8/etc/logrotate.conf b/templates/Rocky/8/etc/logrotate.conf new file mode 100644 index 0000000..8cba9ae --- /dev/null +++ b/templates/Rocky/8/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/8/etc/logrotate.d/btmp b/templates/Rocky/8/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/Rocky/8/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/8/etc/logrotate.d/wtmp b/templates/Rocky/8/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/Rocky/8/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/9/etc/logrotate.conf b/templates/Rocky/9/etc/logrotate.conf new file mode 100644 index 0000000..8cba9ae --- /dev/null +++ b/templates/Rocky/9/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/9/etc/logrotate.d/btmp b/templates/Rocky/9/etc/logrotate.d/btmp new file mode 100644 index 0000000..0aa1ae1 --- /dev/null +++ b/templates/Rocky/9/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/9/etc/logrotate.d/wtmp b/templates/Rocky/9/etc/logrotate.d/wtmp new file mode 100644 index 0000000..cc8a151 --- /dev/null +++ b/templates/Rocky/9/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-8-default.yml b/vars/AlmaLinux-8-default.yml new file mode 100644 index 0000000..e4a906c --- /dev/null +++ b/vars/AlmaLinux-8-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/AlmaLinux-9-default.yml b/vars/AlmaLinux-9-default.yml new file mode 100644 index 0000000..e4a906c --- /dev/null +++ b/vars/AlmaLinux-9-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/OracleLinux-8-default.yml b/vars/OracleLinux-8-default.yml new file mode 100644 index 0000000..e4a906c --- /dev/null +++ b/vars/OracleLinux-8-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/OracleLinux-9-default.yml b/vars/OracleLinux-9-default.yml new file mode 100644 index 0000000..e4a906c --- /dev/null +++ b/vars/OracleLinux-9-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-8-default.yml b/vars/Rocky-8-default.yml new file mode 100644 index 0000000..e4a906c --- /dev/null +++ b/vars/Rocky-8-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-9-default.yml b/vars/Rocky-9-default.yml new file mode 100644 index 0000000..e4a906c --- /dev/null +++ b/vars/Rocky-9-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' +