Commit Graph

45 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 fd7f9932b1 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.

Change-Id: I41c2c8a50ff119cad4b8c1fe1e38096cc97f8c12
2023-08-17 14:59:00 +00: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
Zuul 3307ddc57c Merge "Add variables for rabbitmq ssl configuration" 2021-05-18 14:22:01 +00:00
Jonathan Rosser 21eb697dc8 Add variables for rabbitmq ssl configuration
Change-Id: I245bee42704e3d81a3f148daa983b43e9e377575
2021-05-17 11:42:20 +00:00
Dmitriy Rabotyagov 63c3e47a57 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to replace policy.json to
policy.yaml and remove deprecated policy.json.

config_template has been choosen instead of the copy, since it can
properly handle content that has been lookuped.

We make a separate task not to restart service when it's not needed.

[1] https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Depends-On: https://review.opendev.org/c/openstack/sahara/+/768521
Change-Id: I606e1dda74f630242905fdf74ee19eaf66030edf
2021-04-06 13:00:17 +00: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 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
Kevin Carter f7bb0d11b1 Correct notification driver
The notification driver setup was resulting in the driver and connection string
on the same line. This is caused by the case statement and how jinja formats
the template when a case statement is present. This change modifies how the
driver string is created using a ternary, which will eliminate the case
statement and render the value of the diver correctly.

Change-Id: I3ca44a9d70eadeb1a82d5f8aa35ec417de5503d5
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2019-02-07 22:38:25 +00:00
ZhijunWei 7f595f01b1 Update messaging notification configuration
This patch removes the conditional inclusion of the notification
section of the service configuration. This ensures that oslo.messaging
notifications use the correct transport for deployments that have
separate rpc and notify messaging backends. For example, if the
transport_url is not provided in the notification section of the
service configuration, the transport_url specified in the default
section will be used instead.

This patch conditionally selects the notifier driver. The noop
driver will be selected when notification publishing is disabled.
The messagingv2 driver is selected when notification publishing is
enabled.

Change-Id: Ib68aa2669b5d70626ed2777d5601d8914207451d
Closes-Bug: #1794320
2018-09-27 02:03:41 +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
Andrew Smith e7c8348f4b Restore rabbit driver ssl config option
The driver option is necessary as the transport_url query param
override requires the value. Default will be to use the oslomsg
rpc setting.

Change-Id: I084a297e9d6e72d47731e18a06539fc00576b143
2018-06-04 12:36:36 -04: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
ZhongShengping ef3cf6231a Deprecate auth_uri option
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: Id885b50194f386bc2480b9af89c747476ed8cbe1
Implements: blueprint deprecate-auth-uri-option
2018-04-03 14:16:53 +08:00
Major Hayden a73c81c936
Skip logging for haproxy health checks
The health check requests from haproxy cause uwsgi to write a
lot of useless log lines. This can make it more difficult to find
a problem with a particular service.

This patch adds a route to look for the `osa-haproxy-healthcheck`
user agent string, which haproxy uses when performing health checks.
Any requests with that user agent are not logged.

Closes-Bug: 1742718
Change-Id: I92658731ce93e4d2dbcadb53e80a08f19fe928fe
2018-02-23 08:46:42 -06:00
Jean-Philippe Evrard 60fb12813b Update paste, policy and rootwrap configurations 2018-01-30
Change-Id: I11bf59b4ff6df75b24285cac86bcb7e90838063e
2018-01-30 08:19:34 +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
ZhongShengping 8dbba48370 Fix ssl
The value of ssl is {{ sahara_rabbitmq_use_ssl }}, so fix it.

Change-Id: I4af56b75da63375671c88ba8e31eeda7c743e40a
2017-09-18 10:58:57 +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
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
ZhongShengping 19f8664692 Deprecate rabbit_use_ssl option
Option "rabbit_use_ssl" from group "oslo_messaging_rabbit" is deprecated.
Use option "ssl" from group "oslo_messaging_rabbit".

