Commit Graph

128 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 0ba35bf841 Add quorum queues support for service
This change implements and enables by default quorum support
for rabbitmq as well as providing default variables to globally tune
it's behaviour.

In order to ensure upgrade path and ability to switch back to HA queues
we change vhost names with removing leading `/`, as enabling quorum
requires to remove exchange which is tricky thing to do with running
services.

Change-Id: Id5f6cabed7ec035845865d6d5facc63590c56d43
2023-11-13 12:11:44 +00:00
Dmitriy Rabotyagov 1d0bba49a7 Stop reffering _member_ role
Keystone has stopped providing or reffering `_member_` role for a while,
thus role should not be refferenced anymore.

Moreover, with 2023.1 service policies have dropped `_member_`
which resulted in the role to be insufficient for basic operations.

Change-Id: I4d6eacae2041b0a00114dda4e8315d4ec6295319
Related-Bug: #2029486
2023-08-15 13:10:38 +02:00
Damian Dabrowski 96a262b26b Add TLS support to swift backends
By overriding the variable `swift_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the swift backend api.

The ansible-role-pki is used to generate the required TLS
certificates if this functionality is enabled.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/879085
Change-Id: Idb7882775a90ada9bb9e1450168916c73bf8ae4b
2023-04-29 18:43:51 +02:00
Andrej Babolcai 89a6bb0718 Add support for running object-servers Per Disk
Adds support for configuring different storage port per disk
in the storage policy ring. This Swift feature is described
here https://docs.openstack.org/swift/latest/deployment_guide.html#running-object-servers-per-disk

Signed-off-by: Andrej Babolcai <andrej.babolcai@gmail.com>
Change-Id: I254e35a67195817c237dba00bec6338d3fffa985
2022-11-16 09:34:48 +01:00
Dmitriy Rabotyagov 5139ecc233 Support service tokens
Implement support for service_tokens. For that we convert
role_name to be a list along with renaming corresponding variable.

Additionally service_type is defined now for keystone_authtoken which
enables to validate tokens with restricted access rules

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/845690
Change-Id: If34e0170ea0e0f7727cfadba982f3c7dae6ae216
2022-06-15 19:52:02 +02:00
Dmitriy Rabotyagov 451678a6fd Refactor definition of lock path
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819300
Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/819298
Change-Id: I6ce09e0e0b83e14fc9386fc4cb49921a21fcabd4
2021-11-30 12:42:47 +02:00
Zuul 2ec9981fb2 Merge "Add variables for rabbitmq ssl configuration" 2021-05-18 14:15:13 +00:00
Jonathan Rosser acdaeda64b Add variables for rabbitmq ssl configuration
Change-Id: I0a1104f8312b16f618bdd8bf6b440730213c5fad
2021-05-17 12:10:40 +00:00
Dmitriy Rabotyagov 2ce00d6c69 Do not collect gnocchi project ID
Ceilometer middleware now accepts also project names,
so it's not required to gain project UUID [1].

We also switching gnocchi project name to `service` for all scenarios
as it's already whitelisted by default [2]

[1] e2bf485044
[2] 082dabb1b7/ceilometermiddleware/swift.py (L158)

Closes-Bug: #1879192
Change-Id: I40d3178d1b3bd1234ac34c6fa1d0d2bcb7160720
2021-05-13 14:39:43 +00:00
Dmitriy Rabotyagov 24bbb72ac9 Revert "split templates to work around configparser bug"
This reverts commit 3e151d97ad.

Reason for revert: Upstream bug has been fixed

Change-Id: I5498030487677523ae71ae2f9a13074ab4552204
Related-Bug: #1872553
Closes-Bug: #1921354
2021-03-25 10:16:08 +00:00
Jonathan Rosser 440a53a4e6 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: Ia3c80d5c0e63ee9c38868c41c9235c51a2498971
2021-03-16 08:20:27 +00:00
Hervé Beraud 0126d029c2 Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: Ic435def472b13d5c89645c2bb083702cb251d132
2020-12-02 12:58:30 +00:00
Dmitriy Rabotyagov 1d57000f24 Add global override for service bind address
Change-Id: Id04786c64e6dcc955e086a26f0abe38e2437d23f
2020-10-21 10:30:11 +03:00
Matthew Thode 3e151d97ad
split templates to work around configparser bug
Move the percent character to the template from the string to allow
setting either % or %% as needed to work around the bug linked below.
This requires each service 'family' to have two versions of it's config
file.

Bug: https://bugs.launchpad.net/swift/+bug/1872553

Change-Id: I68f276224c51d5682d77123eae697767fadf9b19
Signed-off-by: Matthew Thode <mthode@mthode.org>
2020-04-16 13:49:01 -05:00
James Denton 91f26a98cf Revert deleted config section in Swift config files
A recent commit [1] removed config sections related to logging that
causes various Swift services to fail to start. This patch reverts the
respective config sections. These may be removed at a later date.

[1] https://review.opendev.org/#/c/671711/

Change-Id: Ie73811e36f1ea35f060cb5af4e1275e7e69d4179
2020-04-14 18:13:36 +00:00
Guilherme Steinmüller 677ab44170 Refactor memcached_servers
This patch aims to add a prefix for memcached_server
on each role to give the ability for deployers to
override the location of memcached cluster. I.e users
wants to create a single memcached cluster with k8s
for each service.

We also add pymemcache based on [1]

[1] https://review.opendev.org/711429

Change-Id: If17dd627708f03824939ba062b498675253b11d7
2020-03-16 15:05:19 +00:00
Dmitriy Rabotyagov 1993c6e4a7 Use py2 shebang for centos distro installs
Since CentOS 7 do not have packaged swift library for py3, py2 shebang
should be used in python script so that they could import libraries

Change-Id: If42feb0bb3ed0de211e5fba65c59d9ef50d199ce
2020-02-11 11:30:06 +00:00
Dmitriy Rabotyagov d276dbb7a9 Install python3 packages for ubuntu
Change-Id: Ie7ec148ca56ea5cf8d53cd237c50f2e76b994657
2019-12-04 20:22:24 +02:00
Jonathan Rosser eabd0f8219 Update swift_rings_check script for python3
Change-Id: Ie23bef5d8335e2ada9e5c539619b8d2de301f272
2019-09-11 08:43:26 +01:00
Dmitriy Rabotyagov d0fac1b559 Use systemd-journald instead of log files
This patch aims to migrate service from usage of regular syslog files
to journald.
By this we mean dropping rsyslog client installation. log_address is set
by default to /dev/log, which is served by journald.

Change-Id: I6dd0d77004394bb1ad674b53538b0679b056bb0f
2019-07-19 15:10:49 +03:00
Mohammed Naser 4de1219730 swift3: remove support
The swift3 middleware has been deprecated in replacement with the
s3api middleware instead.  This removes all the swift3 references
to hopefully enable someone to cleanly add s3api eventually.

Change-Id: I3a8a1ab861ec81b1f4f8dbc02a6a332d4ce495b8
2019-03-29 09:41:50 -04:00
Zuul b216283ed0 Merge "Update auth_uri option to www_authenticate_uri" 2018-09-08 21:39:31 +00:00
Zuul 6061ad9d9b Merge "Replace swiftoperator role with swift_operator_role variable" 2018-07-02 15:22:11 +00:00
Corey Wright 6654e4835d Replace swiftoperator role with swift_operator_role variable
Though a `swift_operator_role` variable exists to allow specifying an
operator role other than `swiftoperator`, it is not applied to all
uses of the role, eg the proxy-server.conf template.

Replace all remaining hard-coded references to the `swiftoperator`
role with the `swift_operator_role` variable.

Change-Id: Ie6db872cc2b7a1b1a90d9a690ee08937a9cab785
Signed-off-by: Corey Wright <corey.wright@rackspace.com>
2018-06-21 19:44:45 -05:00
Andrew Smith 91af246bdf Update to use oslo.messaging service for Notify
This introduces oslo.messaging variables that define the Notify transport
in place of the rabbitmq values.

This patch:
* Add oslo.messaging variable for Notify to defaults
* Update url generation
* Add oslo.messaging to inventory
* Add release note

Change-Id: I1c2e844c4c7a2256087bcc4521f970ca8e8c6b16
2018-06-11 16:45:16 -04:00
Kevin Carter 8f1cb4dde5 Convert role to use a common systemd service role
This removes the systemd service templates and tasks from this role and
leverages a common systemd service role instead. This change removes a
lot of code duplication across all roles all without sacrificing features
or functionality. The intention of this change is to ensure uniformity and
reduce the maintenance burden on the community when sweeping changes are
needed. The exterior role is built to be OSA compatible and may be pulled
into tree should we deem it necessary.

Change-Id: Icb7ca523cb19c560de5c84b0d60a06305029192c
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-04-22 14:00:27 +00:00
melissaml 407e2cc5ed Update auth_uri option to www_authenticate_uri
Option auth_uri from group keystone_authtoken is deprecated[1].
Use option www_authenticate_uri from group keystone_authtoken.

[1]https://review.openstack.org/#/c/508522/

Change-Id: I7897412e22d91c6ab786652ff95ca44f7d10dedc
2018-04-17 04:58:02 +08:00
Andy McCrae d860153400 Use a list instead of a dict for filtered_services
Swift should mirror other roles and use a list instead of a dictionary
for it's filtered_services.

This patch makes that change.

Change-Id: Ie6bf282a36ed63d73996447a88c3c5f6056465a7
2017-07-31 17:24:34 +01:00
Charles Farquhar 14c57dd419 Add support for swift3 middleware
This commit adds support for the swift3 middware, which allows S3-compatible
clients to use swift for object storage.

Change-Id: I56cd63057cc771310b69c311d975e06f73c773f7
Related-Bug: 1625053
2017-06-23 18:26:46 +00:00
Jesse Pretorius 22a4a72afb Reduce init restart/kill times
The systemd unit 'TimeoutSec' value which controls the time
between sending a SIGTERM signal and a SIGKILL signal when
stopping or restarting the service has been reduced from 300
seconds to 120 seconds. This provides 2 minutes for long-lived
sessions to drain while preventing new ones from starting
before a restart or a stop.

The 'RestartSec' value which controls the time between the
service stop and start when restarting has been reduced from
150 seconds to 2 seconds to make the restart happen faster.

These values can be adjusted by using the *_init_config_overrides
variables which use the config_template task to change template
defaults.

Change-Id: I048b877e859ad744dc54f19a93afdd89f8ef1661
2017-04-26 17:04:04 +00:00
Jenkins 6a1669fb3d Merge "Deprecate auth_plugin option" 2017-04-06 15:58:13 +00:00
Andy McCrae 78b4f6aac6 Update container-sync to use internal client
This is to match the way this is configured in upstream Swift.

Change-Id: Ifbfd4158e04f38bf3383a7c2461374a21088fdd3
2017-04-04 15:04:19 +00:00
Kevin Carter 867f3157e9 Ensure the components are isolated from the system
This creates a specific slice which all OpenStack services will operate
from. By creating an independent slice these components will be governed
away from the system slice allowing us to better optimise resource
consumption.

See the following for more information on slices:

* https://www.freedesktop.org/software/systemd/man/systemd.slice.html

See for following for more information on resource controls:

* https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html

Tools like ``systemd-cgtop`` and ``systemd-cgls`` will now give us
insight into specific processes, process groups, and resouce consumption
in ways that we've not had access to before. To enable some of this reporting
the accounting options have been added to the [Service] section of the unit
file.

Change-Id: Ibcb7d2a69ed67a99c88dc143c76aa8448d31cc9e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-03-30 15:16:03 +00:00
ZhongShengping 7ca4b62eb5 Deprecate auth_plugin option
Option "auth_plugin" is deprecated, use option "auth_type" instead.

Change-Id: I6ac382f3856b754291378cde335bc71cd2161023
Implements: blueprint deprecate-auth-plugin
2017-03-25 12:26:23 +08:00
Andy McCrae 57de3c8817 Check if changes have made before attempting a rebalance
Utilize the "ringbuilder.devs_changed" option to ensure that the ring
needs a rebalance. This will prevent unnecessary rebalances that cause
failures due to "min_part_hours" not being passed even though no changes
were required.

Additionally, we can now return a correct Ansible repsonse when the ring
has changed/rebalanced - and return "OK" when it hasn't returned at all.

Change-Id: I1fb4b3544a50ab5f566b3846d616107a84ff29c9
2017-03-20 13:03:32 +00:00
Jenkins 0dad1e4fbd Merge "Cap the number of worker threads" 2017-03-10 14:16:03 +00:00
Ravi Gummadi bb9e3f5828 Cap the number of worker threads
Users can configure the number of worker threads. However when it's
not specified the calculated number of workers can get too large on
hosts with a large number of CPUs. Capping only swift proxy server
worker threads when the proxy is in a container. Not capping the
remaining swift services' workers because of the performance impact
it may cause because of the capping.

Change-Id: I12d930552558144ab49fecc0b3776747c1f02166
2017-03-06 06:39:01 -05:00
Matthew Oliver 3c09d9bfd5 Rework swift_rings.py to use the RingBuilder class
The old version of this scipt used to interface to the
ringbuilder cli interface. This meant we did some crazy
threading. That was complicated.

This patch changes that to use the RingBuilder and RingData
classes, which makes things much simpler, and we can remove
all the threading stuff.

Change-Id: I94004db3b2b772644d89e20c1201d7f403f3eb86
2017-02-28 14:36:46 +00:00
Jenkins 56190b63f5 Merge "Make swift_rings threading react to bad return codes" 2017-02-17 14:43:45 +00:00
Andy McCrae 352969e2d1 Move away from include statsd.j2
The statsd.j2 include approach is great, but it is hitting an ansible
bug with Jinja2==2.9.5 which hasn't been fixed with Ansible and doens't
seem to be fixed anytime soon.

Here is an example bug:
https://github.com/ansible/ansible/issues/20494

This patch also refactors the statsd.j2 import parts, a lot of
if/else statements were not required.

Change-Id: Ib78ac0a8891874b1c2e777fac8f3fb89304e6872
2017-02-13 15:39:17 +00:00
Matthew Oliver 0dd92296cd Make swift_rings threading react to bad return codes
The swift_rings.py script creates a thread and calls out to
swift's ringbuilder cli interface. It wasn't failing if
ringbuilder failed.

This change changes the threading to capture the threads exit
code and sys.exit on a bad one.

Change-Id: Ic2199ccc393b25a60af82af3aa638f21f19a6418
2017-02-10 15:00:34 +11:00
Kevin Carter 195621208a Converted the limits config to use systemd
The old limits config was still running on the upstart setup. While the
directories within the ubuntu exist they are ignored in Ubuntu 16.04 and
CentOS 7. This change removes the old upstart config and adds the
required systemd config.

Change-Id: Ic75d6cfe32678f4205d6f8ea991f393526d0a082
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-01-30 18:56:52 +00:00
Jenkins a0d6cdea8a Merge "Remove Trusty support from os_swift role" 2016-12-09 11:25:21 +00:00
Andy McCrae 26bd8127b6 Remove Trusty support from os_swift role
As a part of removing Trusty from OpenStack-Ansible we shall aim to
remove this from all the roles.

Testing has already been removed for Trusty in the integrated build and
all individual repositories on master (Ocata), as such we can now go
ahead and remove the support within the roles.

Change-Id: I89ba35fd15703aba2a05d11d4550690704bdf272
Implements: blueprint trusty-removal
2016-12-08 11:50:58 +00:00
Andy McCrae db66b43dd2 Set copy as a middleware for Swift
This patch adds copy as a middleware for swift, this follows upstream's
approach and reduces errors that indicate it is being automatically
included in the pipeline.

Change-Id: I4591ff3f3464d8bfa4ffd012f117aba881b02b65
2016-12-07 14:29:52 +00:00
Jenkins 8238849e41 Merge "Allow X-History-Location versioned_writes" 2016-12-03 03:14:48 +00:00
Andy McCrae 3fb6784459 Attempt to fix swift_pypy memory issues
Move to use tempauth to resolve memory issues resulting from an AIO
swift install running in pypy.

This PR adds some options for using pypy:
* Set a pypy Garbage collection value

This PR includes some tempauth fixes to make it useable:
* Set the tempauth users based on a variable

Testing is changed as follows for pypy:
* Use only memcache within swift-proxy
* Remove galera/keystone
* Add swap for swift-storage hosts
* Use tempauth for pypy
* Reduce to 2 swift hosts

Change-Id: Ic1ed5acc9b20853d9a159035226f97fda088f035
2016-12-01 11:07:10 +00:00
Andy McCrae de7ab0a800 Allow X-History-Location versioned_writes
Versioned Objects in Swift now use a middleware that is added to the
pipeline instead of the "allow_versions" in the container config. These
have 2 different Headers, so to prevent "X-Versions-Location" from not
working the "allow_versions" in the container config is left in place.

This patch adds the middleware by default and sets the Versioned Objects
support to be on. This is the upstream default and the deployer would
still need to set the "X-History-Location" header on a container to
utilise the feature.

Change-Id: I88811fd77fad8d2241448ca5ffb565fa7d704a00
2016-11-30 11:18:45 +00:00
Pedro Perez 3e90d83252 Fix hardcorded drive-audit path
Change-Id: I447e48ec704c4a3a0bfe1dc1cee46f0b0daf539e
2016-11-15 19:23:21 +01:00
Jenkins bb9c63bdc2 Merge "Set rsync to not perform reverse lookups" 2016-11-09 14:03:40 +00:00