This line was introduced by I9d50c557ff6359c8db3c065edc68130de0aefdc9
for centos-7 support, but should since be covered by the
distribution_major_version line above, introduced at a later date.
Change-Id: I0c94adf0a0d2a2ec7eb90e86b6435f349f6db89c
Use a first_found lookup instead of a with_first_found loop so that
the 'paths' parameter can be used.
This ensures that only vars from the role are included, and not vars
from a parent calling role. This can happen when a parent role has
a higher priority vars file available for inclusion than the role
it calls.
Change-Id: Ie02e3d6c769f3668a29f06af641f61c613eb74f7
This patch differentiates rsyslogd configurations based on operating system
by defining respective system logfile location and user/group.
Change-Id: If5134278f7aa5e726325be38bb0bf8a560b668e5
Closes-Bug: #1807268
With the more recent versions of ansible, we should now use
"is" instead of the "|" sign for the tests.
This should fix it.
Change-Id: Iee010bdcf55943f42433234d6c6f60ba103e6953
The 'Check if log dir exists' task is tagged as 'rsyslog_client-install'
but registers a variable that is only used by an 'rsyslog_client-config'
tagged task.
Change-Id: I97c3b37a4cc26f0f074f37f992d4764ab75abfdc
We set the groups for the syslog user to be "adm", but this will clear
any existing groups. That will mess with permissions in cases where we
want syslog to be in other groups for the ability to handle a different
applications logging.
Change-Id: If267cfd2f3f8f182c396e3f2836ec7e1d572fe0a
The log file list, when empty, is cast as a string containing "set()",
which produces a broken log config file.
Closes-Bug: #1716138
Change-Id: If429ba3b63252d066db5a410b80ff29e813d96e1
We should:
- Not check what we do not set (kern.log and auth.log are already
defined in rsyslog file, which we do not template). These two
files would trigger an issue if both are in the same logrotate
configuration.
- Check that the rotation works, by forcing a rotation, and seeing
that the new files are empty.
Change-Id: I08357260e45919d9e71586cac6b9ce413adffc22
Closes-Bug: 1699875
Closes-Bug: 1709291
The update of the apt cache and the package installation
can all be handled in a single task by providing the
package action plugin with the right parameters. This
removes an extra task to optimise execution.
The minimum Ansible version is raised to 2.2 due to a
known bug [1] in Ansible's apt module which does not
update the cache properly if the cache update and the
install are combined in a single task.
[1] https://github.com/ansible/ansible-modules-core/issues/1497
Change-Id: I171c4d7d6e051b69106156df797ea96d6184014a
Add support for SUSE based distributions. We also update the bindep.txt,
run_tests.sh and Vagrantfile files from the openstack-ansible-tests
repository.
Change-Id: I9dd0290d9eb7be77446a6bd5c048ceb3371fa536
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
Roles that depend on the rsyslog_client role may not have rsyslog_all
servers setup - this will then fail as the group does not exist in the
inventory.
We should test whether the group exists, and skip if the group doesn't
exist or if the host is not in the group.
Change-Id: Ica4e2e5ab2cf7e433e2d8bff05c4bca70031a65d
when rsyslog client role is invoked as part of monitoring agent
installation across all hosts its breaking the rsyslog server.
Added conditions not overwrite the rsyslog configs on rsyslog servers.
Change-Id: Iea783d443af96d9996fd25ea9355f2930d82fb20
Added rsyslog restart handlers to each rsyslog_client_post_install task.
There was an issue when rsyslog_client_post_install would stop its service,
it would automatically get restarted and the service would not listen
for incoming logs. This now ensures that the rsyslog service will
be restarted after configuration files are changed.
Change-Id: I0cc9dd512fba6a1d583bf861a645097ae7c1d852
Partial-Bug: 1636017
When log_files isn't defined the "rsyslog_client_all_log_files" will
error out, so we conditionally create this depending on whether
log_files will have been created or not.
Change-Id: I51b16c234c0ddc88751b2e8af6c62688a3a518f0
The task to perform a union on the log files will fail if the previous
task is skipped, since the value "log_files.files" is not defined.
We should skip the if the variable doesn't exist, since we already
conditionally perform the task that creates the "log_files" fact.
Change-Id: Iade36c8d79b0e0653c4f7348e609aa1f8d88a4a0
This patch also fixes the following nit.
Compute nodes have soft-links for log directories and currently
gets passed by this when clause:
- log_dir.stat.isdir is defined and log_dir.stat.isdir
Removing this allows the find module to search through all log directories defined.
Change-Id: I69e2beee7a202f94cfcf13dba3d17c16cef252ed
Closes-Bug: #1636017
Fix bug with search dir conditional introduced by
Iba17bed79e26e6e7eb2300d413058145ec680d87.
Change-Id: I291e3582e5cb01f4a9c394bc8e7d8289ca577f90
Closes-Bug: #1648490
Fix the regression introduced in
I371d0bbbd1f9dfa893df054471f17f5cc4b640df which causes
the role to fail if a log directory is not provided.
Change-Id: Iba17bed79e26e6e7eb2300d413058145ec680d87
Changing the paths of nginx logs to not rely on the
user name of repo service. This is because nginx related
configurations, playbooks assume nginx in the directory names.
Change-Id: I84f7e029ff0ce5d0c79acbd2e401d93d8fd2963c
Closes-Bug: #1633739
Ansible 2.1.1 introduces a regression in the way conditional
includes are handled which results in every task in the
included file being evaluated even if the condition for the
include is not met. This extends the run time significantly
for a deployment.
This patch forces all conditional includes to be dynamic.
Change-Id: Idaf2a72b1744d223d913991fda70af109a51dfa4
Related-Bug: https://github.com/ansible/ansible/issues/17687
This check adds a check to ensure that a target log directory
exists prior to running the "find" comand to index specific log
files.
Change-Id: I371d0bbbd1f9dfa893df054471f17f5cc4b640df
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
In order to make it easier to differentiate between the lists of
python packages, distribution packages, downloaded packages,
package pins and other similar variables the variable names are
being changed to ensure that they have a more explicit suffix
that defines the purpose and makes the naming more consistent.
This is to facilitate a lookup plugin which will be able to look
up all the package lists and present them as a consolidated piece
of data which may be used for artifact preparation.
Change-Id: If3816d9c79ecd1a61a3a53fed95828bff6d91181
The ability to implement a custom apt/yum repository for rsyslog_client
has been removed as it is unused. Deployers may opt to do this in
a number of other methods (including customising the base container
cache) which do not require us to maintain this code.
Having this ability there resulted in the apt cache updating every time
the role executed even though there was no repo being added.
The cache_timeout variable is moved to the role defaults to allow it
to be overridden more easily and to be exposed in the role docs.
Change-Id: I113c9803495f2a935b99f272c387a4304a149cbf
The current method of installing the distribution packages required is
set in the tasks and cannot be changed by a deployer.
Currently the apt task always installs the latest package. This results
in unexpected binary changes when a deployer may simply be trying to
execute a configuration change.
This patch adds the ability for a deployer to change the desired state
so that the results are predictable.
Change-Id: Ie75b2eb144a622373ff204b4a9d79a8791ea4790
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
The numerous tags within the role have been condensed
to two tags: rsyslog-client-install and rsyslog-client-config
These tags have been chosen as they are namespaced
and cover the two major functions of the role.
Change-Id: Ie673eb71affc5bc550a06f53646e6b4569d15ff0
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
This change adds a new variable and task file for supporting
CentOS7 based deployments.
Change-Id: I9d50c557ff6359c8db3c065edc68130de0aefdc9
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This is an implementation of a pattern for multi-distro support
This allows for support of distros other than Ubuntu
Change-Id: Ide94831464a74827d5c46b38557e483aaf4180d0
Workarounding the upstream ansible apt module bug
documented here:
https://github.com/ansible/ansible-modules-core/pull/1517
For the next versions of ansible we'll be using, we should
check if the apt bug is fixed. When it's fixed, we could
abandon this change and use the standard apt module
with correct cache handling.
Change-Id: I72cdba6820f1ec0066567b5cde539f018b5779b9
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>
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>