With update of ansible-lint to version >=6.0.0 a lot of new
linters were added, that enabled by default. In order to comply
with linter rules we're applying changes to the role.
With that we also update metdata to reflect current state.
Change-Id: Ib46df44ae2251932cf9169721ef463f0ec78b64e
This line snuck in with I636e89ba06e513a559a51b1086d8cb6885ecb3e4
probably to bring it in line with other OSA roles, but should already
be covered by the distribution_major_version line above.
Change-Id: I8bba19390e83fdf80255ca1fd41c1a6c9541b67f
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: I636e89ba06e513a559a51b1086d8cb6885ecb3e4
Netcat is not a direct dependancy of memcached nor the playbooks in
this role, however other OSA roles delegate tasks to the memcached
container and run shell commands which use nc.
This patch ensures that netcat is explicity installed into the
memcached container and we do not rely on it being present in the
container base image.
Given that the memcached_test_distro_packages variable is no longer
used, the associated bits for it are also removed.
Change-Id: Id046aa97ed90654f1859e584891fe5228f96aa90
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: Iaab769237a607bf003fb70eb99ade309c112d6ac
When running on bare metal, the log folders are created in advance
to /openstack/log/aio1-memcached in a /var/log/memcached link.
The task ``Create memcached log dir`` would then fail with:
``/var/log/memcached already exists as a link``,
because the folder exists, and the exit 1 after the chown
would trigger.
This replaces the code with a more idempotent code:
If a change would be detected by chown -c, it would be listed
in the stdout, while the rc would still be 0.
An error in chown would still be rc != 0.
So we can use this different state to mark the task as changed
or not, and handle the create folder case when no folder exists.
Change-Id: I904f13d2ae02cd410edc4aaeb83bedd1e14d69fb
This change cleans up the role a little bit making it more consistent.
A new configuration file has been added which will further isolate
our services using a named cgroup; this is similar to what we already do in
our openstack services. By further isolating the service from the system
we get quite a bit more control and accountability.
Change-Id: I02a84a2560853473c986ad0db26874341a23fc82
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This patch ensures that systemd will restart memcached in case of
failure or if the process is manually killed.
Closes-Bug: 1659954
Change-Id: I6782320bf429cde17dff00401e7f136cfc979cee
This patch adds the `memcached_disable_privatedevices` variable that
allows deployers to disable PrivateDevices in the systemd unit file.
This is a workaround to fix the systemd/LXC issues with bind
mounting an already bind mounted `/dev/ptmx` inside the LXC
container.
See Launchpad bug, lxc/lxc#1623, or systemd/systemd#6121 for more
details.
The is_metal variable is removed as it is unused.
Related-bug: 1697531
Change-Id: Id7c148bf901354a3dfc2f189ec659f2b92fc7985
In order to optimise the distro package installation
process the list of packages to install is prepared
for the host, then installed by passing the package
task the full list instead of using a loop.
The package lists in defaults are removed as it is
undesirable to make it easy to override these lists.
This is not provided for in any other roles.
Change-Id: I71307d2a808fdc0f76e376a84651dad86b3f8b69
In https://review.openstack.org/457391 we consolidated
the package install tasks into one set, but it's also
possible to provide the package action plugin the
parameters for the underlying module, so we do that
here to get rid of the apt cache update task.
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: If3209379c04b3bfdf3fd8af8615fc6e0036b1c52
Using ansible systemd module to daemon reload and service reload
is the solution for the future. Let's embrace it!
Change-Id: Ic8d4312c2c7fe10ef4edb5b77a2068a21d8550db
Signed-off-by: Jean-Philippe Evrard <jean-philippe.evrard@rackspace.co.uk>
We apply here our practices to have role_name-(config|install).
Change-Id: Ib17a8c0b43e844a5a50217fc3acaa606abc148ac
Signed-off-by: Jean-Philippe Evrard <jean-philippe.evrard@rackspace.co.uk>
This patch removes some extra tasks for detecting systemd and uses
the `ansible_service_mgr` fact instead.
Partial-Bug: #1640125
Change-Id: I82e3284b1d46d32ec28502ac4fe1a322316ca019
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: Ide7992e9f83f5462c92f1b15d53a5eed2e9d8e95
Related-Bug: https://github.com/ansible/ansible/issues/17687
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: Ib3d6dea38bf4d570e6b9501f9cb89632639d586e
This change implements the log directory link checking. This will ensure
the role is able to handle instances where memcached is deployed outside
of a container using the "is_metal: true" property from OSA.
Change-Id: Ia5e38dd1fda9f7fa5876e0a2824c88d0fa3d2b8d
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
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: Ieaa9fa9c6e0d0790b79d5d9d50fbe693a6091d2d
The numerous tags within the role have been condensed
to two tags: memcached-install and memcached-config
These tags have been chosen as they are namespaced
and cover the two major functions of the role.
Change-Id: Iabb2ae9bd314625e76c76aa1155a7918745fcc50
ansible-lint 2.7.0 was recently released, update the role's test
requirements to use it.
The tox test has been changed to run ansible-lint against this role,
rather than the test playbook which would only apply to this role's
dependencies.
Also include a skip tag for the 'yum clean all' task since the yum
module currently does not have a way of executing this action.
Change-Id: Ie7c8a2c1635ba64ca64e71a6d80dc6545f86f4e5
This commit updates the memcached_server role to work on Trusty,
Xenial, and CentOS 7.
NOTES:
1. This role no longer creates the memcache user since both Ubuntu and
CentOS already install a suitable user
2. We have temporarily disabled testing of the log file since CentOS and
Xenial do not log to file
3. On Ubuntu we drop ulimits into /etc/defaults/memcached, we need to
figure out how to do the equivalent on CentOS
4. We update tasks/memcached_config.yml to use the correct memcached
user in limits.conf, however neither these limits or the ones in
templates/memcached.debian.j2 actually seem to be taking effect.
More work in an additional review will need to be done to clean this
all up.
Implements: blueprint multi-platform-host
Change-Id: I4c32f3d60939615c5d0c6fb202e96aacb35ab9b4
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This fix adds a new override `memcached_connections` which is
automatically calculated from the number of memcached
connection limit plus additional 1k to configure the OS nofile limit.
Without proper nofile limit configuration, memcached will crash
in order to support higher parallel connection TCP/Memcache counts.
Closes-Bug: #1582288
Change-Id: I558ba329b7247cdfcf660e392c3ae0c4a0d65a53
- Moved to the right folder to get it accessed on bare metal
when containerized
- Making it work for rsyslog and logrotation's existing
roles
- Changed the gate tests to reflect path change
Closes-Bug: #1569171
Change-Id: I3a1c2f50ab63b55b39318ba40c0921f6b738cafb
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: I900ea91ca60973fc72910d649ec1f994373fbe5f