Commit Graph

80 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov c6b7df85a8 Add quorum 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.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/896017
Change-Id: I02d380104ffc9507fdbf660db2627b0b1930f9ec
2023-10-20 11:54:38 +00:00
Dmitriy Rabotyagov bf019ab6d7 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
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/888517
Change-Id: I53c0166beb446802641c701f6e43d5e317f9d54a
2023-08-23 09:31:20 +02:00
Dmitriy Rabotyagov f39015d801 Use proper galera port in configuration
While <service>_galera_port is defined and used for db_setup
role, it's not in fact used in a connection string for oslo.db.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/888517
Change-Id: I6299827be3828931f9c796edb655aae8f1fcff23
2023-08-16 13:34:01 +00:00
Damian Dabrowski 4b2134df19 Add TLS support to aodh backends
By overriding the variable `aodh_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the aodh 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: Ibb4d7b465f07fff6c172b38aa647fd8d6a4fcd43
2023-04-29 18:35:33 +02:00
Dmitriy Rabotyagov 3e94523ec7 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-os_gnocchi/+/846347
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/845690
Change-Id: I883d84859811714362c5b58f33dfae808317bfdc
2022-06-17 13:40:57 +00:00
Dmitriy Rabotyagov 426737ba6a Use openstack uri proto
Align aodh role with others and use
openstack_service_<type>uri_proto variables as default ones
to define protocol being used for endpoints.

Change-Id: Idbc68f7496fd57f98fc77b9d0e345e576b51d108
2022-03-23 11:51:23 +01:00
Damian Dabrowski b6307058ec 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: Id7b0c26409a0d1b33a679201655a4dd08bacc57a
2021-12-03 11:50:01 +01:00
Dmitriy Rabotyagov bc541db1a2 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: Ie02010583c9c9fc82211065cedac4fc120a31318
2021-09-17 13:57:47 +00:00
Jonathan Rosser 9337c335c0 Add variables for rabbitmq ssl configuration
Change-Id: I88124396aba6d2b2432df7ca5c1a6e2d187b0fbd
2021-05-17 07:54:33 +00:00
Zuul 3b304fbbf6 Merge "Use ansible_facts[] instead of fact variables" 2021-03-17 14:58:43 +00:00
Jonathan Rosser 37efa0a469 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I83375d4d96fee13c21dc133dbf5a5b8ed64b826a
2021-03-16 07:58:51 +00:00
Jonathan Rosser 19eac02395 Switch default virtualenv to python3
Depends-On: Ia88b8e606a19ad8ee20665e125df1079b0a771ff
Change-Id: Ic2aab8aa458077d9bc778de3affb18b6d192d2bd
2021-03-11 14:37:09 +00:00
Jonathan Rosser 405f551fad Move aodh pip packages from constraints to requirements
Change-Id: I73773536938dff9f768381a333c5fa02c98e9d55
2021-01-25 08:44:38 +00:00
Dmitriy Rabotyagov d6d0cd22ed 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: I74376cc3c20df54663ffbec5daa7413853391714
2021-01-05 17:58:25 +02:00
Zuul 13ef8fa191 Merge "Remove duplicated aodh_db_setup_host" 2020-11-17 12:38:13 +00:00
Dmitriy Rabotyagov ac880a2802 Remove duplicated aodh_db_setup_host
Change-Id: I6d7b5404eb5b706683b1b15575cc880a2cd45571
2020-11-10 12:09:06 +00:00
Dmitriy Rabotyagov cbe63486b2 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: Iab8ed570cb6f60afc09f4ae47b97c49c8e61072d
2020-10-27 16:55:38 +02:00
Jonathan Rosser d4e570e47b 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: I1171b6a45563e4eccf45e8840e5dd332001ff3b7
2020-09-28 17:15:33 +01:00
Dmitriy Rabotyagov 5785c68353 Cleanup after repo_build and pip_install retirement
Change-Id: I95cc52ca207ce096eb378a315e8b243fdb18d266
2020-05-12 20:51:35 +03:00
Dmitriy Rabotyagov cf5a896fa7 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: I2d0b500f002e457abcb1d5fe96bf554f96e5700e
2020-03-25 18:38:09 +02:00
Dmitriy Rabotyagov 1c9494f4da 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

Depends-On: https://review.opendev.org/693841/
Change-Id: Ic79c4e090a841de042a3b7ce4b03681d6de9c6a5
2019-11-14 16:21:18 +00:00
Jonathan Rosser 446c275510 Add global override for service bind address
Change-Id: I942b765633293588aad2a13f8d44ae396e0be20e
2019-09-18 12:19:37 +01:00
Jonathan Rosser 6fca9b86cb Allow venv python interpreter to be overridden
Change-Id: Ia5e78895c6bde67d680019055cfa8f96d38a26ee
2019-09-11 09:51:13 +01:00
Dmitriy Rabotyagov 91b2196646 Migrate aodh to use uWSGI role
This patch moves aodh-api from usage of apache with mod_wsgi
to uWSGI role, which means unification across another roles and
reduced maintenance costs

During migration period tasks that ensures apache won't listen
on panko_service_port are present, but they are supposed to be removed
after train release.

Depends-On: https://review.opendev.org/678025/
Change-Id: I9377d46b4b79f79dbf448b23c67ff21b80714b6c
2019-09-04 15:36:21 +03:00
Mohammed Naser fa5c2dad78 Update role for new source build process
The variables aodh_developer_mode and aodh_venv_download
no longer carry any meaning. This review changes glance 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: I04e119c1404d8681ef7e5d964c95fbeb8970756b
2019-03-27 13:29:39 +00:00
Jesse Pretorius c21c3ca0ef 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.

Depends-On: https://review.openstack.org/632125
Change-Id: I8ab51d6035d06fea1ee1d7d6427be03115f41924
2019-01-21 16:17:43 +00:00
Jesse Pretorius d460cf1e36 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.
2. Simplifies the installation of optional pip packages.
   Right now it's more complicated than it needs to be due
   to us needing to keep the py_pkgs plugin working in the
   integrated build.
3. Deduplicates the distro package installs. Right now the
   role installs the distro packages twice - just before
   building the venv, and during the python_venv_build role
   execution.

Depends-On: https://review.openstack.org/598957
Change-Id: I4cee1b0b7d5bc3fa53052dabe66e6acdb69afd18
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-09-03 11:06:17 +00:00
Zuul 1f7b3491e5 Merge "Setup oslo.messaging extra packages for optional drivers" 2018-08-09 06:23:28 +00:00
Kevin Carter a99723f335
Add systemd journal logging to the service config
The systemd journal would normally be populated with the standard out of
a service however with the use of uwsgi this is not actually happening
resulting in us only capturing the logs from the uwsgi process instead
of the service itself. This change implements journal logging in the
service config, which is part of OSLO logging.

OSLO logging docs found here: <https://docs.openstack.org/oslo.log/3.28.1/journal.html>

Change-Id: I7bd5419e7f02593a16614746a974b5f8ab3aa504
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-07-31 14:44:42 -05:00
Zuul ad394265bc Merge "Execute service setup against a delegated host using Ansible built-in modules" 2018-07-31 19:02:31 +00:00
Jesse Pretorius 30ec2a87f6 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: Ia05fc004e11eada426bc81c45bbc3732b9126bbe
2018-07-31 12:53:51 +01:00
Jesse Pretorius 4b41de0570 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: I1d56fc82eebfb2d2ed421fd1c589e1b912328c08
2018-07-30 12:30:12 +01:00
Andy Smith 8cfc5c793b Setup oslo.messaging extra packages for optional drivers
Change-Id: I8db47c19bc33f575b82de025c9e9c1e6ce82a3df
2018-07-27 12:15:21 -04:00
Jesse Pretorius 42087a12b0 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:
- aodh_oslomsg_rpc_setup_host
- aodh_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: I9f0daa3c112cc34393357a30551bac71456089ef
2018-07-17 21:55:57 +01:00
Zuul 62e58e6f68 Merge "Move database creation into role" 2018-06-28 11:26:45 +00:00
Zuul 184e463641 Merge "Add packages required for osprofiler" 2018-06-26 04:17:54 +00:00
Kevin Carter d5c832c1f9 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: I7ac123678d7fcaf2c4f82ffdc1f3cad3ecfc7281
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-06-24 17:15:57 +00:00
Jesse Pretorius 08b19e3b97 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 'aodh_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.

Change-Id: I5e6a2857d14f957ef9167f90d4b2d3a4fec321dc
2018-06-12 19:25:34 +01:00
Andrew Smith 1f4a1e71a1 Update to use oslo.messaging services 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 aodh service.

This patch:
* Add oslo.messaging variables for RPC and Notify to defaults
* Update transport_url generation (add for notifications)
* Add oslo.messaging to tests inventory
* Update tests
* Add release note
* Update README and example

Depends-On: If4326a6848d2d32af284fdbb94798eb0b03734d5
Depends-On: I2b09145b60116c029fc85477399c24f94974b61d
Change-Id: I356e7256f5e8090f35dce8a02fd633638fd659fa
2018-06-04 14:26:05 -04:00
Markos Chandras 7070497565 Add support for using distribution packages for OpenStack services
Distributions provide packages for the OpenStack services so we add
support for using these instead of the pip ones.

Change-Id: If6daa1bb784df46e83bbc118981240eb59a1409d
Implements: blueprint openstack-distribution-packages
2018-05-15 08:28:18 +01:00
Kevin Carter b44d7ba5bf 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.

Change-Id: I47287ce0deb45538894bd99e57c291c3ae7fa084
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-03-29 10:33:40 +00:00
Jean-Philippe Evrard 01597f254c 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: If934acbcfe81578366d1ecc0c5fec7c6de5b2040
Partial-Bug: #1741634
2018-02-09 16:43:43 +00:00
Jimmy McCrory 9f8713e5c0 Add MySQL connection SSL support
When 'aodh_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: I24f06aeacd92d6eead4100009301e0fb975bc552
Partial-Bug: 1667789
2017-12-14 11:52:35 -08:00
Jesse Pretorius 50dfb48dd7 Switch to Cryptography over pycrypto
The keystonemiddleware library recently switched to using the
cryptography library over pycrypto, which was unmaintained. See
Iced7f5115e49ccf4f7f5bf6813cb5988b95c248b

Change-Id: I6c811ff6f0647d4c6561b5b698490bd9100de93c
Co-Authored-By: Nolan Brubaker <nolan.brubaker@rackspace.com>
2017-06-07 17:48:10 +00:00
alextricity25 109ad46201 Update sqlalchemy constraints to match upstream
The sqlalchemy upper constraint has recently been removed in
https://review.openstack.org/#/c/460256/4. This commit changes
the constraint in the role default to match the change.

Closes-Bug: #1686483
Change-Id: I22228de6e29c3cf6ad3afa459ae29d3f76c00a28
2017-05-01 14:53:44 +00:00
Miguel Alex Cantu 45087bb7a6 Enumerate aodh[mysql] extra deps and constraints
This is so the repo-build role respects the constraints specified
for extra dependencies in the setup.cfg file.

Change-Id: I2774681cc626f94e6de6b3617e6b92a78edaea33
Closes-Bug:#1682214
2017-04-20 13:53:50 -05:00
Kevin Carter 9dcacb8fd6 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: I2b5c6189a6eabbdb7854dcee97edf47ef03f8757
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-03-28 23:41:28 -05:00
ZhongShengping 393cfa9ad5 Deprecate auth_plugin option
Option "auth_plugin" is deprecated, use option "auth_type" instead.

Change-Id: I064af1954ec621cfa3103ce7d7692860c08fdb42
Implements: blueprint deprecate-auth-plugin
2017-03-22 10:54:10 +08:00
Ravi Gummadi 5d40a063e2 Cap the number of worker processes
Users can configure the number of worker processes. However when it's
not specified the calculated number of workers can get too large on
hosts with a large number of CPUs.

Change-Id: Ieb6202e92ce1dcb6f94affd550bd6ce2065ef4bc
2017-03-02 08:17:10 -05:00
Logan V 8da3c30111 Clean up developer mode logic
Fixes the ability to deploy a venv in cases where:
1) developer_mode is not enabled
2) A cached venv is not downloaded from the repo server

Additional cleanup to the developer_mode venv deployment
logic is implemented by adding a *_venv_download var
which is used to decouple developer_mode from the
cached venv extraction process so that a deployer
can force venv builds in-place (disable cached
venv usage) without enabling developer mode
constraints.

Change-Id: I7ac0d8e732f0e97bf667e4428238acc2dc8bee0b
2017-01-13 19:52:41 -06:00