Compare commits

...

50 Commits

Author SHA1 Message Date
jmrothst 88133e84ee Merge ensure_log_rotation
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-10 21:36:02 -05:00
jmrothst e1a12cf5c8 Add 'roles/ensure_log_rotation/' from commit 'a773ec408c77942fe88d5104ef1c3481ad154112'
git-subtree-dir: roles/ensure_log_rotation
git-subtree-mainline: 57d3ef9c28
git-subtree-split: a773ec408c
2026-05-10 21:35:40 -05:00
jmrothst a773ec408c More ansible core 2.20 fixes
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-05 18:12:18 -05:00
jmrothst 7da224190f More ansible core 2.20 fixes
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-05 10:48:46 -05:00
jmrothst a842699a00 Ansible core 2.20 fixes and only supported OS releases
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-05 10:44:39 -05:00
jmrothst 49d83a4c6f Fix logrotate.conf for EL10
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-04-30 00:09:39 -05:00
jmrothst 183027fbb6 Fedora 43, 44, Alma 10, CentOS 10, Oracle 10 and Rocky 10 2026-04-29 23:47:06 -05:00
jmrothst 0c15c19e1a Handler improvement
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2025-05-25 20:08:20 -05:00
jmrothst bc3ffbcc22 Fedora 42
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2025-04-27 12:35:26 -05:00
jmrothst 18c15c9244 Fedora 41
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2024-12-27 16:16:18 -06:00
jmrothst 59cd41be51 Add Alma/Oracle/Rocky 8 and 9
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2024-06-30 13:45:17 -05:00
jmrothst f5b1d66dd8 Fedora 40 support
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2024-06-02 12:18:11 -05:00
jmrothst d22f3f2de1 Add Fedora 39 2024-03-16 20:21:45 -05:00
jmrothst 01268bb64a Add Fedora 38 and CentOS 9 2023-04-30 17:45:12 -05:00
jmrothst 0f7139b21c Add Fedora 37 2022-12-06 20:46:18 -06:00
jmrothst 7cfd49d9bd Update tasks 2022-06-05 16:47:55 -05:00
jmrothst 07ea5cf6af Update handlers 2022-06-05 16:29:33 -05:00
jmrothst 30ef8ff18c Add Fedora 36 2022-06-05 12:25:49 -05:00
jmrothst 4201b004b6 Add Fedora 35 2021-11-13 21:22:43 -06:00
jmrothst b11e54e88b Really only remove one set of flush handlers... 2021-07-25 04:11:20 +00:00
jmrothst 7e4eab3cbf Prevent multiple service restarts 2021-07-25 03:50:25 +00:00
jmrothst 1ed6bd0ccb Flush notifications after templating configs 2021-07-21 02:42:35 +00:00
jmrothst 14e33ecc87 template should not have had packages check 2021-07-05 04:53:08 +00:00
jmrothst 0b5a7c157a Skip packages that already installed 2021-07-05 04:47:05 +00:00
jmrothst 7c24efe69b Enable Fedora 34 2021-06-29 22:20:53 -05:00
jmrothst 9053f02dbd ENsure correct variable file names 2021-02-08 21:29:30 -06:00
jmrothst 55a0e76641 Do service discovery as well as package discovery 2020-12-20 07:42:01 -06:00
jmrothst ba7bbb305b Do service discovery as well as package discovery 2020-12-20 07:40:15 -06:00
jmrothst 4250f753ea Use Ansible FQCN 2020-11-29 21:24:11 -06:00
jmrothst d14565866d Prefer Ansible Disitribution over Ansible OS Family 2020-11-29 21:21:48 -06:00
jmrothst c866bbaf4f Enable Fedora 32 and Fedora 33 support 2020-11-22 14:28:46 -06:00
jmrothst 3959e8c2f5 Make galaxy metadata match 2020-03-28 17:38:34 -05:00
jmrothst 564bb8fd79 Make syntax maintainable and find the spelling error 2020-03-28 17:29:44 -05:00
jmrothst 788289d494 Markdown table adjustment for strict interpretations 2020-03-28 16:42:37 -05:00
jmrothst 057032f6b2 Revert because gitea cannot format markdown tables *grrr* 2020-03-28 16:40:11 -05:00
jmrothst 6865134483 Markdown format issue in readme for table 2020-03-28 16:38:41 -05:00
jmrothst e253c47116 Use ansible_os_family instead of ansbile_distribution for EL based distributions on templates 2020-03-28 16:37:11 -05:00
jmrothst 579032189f Make days retained configurable 2020-03-28 16:34:52 -05:00
jmrothst 47ad64d5e1 Add rotation policy to EL based OS to match Fedora 2020-03-28 16:29:32 -05:00
jmrothst 48187d8b97 Typo fix 2020-03-28 16:17:22 -05:00
jmrothst 4cec4cdb7b Set Fedora policy to 90 days of compressed logs 2020-03-28 15:47:29 -05:00
jmrothst 67c0140d73 Package install really needs to be done with package module 2020-03-27 23:33:45 -05:00
jmrothst 8e629398fe Ensure packages are installed before service management 2020-03-27 23:30:16 -05:00
jmrothst 8ca2fbb2aa Remove logrotate.service from services on Fedora as only the timer should be touched 2020-03-27 23:16:19 -05:00
jmrothst fd6c89c509 Iterate over service_list for service module only 2020-03-27 23:15:55 -05:00
jmrothst a1ed1e9cad Remove services from the RedHat OS family as the EL releases use cron for this instead of SystemD Timers 2020-03-27 23:02:04 -05:00
jmrothst d467e24cb5 Remove check for service installed before managing it and expect the input provided to be correct 2020-03-27 22:50:25 -05:00
jmrothst 10f0aab8f1 Ensure logrotate is installed and enabled 2020-03-27 22:33:48 -05:00
jmrothst bcb557d117 Add role shell 2020-03-27 22:11:51 -05:00
AnsibleRoles c7224ff7b5 Initial commit 2020-03-28 03:09:23 +00:00
73 changed files with 1433 additions and 3 deletions
+78
View File
@@ -0,0 +1,78 @@
# ---> Ansible
*.retry
# ---> Windows
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# ---> Linux
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# ---> macOS
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
+29
View File
@@ -0,0 +1,29 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
+163
View File
@@ -0,0 +1,163 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http s ://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates the terms
and conditions of version 3 of the GNU General Public License, supplemented
by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser General
Public License, and the "GNU GPL" refers to version 3 of the GNU General Public
License.
"The Library" refers to a covered work governed by this License, other than
an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided by the
Library, but which is not otherwise based on the Library. Defining a subclass
of a class defined by the Library is deemed a mode of using an interface provided
by the Library.
A "Combined Work" is a work produced by combining or linking an Application
with the Library. The particular version of the Library with which the Combined
Work was made is also called the "Linked Version".
The "Minimal Corresponding Source" for a Combined Work means the Corresponding
Source for the Combined Work, excluding any source code for portions of the
Combined Work that, considered in isolation, are based on the Application,
and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the object
code and/or source code for the Application, including any data and utility
programs needed for reproducing the Combined Work from the Application, but
excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License without
being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a facility
refers to a function or data to be supplied by an Application that uses the
facility (other than as an argument passed when the facility is invoked),
then you may convey a copy of the modified version:
a) under this License, provided that you make a good faith effort to ensure
that, in the event an Application does not supply the function or data, the
facility still operates, and performs whatever part of its purpose remains
meaningful, or
b) under the GNU GPL, with none of the additional permissions of this License
applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from a header
file that is part of the Library. You may convey such object code under terms
of your choice, provided that, if the incorporated material is not limited
to numerical parameters, data structure layouts and accessors, or small macros,
inline functions and templates (ten or fewer lines in length), you do both
of the following:
a) Give prominent notice with each copy of the object code that the Library
is used in it and that the Library and its use are covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken together,
effectively do not restrict modification of the portions of the Library contained
in the Combined Work and reverse engineering for debugging such modifications,
if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that the Library
is used in it and that the Library and its use are covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during execution, include
the copyright notice for the Library among these notices, as well as a reference
directing the user to the copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this License,
and the Corresponding Application Code in a form suitable for, and under terms
that permit, the user to recombine or relink the Application with a modified
version of the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
1) Use a suitable shared library mechanism for linking with the Library. A
suitable mechanism is one that (a) uses at run time a copy of the Library
already present on the user's computer system, and (b) will operate properly
with a modified version of the Library that is interface-compatible with the
Linked Version.
e) Provide Installation Information, but only if you would otherwise be required
to provide such information under section 6 of the GNU GPL, and only to the
extent that such information is necessary to install and execute a modified
version of the Combined Work produced by recombining or relinking the Application
with a modified version of the Linked Version. (If you use option 4d0, the
Installation Information must accompany the Minimal Corresponding Source and
Corresponding Application Code. If you use option 4d1, you must provide the
Installation Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library side
by side in a single library together with other library facilities that are
not Applications and are not covered by this License, and convey such a combined
library under terms of your choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities, conveyed under the
terms of this License.
b) Give prominent notice with the combined library that part of it is a work
based on the Library, and explaining where to find the accompanying uncombined
form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions of the
GNU Lesser General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Library as you
received it specifies that a certain numbered version of the GNU Lesser General
Public License "or any later version" applies to it, you have the option of
following the terms and conditions either of that published version or of
any later version published by the Free Software Foundation. If the Library
as you received it does not specify a version number of the GNU Lesser General
Public License, you may choose any version of the GNU Lesser General Public
License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide whether
future versions of the GNU Lesser General Public License shall apply, that
proxy's public statement of acceptance of any version is permanent authorization
for you to choose that version for the Library.
+40
View File
@@ -0,0 +1,40 @@
Role Name
=========
Ensure log rotation service is enabled
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
| variable | default | purpose |
| --- | --- | --- |
| log_retention_days | 90 | Number of days to retain logs on the system |
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
LGPL-3.0-or-later
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
@@ -0,0 +1,3 @@
---
# defaults file for ensure_log_rotation
log_retention_days: '90'
@@ -0,0 +1,29 @@
---
# handlers file for ensure_log_rotation
- name: 'ensure_log_rotation.package_facts'
ansible.builtin.package_facts:
- name: 'ensure_log_rotation.service_facts'
ansible.builtin.service_facts:
- name: 'ensure_log_rotation.service_reload'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd'
- ensure_log_rotation is defined
ansible.builtin.systemd:
daemon_reload: 'yes'
- name: 'ensure_log_rotation.service_restart'
when:
- ansible_facts["system"] == 'Linux'
- ensure_log_rotation is defined
- ensure_log_rotation.service_list is defined
- ensure_log_rotation.service_list is iterable
- item.state == 'started'
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: 'restarted'
loop: '{{ ensure_log_rotation.service_list }}'
loop_control:
label: '{{ item.name }} will be restarted'
...
+53
View File
@@ -0,0 +1,53 @@
galaxy_info:
author: Jason Rothstein
description: Ensure default log retention and rotation policy is applied
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: LGPL-3.0-or-later
min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
+94
View File
@@ -0,0 +1,94 @@
---
# tasks file for ensure_log_rotation
- name: 'include variables'
when:
- ansible_facts["system"] == 'Linux'
include_vars:
file: '{{ lookup("first_found", findme ) }}'
name: 'ensure_log_rotation'
vars:
findme:
files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["distribution"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml'
paths:
- '../vars/'
errors: 'ignore'
- name: 'package discovery'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined
ansible.builtin.package_facts:
- name: 'service discovery'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined
ansible.builtin.service_facts:
- name: 'ensure packages'
when:
- ansible_facts["system"] == 'Linux'
- ensure_log_rotation is defined
- ensure_log_rotation.package_list is defined
- ensure_log_rotation.package_list is iterable
ansible.builtin.package:
name: '{{ item.name }}'
state: '{{ item.state }}'
loop: '{{ ensure_log_rotation.package_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_log_rotation.package_facts'
- 'ensure_log_rotation.service_facts'
- name: 'ensure configuration'
when:
- ansible_facts["system"] == 'Linux'
- ensure_log_rotation is defined
- ensure_log_rotation.template_list is defined
- ensure_log_rotation.template_list is iterable
ansible.builtin.template:
attributes: '{{ item.attributes | default(omit) }}'
backup: '{{ item.backup | default(omit) }}'
dest: '{{ item.dest }}'
follow: '{{ item.follow | default(omit) }}'
force: '{{ item.force | default(omit) }}'
group: '{{ item.group | default(omit) }}'
mode: '{{ item.mode | default(omit) }}'
owner: '{{ item.owner | default(omit) }}'
selevel: '{{ item.selevel | default(omit) }}'
serole: '{{ item.serole | default(omit) }}'
setype: '{{ item.setype | default(omit) }}'
seuser: '{{ item.seuser | default(omit) }}'
src: '{{ item.src | default(omit) }}'
validate: '{{ item.validate | default(omit) }}'
loop: '{{ ensure_log_rotation.template_list }}'
loop_control:
label: '{{ item.dest }}'
notify:
- 'ensure_log_rotation.package_facts'
- 'ensure_log_rotation.service_facts'
- 'ensure_log_rotation.service_reload'
- 'ensure_log_rotation.service_restart'
- name: 'ensure services'
when:
- ansible_facts["system"] == 'Linux'
- ensure_log_rotation is defined
- ensure_log_rotation.service_list is defined
- ensure_log_rotation.service_list is iterable
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: '{{ item.state }}'
loop: '{{ ensure_log_rotation.service_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_log_rotation.package_facts'
- 'ensure_log_rotation.service_facts'
- name: 'flush handlers'
meta: 'flush_handlers'
@@ -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 {{ 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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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 {{ 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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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 {{ 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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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 {{ 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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -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.
@@ -0,0 +1,7 @@
# no packages own btmp -- we'll rotate it here
/var/log/btmp {
missingok
monthly
create 0660 root utmp
rotate 1
}
@@ -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
}
@@ -0,0 +1,2 @@
localhost
+5
View File
@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- ensure_log_rotation
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -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_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.conf'
- dest: '/etc/logrotate.d/btmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/btmp'
- dest: '/etc/logrotate.d/wtmp'
force: 'yes'
group: 'root'
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/wtmp'
@@ -0,0 +1,2 @@
---
# vars file for ensure_log_rotation
+2
View File
@@ -0,0 +1,2 @@
---
# vars file for ensure_log_rotation
-3
View File
@@ -9,9 +9,6 @@ roles:
- name: 'ensure_gitea' - name: 'ensure_gitea'
src: 'git+https://git.fdragon.com/AnsibleRoles/ensure_gitea.git' src: 'git+https://git.fdragon.com/AnsibleRoles/ensure_gitea.git'
version: 'main' version: 'main'
- name: 'ensure_log_rotation'
src: 'git+https://git.fdragon.com/AnsibleRoles/ensure_log_rotation.git'
version: 'master'
- name: 'ensure_mariadb' - name: 'ensure_mariadb'
src: 'git+https://git.fdragon.com/AnsibleRoles/ensure_mariadb.git' src: 'git+https://git.fdragon.com/AnsibleRoles/ensure_mariadb.git'
version: 'master' version: 'master'