Commit Graph

27 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 07ae836651 Deprecate rsyslog_server role
Depends-On: https://review.opendev.org/c/openstack/project-config/+/863079
Change-Id: I2abe014ede0e3fa4ed07b22990c95beb2b847222
2022-10-31 16:59:05 +01:00
Erik Berg 2f6062d1b2 Remove redundant vars line
This line snuck in with I68087b411e0a056bc2c9a654bf975ea36de5fbec
probably to bring it in line with other OSA roles, but should already
be covered by the distribution_major_version line above.

Change-Id: I5c5ce45f4a29ee1b003bc3453d5439718e3e9c9c
2022-09-15 11:16:10 +02:00
Jonathan Rosser bb0c545fc3 Refactor use of include_vars
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: I68087b411e0a056bc2c9a654bf975ea36de5fbec
2022-01-12 08:57:15 +00:00
Jonathan Rosser f00fe17373 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I48cd44cfc3834e0e27d47ab67652bb559ecefd10
2021-03-16 08:55:48 +00:00
Jonathan Rosser f5fd3452c0 Remove references to unsupported operating systems
All references to Gentoo, SUSE, Debian stretch and Centos-7  are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible

Change-Id: I1351347e9f2308c7a4c0ad41f0e0335071756f5e
2021-03-16 08:55:13 +00:00
caoyuan 78ab59bc59 use include_tasks instead of include
Change-Id: I1e0208904479cac125172cc65006c0f969786b01
2018-07-24 20:43:51 +08:00
zhulingjie 61f5e55f64 Remove the unnecessary space
Change-Id: I9bc7ee492bccb43b2527d51613cd5c93a7a3cddb
2018-07-11 23:18:09 -04:00
Jean-Philippe Evrard 1deaccde49 Fix usage of "|" for tests
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: If810a426a28f150548f7249e5f1bba05ab731c97
2018-07-12 17:05:32 +02:00
Markos Chandras 83d0f4b605 tasks: Fix permissions for /var/log directory
The files/50-defaults.conf file configures some facilities and
priorities to be logged into the /var/log directory but the role
doesn't properly configure the permissions on it so rsyslog may
not be able to write anything to that directory.

Change-Id: I15478ca348a3a399f20b54ee130ce017e8d03551
2018-05-24 13:28:11 +01:00
Jimmy McCrory b8a3625164 Consolidate package install tasks
Use the package module to install rsyslog server distro packages with
the package lists provided directly rather than looping through each
item.

Change-Id: If08bab687ef561edf61580d7f354207a83ca2393
2017-07-11 14:40:53 -07:00
Markos Chandras a1fbb19ddd Add SUSE support
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: Id96d9eec52e136b4be5acbd4657de3ebd4f25980
2017-04-05 16:02:32 +01:00
Jean-Philippe Evrard c1d97137f9 Fix inconsistency for tag
"Do what I say, not what I do" is exactly what happened here.
The previous commit to enforce the proper tag naming convention
was enforced with a typo for install tags: rolename_install
instead of rolename-install. Config tags were properly done and
don't need updating.

Change-Id: I717e72b26c62ac347ef9dca96564cebb00ec9718
2017-03-01 12:26:03 +00:00
Jarrad Battaglia a09e5ea5a6 Ensure rsyslog restarts after configuration file changes
Added rsyslog restart handlers to each rsyslog_server_post_install task.
There was an issue when rsyslog_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.
Add rsyslog_pid_name to variable files for distrubition changes for rsyslogd pid

Change-Id: I757387e8f7f7209b1ab928208894ecf4bf510efc
Partial-Bug: 1636017
2017-02-01 15:49:03 -05:00
Jean-Philippe Evrard 8208c01df7 Bring consistency to tags
Some tags were not applied on the highest level and forced duplication.
We apply here our practices to have role_name-(config|install) [1].

[1]: http://docs.openstack.org/developer/openstack-ansible/developer-docs/contribute.html#ansible-style-guide

