Commit Graph

65 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 3f7085e58a 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.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/896017
Change-Id: I947be8d94b3263ed69311667af693a481765b1c4
2023-10-25 10:25:16 +00:00
Dmitriy Rabotyagov 2843f27804 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: Ie43a6edc4ef44b7b92905cf9d59be53edeb1b946
Related-Bug: #2029486
2023-08-15 13:06:58 +02:00
Dmitriy Rabotyagov 1c49c7d2c8 Fix linters and metadata
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.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/888223
Change-Id: I30eff91392dcab1e76c4fee89ead7a6e03838b2d
2023-07-14 19:56:42 +02:00
Damian Dabrowski 81a0273a50 Add TLS support to sahara backends
By overriding the variable `sahara_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the sahara 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: I28e2a2ac7a2534f731f1ce8b0c76f6c55e987eb2
2023-04-29 18:43:28 +02:00
Dmitriy Rabotyagov 816e498c5c 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: I7064765e62d9e1a86fb20232429731840f697a88
2022-06-15 19:20:56 +02:00
Damian Dabrowski 4814dcb140 Database connection pooling improvements
- Implemented new variable ``connection_recycle_time`` responsible for SQLAlchemy's connection recycling
- Set new default values for db pooling variables which are inherited from the global ones.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819424
Change-Id: I1745cd91c26bb873a5eac0fa42f651d2ebe7e974
2021-12-03 11:41:39 +01:00
Dmitriy Rabotyagov c5f8778469 Refactor galera_use_ssl behaviour
With PKI role in place in most cases you don't need to explicitly
provide path to the CA file because PKI role ensures that CA is trusted
by the system overall. In the meanwhile in PyMySQL [1] you must either
provide CA file or cert/key or enable verify.

Since current behaviour is to provide path to the custom CA we expect
certificate being trusted overall. Thus we enable cert verification when
galera_use_ssl is True.

[1] 78f0cf99e5/pymysql/connections.py (L267)

Change-Id: I25b6e2afcf67f34d9b612adca6c0c6968b6308ce
2021-09-21 17:18:07 +03:00
Jonathan Rosser 21eb697dc8 Add variables for rabbitmq ssl configuration
Change-Id: I245bee42704e3d81a3f148daa983b43e9e377575
2021-05-17 11:42:20 +00:00
Jonathan Rosser b8f9f0432f Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I5f2438f064fe097b990dfdd433cc6fb84cd3b3d3
2021-03-16 08:16:22 +00:00
Jonathan Rosser 9222e100d1 Switch default virtualenv to python3
Change-Id: I12e0f84137cf7cc89e0707fcc7114fa5ce3b355a
2021-03-10 09:02:21 +00:00
Jonathan Rosser 0bf0e22652 Move sahara pip packages from constraints to requirements
This is necessary to use the new pip resolver

Change-Id: Ia8422900dd74227e32fbefd37cdf146638c063fb
2021-01-25 10:20:09 +00:00
Dmitriy Rabotyagov daef9039b1 Use global service variables
Instead of overriding each service separatelly it might make
sense for deployers to define some higher level variable that
will be used first or fallback to default variable.

Change-Id: I2b9393b388840c8903ca267b8d5e66536be8d267
2021-01-08 18:47:23 +02:00
Dmitriy Rabotyagov 0f9e762924 Reduce number of processes on small systems
Even the most modest 4C/8T system would run with the maximum 16 processes
due to the calculation being VCPU*2.

We devide amount of CPUs to number of threads for hyperthreaded CPUs

Change-Id: Ie4384375f65d6ec262a3f5b71ab7cd62ed5e210a
2020-11-30 13:59:06 +02:00
Dmitriy Rabotyagov 0dcd1ba011 Use the utility host for db setup tasks
Move it to the service setup host (defaults to utility[0]) instead
of the galera[0] host, and use galera_address (defaults to internal VIP)
as the endpoint instead of a local connection on the db host.

Change-Id: I1564252d2362dbb5858e1d0222c3b344488d389d
2020-08-20 19:38:35 +03:00
Dmitriy Rabotyagov 6767e09dbd Cleanup after repo_build and pip_install retirement
Change-Id: I9148ae927befa0512d9b9a30ff3cd290ce4acd4b
2020-05-12 23:04:52 +03:00
Guilherme Steinmüller aa4640886b 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: Icfb171b7b5bc33bd6f14378003c6fc9bb597837b
2020-03-16 14:59:51 +00:00
Dmitriy Rabotyagov ab8cf19243 Replace git.openstack.org with opendev.org
This patch replaces git.openstack.org with opendev.org as redirection
from old path was enabled.
Also we change upper constraints url due to [1]

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I4bd827021fbd565e01342845e88f7c12b6a9013e
2019-11-14 18:39:03 +02:00
Andrew Gibb ff191abc4a Add global override for service bind address
Change-Id: I630eaf3dbd84cb0106c28253be05cc01cb1559e5
2019-10-01 19:19:05 +00:00
Jonathan Rosser e0328cc68e Allow venv python interpreter to be overridden
Change-Id: I37300557a4318e7468298b5575e7dec02bae7eff
2019-09-11 21:26:28 +01:00
Dmitriy Rabotyagov dde6129387 Start using uWSGI role
Move service to use uWSGI role instead of iternal task for uwsgi
deployment. This aims to ease the maintenance of uWSGI and speedup
metal deployments as the same uwsgi environment will be used
across all services.

Change-Id: Iaca1e2f680d7281b4d8c0fd47907823a515f4240
2019-09-06 10:07:39 +03:00
Dmitriy Rabotyagov 4e78f8b6f8 Use systemd-journald instead of log files
This patch aims to migrate service from usage of regular syslog files
to journald. We also disable uwsgi logging, since it dublicates
requests that are logged by service itself.

Change-Id: I0f9eeeb5db890ba2119f7e8a5e85b9f6923092d6
2019-07-18 13:06:00 +03:00
Dmitriy Rabotyagov b9af252909 Convert systemd services to common role(s)
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: If8a201dd964ea769c688f78abc2a688782e3be4d
2019-07-18 13:04:31 +03:00
Guilherme Steinmüller cb1098d25c Update role for new source build process
The variables sahara_developer_mode and sahara_venv_download
no longer carry any meaning. This review changes sahara to do
the equivalent of what developer_mode was all the time,
meaning that it always builds the venv and never requires
the repo server, but it will use a repo server when available.

As part of this, we move the source build out of its own file
because it's now a single task to include the venv build role.
This is just to make it easier to follow the code.

Change-Id: I74f5fa25b70fbb5c514af3a72b5b6654d5c8e24d
2019-03-27 17:00:06 +00:00
Jean-Philippe Evrard 904d9217aa Make the _pip_packages understood by py_pkgs
py_pkgs is not yet deprecated, nor does it get parsable by ansible.
We need a static list instead.

This replaces the dynamic list creation with a static list.

Change-Id: Ie2238a4860a110e5fc64e2c55246535467e9077b
2019-03-19 18:37:11 +01:00
Luigi Toscano ed7ccad898 Fix deployment and tests (correct URIs, plugins)
- install also the Sahara plugins. The existing variable sahara_plugin_base
  is now used also for the list of installed plugins, in addition to
  the list of loaded plugins.
  The default set includes now all the available plugins.
- fix the URIs used by role tests. They will eventually go away
  in favor of the integrated tests, but they are needed right now.

Change-Id: I5a4066ad9e2cca7bbfeb82bca5b2e65badef2e22
2019-03-12 22:49:02 +01:00
Jesse Pretorius 5accd3d078 Enable overriding the service setup host python interpreter
In order to enable the service setup host python interpreter to
be changed easily, we make it a variable. This will be useful
when someone sets the service setup host to be the utility
container, because we'll be able to set this var by default.

Change-Id: I6ff22dd4438df02b4a485ae75e8ea895c0f8f57e
2018-11-30 16:29:12 +00:00
Luigi Toscano 98c27423a9 Deploy Sahara with unversioned endpoints
Sahara supports unversioned endpoint also for the stable API v1.1,
and this is a requirement in order to use the experimental API v2.
See https://review.openstack.org/#/c/582285/ for more details.

Following the pattern used for other services with unversioned
endpoints, the sahara_service_*uri variables are directly and all
sahara_service_*url can thus be removed.

Closes-Bug: #1782147
Change-Id: I2d4477de6a3ad58fe58152b18e18a9a6dffdafd4
2018-09-13 23:21:40 +02:00
Jesse Pretorius 284ffef2a5 Use a common python build/install role
In order to radically simplify how we prepare the service
venvs, we use a common role to do the wheel builds and the
venv preparation. This makes the process far simpler to
understand, because the role does its own building and
installing. It also reduces the code maintenance burden,
because instead of duplicating the build processes in the
repo_build role and the service role - we only have it all
done in a single place.

We also change the role venv tag var to use the integrated
build's common venv tag so that we can remove the role's
venv tag in group_vars in the integrated build. This reduces
memory consumption and also reduces the duplication.

This is by no means the final stop in the simplification
process, but it is a step forward. The will be work to follow
which:

1. Replaces 'developer mode' with an equivalent mechanism
   that uses the common role and is simpler to understand.
   We will also simplify the provisioning of pip install
   arguments when doing this.

Depends-On: https://review.openstack.org/598957
Change-Id: Ibd021f211f4608636e27283ca831aac4e3ef4efe
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-09-03 11:09:32 +00:00
Zuul 806629b39c Merge "Setup oslo.messaging extra packages for optional drivers" 2018-08-09 06:18:54 +00:00
Jesse Pretorius 51abb016b3 Default MQ RPC/Notify credentials/vhosts to match
When the RPC and Notify service are the same, the credentials
must match - otherwise the tasks to create the user/password
will overwrite with each other.

If the two clusters are different, then the matching credentials
and vhost will not be a problem. However, if the deployer really
wishes to make sure they're different, then the vars can be
overridden.

Also, to ensure that the SSL value is consistently set in the
conf file, we apply the bool filter. We also use the 'notify'
SSL setting as the messaging system for Notifications is more
likely to remain rabbitmq in our default deployment with qrouterd
becoming the default for RPC messaging.

Change-Id: I0d5285eeebe94adda39b93e61e79be5673b7347d
2018-07-30 12:56:40 +01:00
Andy Smith cb44aacbe0 Setup oslo.messaging extra packages for optional drivers
Change-Id: I5d29c1f459a62de868c8342e843025093b92f5fc
2018-07-27 14:10:33 -04:00
Jesse Pretorius 3b86334e2f Move MQ vhost/user creation into role
There is no record for why we implement the MQ vhost/user creation
outside of the role in the playbook, when we could do it inside the
role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we implement two new variables:
- sahara_oslomsg_rpc_setup_host
- sahara_oslomsg_notify_setup_host

These are used in the role to allow delegation of the MQ vhost/user
setup for each type to any host, but they default to using the first
member of the applicable oslomsg host group.

We also adjust some of the defaults to automatically inherit existing
vars set in group_vars form the integrated build so that we do not
need to do the wiring in the integrated build's group vars. We still
default them in the role too for independent role usage.

Change-Id: I72c26ad851beb5a48cd2d841dca67c547a074847
2018-07-17 22:08:56 +01:00
Jesse Pretorius 009acad1a0 Execute service setup against a delegated host using Ansible built-in modules
In order to reduce the packages required to pip install on to the hosts,
we allow the service setup to be delegated to a specific host, defaulting
to the deploy host. We also switch as many tasks as possible to using the
built-in Ansible modules which make use of the shade library.

The 'virtualenv' package is now installed appropriately by the openstack_hosts
role, so there's no need to install it any more. The 'httplib2' package is a
legacy Ansible requirement for the get_url/get_uri module which is no longer
needed. The keystone client library is not required any more now that we're
using the upstream modules. As there are no required packages left, the task
to install them is also removed.

Change-Id: Ib4ff0ca76eb7b2ccaa373eeb1812e3d6741193fc
2018-07-12 19:27:08 +01:00
Zuul 3cc1b471d7 Merge "Add trustee section by default" 2018-07-04 11:13:28 +00:00
Kevin Carter adf0c5b9ce Add packages required for osprofiler
The following packages are required in-order to run osprofiler.
these packages will provide deployers the ability to profile
a service on demand should they choose to enable the profile
functionality.

Depends-On: I3df2c670beeb78baaa1515bcd27e8f2b0d95b3a9
Change-Id: I1952353c0eea966a02e5cb20140170d671808b42
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-06-24 17:16:15 +00:00
d34dh0r53 832b8ee246 Add trustee section by default
Added [trustee] section and variables based on the changes outlined
in https://review.openstack.org/#/c/524936/13/devstack/plugin.sh

Change-Id: I3b8d7dcb57d4373c415e11266a4672c86ccb9166
Closes-Bug: #1763361
2018-06-12 11:29:16 -05:00
Zuul fff4889d90 Merge "Move database creation into role" 2018-06-04 19:49:50 +00:00
Jesse Pretorius 337371f69d Move database creation into role
There is no record for why we implement the database creation outside
of the role in the playbook, when we could do it inside the role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we implement a new variable called 'sahara_db_setup_host'
which is used in the role to allow delegation of the database setup
task to any host, but defaults to the first member of the galera_all
host group. We also document the variable sahara_galera_address which
has been used for a long time, but never documented.

Change-Id: I594ef44b2943dc9d7a45771bd1e8592595bd0efc
2018-06-01 19:03:47 +01:00
Andrew Smith 4f4ea816cf Update to use oslo.messaging service for RPC and Notify
This introduces oslo.messaging variables that define the RPC and
Notify transports for the OpenStack services. These parameters
replace the rabbitmq values and are used to generate the messaging
transport_url for the service. The association of the messaging
backend server to the oslo.messaging services will then be
transparent to the sahara service.

This patch:
* Add oslo.messaging variables for RPC and Notify to defaults
* Update transport_url generation
* Add oslo.messaging to inventory
* Add release note

Depends-On: If4326a6848d2d32af284fdbb94798eb0b03734d5
Depends-On: I2b09145b60116c029fc85477399c24f94974b61d
Change-Id: Ib4153412b91e7d11cc9acdbe5af8a1a4280b44e8
2018-05-18 18:40:33 -04:00
Zuul b9014132d5 Merge "Replace virtualenv-tools by a script" 2018-01-16 00:42:48 +00:00
Jean-Philippe Evrard e2810f4427 Replace virtualenv-tools by a script
virtualenv-tools has a bug which gets triggered in gates: it can't
change the shebang of a virtualenv python bin/ files if they
were generated with a virtualenv script whose shebang ends with
python2 instead of python.

Because we can't modify virtualenv-tools, we use shell scripts
instead.

Change-Id: I5c8b8d102829e84179f94e10a7464008ac5753c4
Partial-Bug: #1741634
2018-01-15 14:16:17 +00:00
Jimmy McCrory 3603257d29 Add MySQL connection SSL support
When 'sahara_galera_use_ssl' is True, use an encrypted connection to
the database using either a self-signed or user-provided CA certificate.

A new non-voting test has been added to verify that the role remains
functional when enabling SSL features.

Change-Id: Ie39024c99cad0932f464707adc43019bc1062317
Partial-Bug: 1667789
2017-12-14 11:31:03 -08:00
ZhongShengping 073b3b2a90 Remove use_neutron option
Nova network has been fully removed from the OpenStack codebase.
As such, all instances of switches on use_neutron should be removed,
as the functionality will never be meaningful.

Change-Id: I2eb338ba53d51c62c88bbbfd145462030596da74
Depends-On: Ib9d87dd339d637b69fb27315d92228cbc523c8eb
Closes-Bug: #1734615
2017-11-27 15:31:05 +08:00
Andy McCrae 55f437b447 Implement uWSGI for sahara-api
As part of the Pike goals we are moving api services to run as WSGI
apps. sahara-api service is set up as a wsgi app, and this patch
moves it over.

Since this is just a drop in replacement for the existing eventlet
service, operators an deployers should notice no difference.

Change-Id: Ie4826358d5ee1686ad9ea7fa9eb0441acff565f2
Implements: blueprint goal-deploy-api-in-wsgi
2017-08-11 10:27:36 +01:00
Jenkins 45b8555546 Merge "Deprecate rpc_backend option" 2017-06-08 10:06:03 +00:00
Jesse Pretorius b9a83eab58 Switch to Cryptography over pycrypto
The keystonemiddleware library recently switched to using the
cryptography library over pycrypto, which was unmaintained. See
Iced7f5115e49ccf4f7f5bf6813cb5988b95c248b

Change-Id: I8a6e828664d4c847e707c9fb5b18cfc99917b4a3
Co-Authored-By: Nolan Brubaker <nolan.brubaker@rackspace.com>
2017-06-07 17:51:29 +00:00
ZhongShengping 1713ba0004 Deprecate rpc_backend option
Option "rpc_backend" from group "DEFAULT" is deprecated for removal
(Replaced by [DEFAULT]/transport_url). Its value may be silently
ignored in the future.

Change-Id: I6ff5a9e734d5ba3de12a43e6f57d5a3ce214db5e
Implements: blueprint deprecate-rpc-backend
2017-06-01 15:42:59 +08:00
Kevin Carter 012d3f3530 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: Ic4edfa39b8ee42d0f6192b986e1c40c9c94488df
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-03-28 23:37:47 -05:00
Ravi Gummadi 29045b953f 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.

Also removed the comment related to an unused variable
sahara_engine_workers in defaults/main.yml

Change-Id: Idc39c7fc2188332fbaeb771906c0b9a402d17646
2017-03-03 06:28:50 -05:00
Flávio Ramalho 95e4f4877b Role cleanup/update for ocata
- Use dictionary for service group mappings, bringing the
  role into line with the method used in other roles;

- Use systemd module instead of shell on the services
  restart handlers;

- Use ansible package module to install distro packages;

- Added variables for CentOS. The role should now support
  CentOS;

- Removed extras folder.

Change-Id: I5c8430804aacceca01c5821ca2528514033d15f4
2017-02-14 09:35:30 -03:00