Change-Id: I96907217ba041f28cd1f0df299aa9dbdd6049c8e
Implements: blueprint deprecate-rabbit-use-ssl
2017-05-23 10:36:17 +08:00
Jesse Pretorius 8cb9fa1a9c 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: I4c7aa684ab38a49b66e9c1dfd9cbbccceef03990
2017-04-26 13:02:38 +00: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
Andy McCrae 3a9f07c659 Update paste, policy and rootwrap configurations 2017-02-15
Change-Id: I1a128c978d486bfd1728346925ba271ce29fbbad
2017-02-15 11:23:26 +00: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
ZhongShengping 7a5e5eda86 Remove pki support
Change-Id: I11313a78d332600564784f293ae9b8d0383440ae
Implements: blueprint remove-pki
2016-12-29 13:46:50 +08:00
Andy McCrae 0d3ca83ea0 Remove Trusty support from os_sahara role
Change-Id: I01d2fbf66a0e415ea8f5a7a9906d31707ea320fa
Implements: blueprint trusty-removal
2016-12-15 13:21:43 +00:00
Jesse Pretorius 52cfa298d7 Update paste, policy and rootwrap configurations 2016-11-04
Change-Id: I1daa7199f548b9d922f963b07730c0580e616a91
2016-11-04 15:59:38 +00:00
Jesse Pretorius 526021d88f Update paste, policy and rootwrap configurations 2016-09-08
Change-Id: I16de572c606db0aa7f9957175218a4cf35052161
2016-09-09 12:37:42 +01:00
Flavio Ramalho 97e66f2491 Support service-specific rabbitmq clusters
This chage adds support for service-specific rabbitmq clusters
for the sahara role.

Change-Id: I3df61ca5d8813d5b6301fcd51e2ddacd8e67253f
2016-08-26 16:15:45 +00:00
Kevin Carter eabf260379 Disable stderr logging
OSLO logging currently defaults the 'use_stderr' option to True
which results duplicate logs in service daemon logs for both
upstart and systemd. To correct this issue the use_stderr
option has been set to false.

Change-Id: I100faf83b9ed7060151e3da89a2234e8f14c94f3
Closes-Bug: 1588051
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-08-04 17:45:16 +00:00
Travis Truman 546777298b Support service-specific rabbitmq clusters
All rabbitmq connection vars are now namespaced. Namespace support
was previously inconsistent which limited deployer override options.

Change-Id: Ife9a394be5c21c85353966cf82e69a8ff3a13204
Implements: blueprint multi-rabbitmq-clusters
2016-07-25 14:27:30 +00:00
Anton Khaldin 625304c636 Only install to virtual environment
Remove all tasks and variables related to toggling between installation
of sahara inside or outside of a Python virtual environment.
Installing within a venv is now the only supported deployment.

Additionally, a few changes have been made to make the creation of the
venv more resistant to interruptions during a run of the role.
* unarchiving a pre-built venv will now also occur when the venv
  directory is created, not only after being downloaded
* virtualenv-tools is run against both pre-built and non pre-built venvs
  to account for interruptions during or prior to unarchiving

Change-Id: I1ca77e5125911a6d6ac0745abd2259ee3ece4612
Implements: blueprint only-install-venvs
2016-07-08 05:54:07 -07:00
Jenkins 9d27388916 Merge "Implement Ubuntu 16.04 Xenial support" 2016-06-19 00:31:22 +00:00
Flávio Ramalho c5ecb56867 Implement Ubuntu 16.04 Xenial support
This change adds suport for Ubuntu 16.04 with SystemD
while keeping the support for Ubuntu 14.04 with upstart.

Implements: blueprint support-ubuntu-1604
Change-Id: Iffed984d6c2c881cbac31919dc805b6122dd4f3f
2016-06-16 08:48:07 -03:00
Flávio Ramalho 9f40ef102d Deprecation of verbose option from oslo.log
This change remove the verbose option from sahara config due to its
deprecation.
More info:
http://lists.openstack.org/pipermail/openstack-dev/2016-May/095166.html

Change-Id: I5b442629d225e1c928a4e7a379b77e9d7f1e8da1
2016-06-15 23:35:20 -03:00
Flávio Ramalho 8aec726d90 Added configuration for default ntp and sahara/swift integration 2016-05-25 17:26:43 +00:00
Flávio Ramalho 3ee5d3a93e Changed sahara_plugins type for list 2016-05-13 11:15:19 -03:00
Flávio Ramalho 23f25f425e Initial import 2016-05-12 10:28:58 -03:00