Change-Id: I78a2fdb01ecbabfb581e6359e6f41a6ac4b1d403
Signed-off-by: Jean-Philippe Evrard <jean-philippe.evrard@rackspace.co.uk>
2017-01-13 14:47:00 +00:00
Jean-Philippe Evrard 0b4cdae7b8 Remove ansible<2.2 apt cache hack
Now ansible apt module correctly behaves, so it's time
to deprecate these cruft tasks for apt.

Change-Id: I315a5bdb2f92544433638165c93ec21cb7db99ae
2016-11-04 16:01:46 +00:00
Marc Gariepy 3271242b16 Yum: Add retry to comply with the until loop
Change-Id: Iaf877dba3cf143e9e41ee571a49c0127c6da0d46
2016-09-08 13:48:20 -04:00
Travis Truman d46d7eab77 Rename package lists (and related vars) appropriately
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: I625c11a3ebc4ab15d6c3db9ec5858d6a90d43c52
2016-08-26 12:06:41 -04:00
Jesse Pretorius b4430a1e5d Add ability to change apt/yum package state
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: If54f50bed876970c626e67f8501d581f68476c2f
2016-08-02 15:50:18 +01:00
Jesse Pretorius 59fe3f3ef1 Skip lint check for yum clean task
There is no yum module equivalent for this task, so to avoid the
'[ANSIBLE0006] yum used in place of yum module' error from
ansible-lint this task is omitted from the lint check.

Change-Id: I3c6035bb25a5137500fff2e2623fd243a1dcb34f
2016-07-07 11:31:36 +01:00
Travis Truman b1e2bb003d Address Ansible bare variable usage
When executing the role with Ansible 2.1, the following
deprecation warning is issued in the output for some tasks.

[DEPRECATION WARNING]: Using bare variables is deprecated.

This patch addresses the tasks to fix the behaviour appropriately.

Change-Id: I7a8bc1f847eaa894674d0c0db8a60f46ad334377
2016-06-15 15:02:07 -04:00
Jean-Philippe Evrard 12ec7106f2 Consistency for multi-os in the includes
This makes the include_vars consistent accross all the
openstack-ansible-.* repos.

Change-Id: I3d765b71b6d92be675242aea807e37bbe6365504
2016-06-02 14:22:12 +01:00
Jenkins 836a5a5401 Merge "Multi-distro support for rsyslog-server role" 2016-03-09 07:29:20 +00:00
Michael Gugino 66349a80d7 Multi-distro support for rsyslog-server role
This is an implementation of a pattern for multi-distro support by
including logic to deploy packages via either apt-get or yum.

This change has been tested with CentOS 7 and Ubuntu 14.04.  Package
names and other distro/family specific variables are supplied via one
of the files in vars/ utilizing the following precedence:

"{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
"{{ ansible_distribution | lower }}.yml"
"{{ ansible_os_family | lower }}.yml"

In this change, only the files corresponding to 'ansible_os_family'
have been provided.  The included 'families' are 'debian' and 'redhat'

This allows for support of distros other than Ubuntu and CentOS, such
as Debian and Fedora, more easily in the future.

Change-Id: I78c8c3be9d00fc505fabc83de36dfd43b8e85848
2016-03-08 13:14:17 -05:00
Jenkins f7a17059c6 Merge "Removing unneeded with_items usage for clarity" 2016-03-07 08:46:17 +00:00
Travis Truman 11b8ba5959 Removing unneeded with_items usage for clarity
Change-Id: Ic7b3924ade8c6243668730332fbcfd2f364605fa
2016-03-06 13:41:22 -05:00
Jean-Philippe Evrard 4d4b140d65 Only update apt cache if necessary
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: I00d6d0704e77bc3f8f19fb36933ac518b3372e8d
2016-02-15 14:49:43 +01:00
Kevin Carter 2b4bf4547c
first commit
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-12-09 09:27:53 -06:00