Commit Graph

13 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov dcf6aed584 Deprecate rsyslog_client role
Depends-On: https://review.opendev.org/c/openstack/project-config/+/863079
Change-Id: I47bcd43247e0d589932b63cec782567d33d35f28
2022-10-31 16:56:19 +01:00
James Denton 70be33495f Templatize rsyslog configuration files
This patch differentiates rsyslogd configurations based on operating system
by defining respective system logfile location and user/group.

Change-Id: If5134278f7aa5e726325be38bb0bf8a560b668e5
Closes-Bug: #1807268
2019-02-14 14:24:38 +00:00
Jimmy McCrory e70d85f255 Sort file names within templates
For consistent templating and to avoid unnecessary service restarts,
sort the list of gathered log file names.

Change-Id: I838a791b1241de847f8f03ff5a4f4a3f117b4e43
2017-11-07 20:09:40 -08:00
Ravi Kumar Boyapati 73e79bcdd7 Fix mutiple restart of rsyslog daemon
Added "sharedscripts" option to avoid multiple restart of rsyslogd.

Change-Id: Ide851397fe089e28792751b5e0bf7c994cef5139
2017-03-25 16:36:11 -04:00
Ravi Kumar Boyapati 3edc8e144f Fix remote logging template
Since the intent of the role is to stream only specified logs
updated the filter to match local7 facility which the role is setting
for the application logs with "$InputFileFacility local7" in
99-rsyslog.conf.j2 template.

Change-Id: I531652300440d12cb98ada9c6eac44e9d4ab731f
2017-03-17 00:02:22 -04:00
Ravi Kumar Boyapati 705b264df2 Fix remote logging template
Splitted functionality, one template for generating remote syslog
targets and another for streaming the user specifed log files in
syslog format. This avoids duplcate targets when the role is
invoked mutiple times against a host when installing services.

Change-Id: I53e2faf69c0446bea9738a66ee8585e8d795cf52
2017-03-13 16:17:31 -04:00
Ravi Kumar Boyapati c63290a0a4 Logrotate not restarting rsyslog
logrotate is not sending HUP signal to rsyslog because of invalid
command in postrotate/endscript block. Fixed the command to reload
the rsyslog after the logs are rotated.

Change-Id: Ia1fa205e6f20c212841109c914a8c7e2d379a48b
2017-03-01 09:20:02 -05:00
Kevin Carter d11071f283 Update testing bits for consistency
Change-Id: I70b28988332a8d2073afbd46960582a5780ae48c
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-09-17 17:14:43 -04:00
Jimmy McCrory 6c1f43a4cc Allow overriding of default logrotate options
Two variables have been added, rsyslog_client_log_rotate_options
and rsyslog_client_log_rotate_scripts, to allow deployers to override
and set logrotate config options as they wish.

The os_aggregate_storage.j2 template has also been renamed to
logrotate.j2 to better fit its purpose.

Change-Id: If7538fd2409f3583f22209868f538e01796813c2
2016-07-05 20:38:39 -07:00
Gaudenz Steinlin 6910847bce Fix config generated for rsyslog_client_log_files
The rsyslog_client_log_files role variable was masked by the
rsyslog_client_log_files fact set during the post install task. This
caused the log files set in the rsyslog_client_log_files variable to be
ignored on the second or later invocation of the rsyslog_client role.
Instead the log files discovered from rsyslog_client_dir on previous
runs of the role were add to the list of logfiles. This resulted in
missing rsyslog configurations and duplicate logrotate entries.

Change-Id: I00a58def426a4f30f1e64a24320ee68157b95f24
2016-06-15 14:55:26 +02:00
Shu Shen 04b8a98f2b Restart rsyslogd after logrotate
The copytruncate directive in logrotate configuration truncates the log file so
that processes can keep using the same file descriptor to write to the log
file. The truncation, however, does not work well with rsyslog forwarding as
rsyslog fails to figure out the difference from last sent messages.

This change restarts rsyslogd in postrotate directive of logrotate such as
rsyslog will start with a new baseline and continue forwarding logs.

Closes-Bug: 1564654
Change-Id: Ied15bc73e5af78bfcc1430db787b61d65a9bc044
Signed-off-by: Shu Shen <sshen@siaras.com>
2016-03-31 16:14:36 -07:00
Kevin Carter 80b47a87e6 Added conditional templating
The change adds a conditional to the log rotate template
so that its only rendered when log files are present in the
log file discovery task.

Closes-Bug: 1539210
Change-Id: I3fba6eda958ce4f857dc5f06b5c700cbd3735c89
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-02-02 16:31:55 +00:00
Kevin Carter ed60bae35a
IRR for rsyslog_client
The change moves the role out from the main repo rsyslog_client
repository and into its own standalone repository.

Items within this change:
  * The role has been updated to ensure it runs standalone.
  * Tests added to the role within tox.
  * Functional tests added to the role that can either be run
    via the run_tests.sh script or using tox.
  * dev requirements have been updated for testing usecases.
  * Docs added to both the README.rst file as well as the docs
    folder.

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-11-03 02:27:54 -06:00