Commit Graph

58 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 2ec800116e 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: Idbd2bef71983f6fb3cc402563a166349621bf03c
2023-08-16 13:33:42 +00:00
Dmitriy Rabotyagov 6f3bcbe892 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: Iaed7f2b4a724aed0f4165e32f3d40aac9d74edd7
2022-06-17 14:10:25 +00:00
Marc Gariepy af3c87535d Control amount of metricd workers
As of today we didn't manage amount of gnocchi-metricd that equal to
amount of CPU on host. So things can go off regarding CPU and memory
consumption. For better control of ressources we add a variable to
control the number of workers.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/846349

Change-Id: Idcaec649a4de03f5714c61fda694ada45da41dbc
2022-06-17 08:36:01 -04:00
Dmitriy Rabotyagov 1483fcbc28 Add variables to manage redis url
To provide more convenience in configuring redis as Gnocchi driver,
we add 2 variables that can be used to control
URL to Redis when it's used for storage or incoming data.

Related-Bug: #1955676
Change-Id: Iba5186df3656c116cba48c3be0e39e87ddcb727f
2022-05-13 11:20:04 +02:00
Dmitriy Rabotyagov 84150e8fb1 Add availability to define gnocchi_incoming_driver
Gnocchi supports having different storage and incoming drivers [1] which
has been never implemented in role.

We add `gnocchi_incoming_driver` variable and do incoming configuration only
when it's not same as gnocchi_storage_driver.

[1] https://gnocchi.osci.io/install.html#configuration-file

Depends-On: https://review.opendev.org/c/openstack/ansible-role-python_venv_build/+/822901
Change-Id: If1442abd7978d44def2a4386f9d159b42c4939e3
Related-Bug: #1955676
2021-12-24 13:39:33 +02:00
Dmitriy Rabotyagov 1274517f71 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: Id986985e623896698d54496a8f0608e59516eec5
2021-09-21 14:33:30 +03:00
Dmitriy Rabotyagov a6a25bf3cd Switch gnocchi service name to service
Previously we used different from other services project name to protect
swift from looping. However nowadays ceilometer middleware does
exclude service project by default. So no futher actions needed
unless deployer want to measure service project excluding gnocchi
In this scenario, deployer still can define custom
`gnocchi_service_project_name` in their user_variables.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-galera_server/+/791107
Change-Id: Ic0ffa6908bfc55ffdb41ea9b8e7435e4dc88ddca
Related-Bug: #1879192
2021-05-14 04:22:38 +00:00
Guilherme Steinmüller 0490611056 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: Iefac95507d189b86371026e17465adf15b1bf410
2020-03-16 16:17:24 +00:00
Dmitriy Rabotyagov b7a76fb341 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: Iec03bd79279e694678336880460bcb83f68d9780
2019-09-04 17:36:30 +03:00
Dmitriy Rabotyagov 57b88ebc65 Migrate gnocchi to use uWSGI
This patch moves gnocchi-api from usage of apache with mod_wsgi
to uWSGI, which means unification across another roles and
reduced maintenance costs

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

Depends-On: https://review.opendev.org/671988
Change-Id: I06bbcb2f15108fc517742208ac5291719627ffe2
2019-07-25 22:47:29 +03:00
Dmitriy Rabotyagov eb083ecf9f 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: I3f6a1cee0e98372881b015ebf06e405c79495fe1
2019-07-17 00:26:00 +03:00
Dmitriy Rabotjagov f3eddb3d51 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: I54e3063d6e641a785377f9039641072f8001cf24
2019-02-16 22:30:01 +02:00
Dmitriy Rabotjagov 38340cf4bd coordination_url should be placed in DEFAULT section
According to gnocchi docs, coordination_url should be placed in DEFAULT section now
Otherwise deprecation warning is shown.
https://gnocchi.xyz/install.html#gnocchi-configuration-sample

Fixed test-install-gnocchi.yml syntax

Change-Id: Ief9073cf2f9c876c4c1a91568aab6a79d22ab626
2018-11-08 21:20:26 +02:00
ZhongShengping d8e45f62cb 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: I37fe1d95bf867e6ef3b68db69fc01fbda12648ca
Implements: blueprint deprecate-auth-uri-option
2018-04-03 14:20:18 +08:00
Jimmy McCrory 554a6df961 Add MySQL connection SSL support
When 'gnocchi_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: Ib5a87e9366cd9e5a78ccb774ced46e1791e7691d
Partial-Bug: 1667789
2017-12-15 07:30:55 -08:00
Jimmy McCrory 9cb387d7e9 Update gnocchi wsgi function
Gnocchi's wsgi application function was moved in a recent upstream commit.

Change-Id: I47f7a4796208a0e4fe5a803718dfa5900275162f
2017-09-21 14:52:28 -07:00
Markos Chandras 68343520de templates: gnocchi-httpd: Ensure proper user control in gnocchi root
We need to ensure that /var/www/cgi-bin/ has proper user control since
different distributions place cgi-bin in different directories and as
such the default ones may not apply for aodh. For example, openSUSE
places it in /srv/www/cgi-bin and as such accessing the gnocchi
resources results to 403 HTTP errors.

Change-Id: I146190d56f2d68b84b52cc0c349add321fdf08cc
2017-07-11 14:17:41 +01:00
Jesse Pretorius e62702e3be 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: I61bf0fea745be12a636448abeeb62dc88370d22f
2017-04-26 13:01:46 +00:00
Jenkins 39d0d7c2d8 Merge "Deprecate auth_plugin option" 2017-04-05 03:13:07 +00:00
Kevin Carter 318bd76e5e 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: Ife7d6e3c0c11818d80484cf67a887026aaedb92c
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-04-01 14:42:07 +00:00
ZhongShengping 712400f066 Deprecate auth_plugin option
Option "auth_plugin" is deprecated, use option "auth_type" instead.

Change-Id: I672f1a40231378db596a418b68ff288bf5c562d9
Implements: blueprint deprecate-auth-plugin
2017-03-25 12:27:24 +08:00
Andy McCrae 78e6f5ab0c Add api.auth_mode setting, and update api-paste.ini
Gnocchi moved their api-paste file out of /etc/, but in order to benefit
from template overrides, whilst keeping the default gnocchi
api-paste.ini, we can use it as a source, but use config overrides.

Additionally, we need to specify auth_mode in the gnocchi.conf file,
which should default to "basic" if keystone is not used, although can be
set to "noauth" if needed. "basic" is the new upstream default.

The gnocchi_keystone_auth var is deprecated and scheduled for removal
in the Queen release.

Change-Id: I4e1a28a96f3b6870d9c9e100308aba1bbf294aa0
2017-01-23 11:19:18 +00:00
ZhongShengping 2fcad52707 Remove pki support
Change-Id: I0dac67e8d1dfbbd3224aa1c967bf7cd2c12fecf1
Implements: blueprint remove-pki
2016-12-29 11:21:37 +08:00
Andy McCrae 6a0c568967 Remove Trusty support from os_gnocchi role
Change-Id: I69dca19fa565bc92974f5dec132228f798d9ce13
Implements: blueprint trusty-removal
2016-12-15 13:17:31 +00:00
Travis Truman 46a58b7851 Disable gnocchi-api service when mod_wsgi is used
The *_services dict pattern present in other roles
has been adopted and systemd/upstart service enablement
of the gnocchi-api service is now directly tied to the
state of `gnocchi_use_mod_wsgi`.

Change-Id: Ibc15c37bbd5a1a70b0774a1184b5759e558a0efb
Closes-Bug: #1633205
2016-11-09 15:05:25 -05:00
Paulo Matias fb65850dbe Add support for the Ceph storage driver in Gnocchi
Besides implementing the required configuration entries in gnocchi.conf,
this commit also introduces code to create a symlink for the Python
rados library when the Ceph storage driver is chosen by the deployer.

Creation of Ceph Python library symlinks is usually done by the
ceph_client role. However, Gnocchi is different because it needs Ceph
access to be working when the DB sync task is run. Because the venv may
not exist before the os_gnocchi role runs, or because it might be
destroyed and recreated by the role, we need to create the symlink in
the os_gnocchi role itself.

Change-Id: I6b831867079bc24964c323e2784782d4eae30763
2016-09-30 02:20:23 +00:00
Paulo Matias ec80b0172d Fix inverted ternary for gnocchi_keystone_auth
Change-Id: I749d357b936cd5f2859c32cf848ff0cd1755991d
2016-09-17 21:01:33 -03:00
Jesse Pretorius 6de1e4b699 Update paste, policy and rootwrap configurations 2016-09-16
Change-Id: Id77d37b7082ff8e60e220b322196db8d13035b75
2016-09-16 07:10:05 +01:00
Jesse Pretorius ab9d1537cb Allow gnocchi to make use of keystone authentication
The upstream default implementation of gnocchi is not
to use keystone authentication, but a preferred deployment
configuration in enterprise environments is to ensure that
keystone authentication is configured.

This patch creates a simple toggle to enable it.

Closes-Bug: 1622251
Change-Id: Ic41cf161af1d59e5b0f4b71c0d698cd7348c962c
2016-09-13 17:31:41 +00:00
Jesse Pretorius aa7ee9c6e2 Update paste, policy and rootwrap configurations 2016-09-08
Change-Id: I342947faee2bb3160d54ee4eecfb9da4ddd203eb
2016-09-09 12:47:02 +01:00
Kevin Carter 7400b51e4e 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: I4dc59c2deca63749470a7fdb779465362a5b9e0a
Closes-Bug: 1588051
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-08-04 17:43:44 +00:00
Steve Lewis da8e0b7bc1 Normalize galera password and clean up role
The role has historically used a different password variable.
Because the role is being maintained by the community now it makes
more sense to normalize the password for ease of maintenance.

The no-longer needed operations to create the DB and grant access
are removed from the role as these are in the integrated project's
playbook now. These tasks are added as pre_tasks for testing.

Similarly, the contents of the /ext directory are eliminated as
these are no longer needed since all of the contents have been
applied to the integrated gate.

Finally a run_tests.sh file is added for consistency and to fix the
bashate lint job which fails when there are not matching shell
scripts.

Change-Id: I7b9046dfe7ba258218b4d14ec8d4f270e917ca34
2016-07-27 21:54:43 -07:00
Jimmy McCrory 78350d1518 Only install to virtual environment
Remove all tasks and variables related to toggling between installation
of gnocchi 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: I7a75e87d4451d62ee4587654cf5dbfb3789991c8
Implements: blueprint only-install-venvs
2016-07-08 02:54:25 -07:00
Steve Lewis aa328e6da4 Use pbr WSGI script to build gnocchi-api
Removes host and port from api section of config file template.
Also cleans up Ansible Lint warnings

Related-To: I2298f9cb94a684747f4b4dbc262cdcab7de49175
Change-Id: I56954df3d13b86cfcb4eb68e419ce13dfac2c051
2016-07-08 00:26:59 -07:00
Steve Lewis 17b954d8e5 Implement Ubuntu 16.04 support with SystemD
This change updates the Gnocchi role to support Ubuntu 14.04 with
upstart init and 16.04 with a systemd init.

A change for the functional tests disables them. They will be
fixed properly in a following patch.

Change-Id: I6170a3bcc6ad61474a0a70c786b2607915868e17
Related: blueprint support-ubuntu-1604
2016-06-07 09:04:28 -07:00
Steve Lewis e578920c6d Update SHAs and config templates
The role has not been updated to the current pattern for independent
roles, to track master of the OpenStack role in test. This steps up
through about 3 months of development in Gnocchi, and includes the
necessary changes to paste and policy files to make Gnocci run as
expected while still including the healthcheck middleware which is
not included upstream.

During bootstrap/migration of the DB we now need to ensure that the
create-legacy-resource-types switch is given to ensure that these
are available to Ceilometer. The behavior has changed in Gnocchi to
require this for storage of standard metrics from Ceilometer.

Change-Id: I7f3cdd58bbee5bbb1704bf710397ca2ee390f03f
2016-05-05 09:20:50 -07:00
Steve Lewis a7c38ce7a1 Initial convergence testing
An initial convergence testing for the role is provided but it is
not installing or configuring ceilometer yet. That work is held back
until we have the role passing basic testing. This stage of testing
also attempts to avoid installing rabbit as an unnecessary
complexity.

A separate container is used for gnocchi so that gnocchi can be
deployed under mod_wsgi without conflicting with Keystone. In turn
some changes to the inventory pattern, and the use of group_vars for
internal and external _lb_vip_address values is introduced here as
there is no load balancer and traffic for each of Keystone and
Gnocchi needs to be addressed appropriately.

Partial-Blueprint: role-gnocchi
Change-Id: I27a76a62b2443787e5347f08e974a9eb3cc33dbe
2016-04-22 00:14:14 +00:00
Steve Lewis d1bb929d12 Enable SSL termination
This change makes it so that Gnocchi is expecting SSL termination
at the load balancer by default. This is more indicative of how a real
world deployment will be setup and is being added such that we can
test a more production like deployment system by default.

Related-Change: I913b4140e258b56d56f5323d55fd633288b3ef6a
2016-04-04 14:04:51 -07:00
Steve Lewis 1020ecd868 Update role to reapply the pattern of tasks
Updating the role to use the best practices around environment deployment,
task and variable names, tagging, service restart triggers, etc.
2016-03-29 16:57:08 -07:00
Steve Lewis 94adfd75dc Switch default storage backend to file
Revert a change to allow the gnocchi_pip_requirements to be
tailored to the storage driver chosen. There is another bug
file to make that work.
2016-03-15 11:01:17 -07:00
Steve Lewis b0353ddf2e Clean up indents so resulting file looks right 2016-01-28 15:06:54 -08:00
Steve Lewis 345e741428 Fixes to the ceilometer and swift configs
Trying to resolve issues with ceilometer communication with gnocchi,
also trying to resolve issues with swift communication.
2016-01-26 16:19:06 -08:00
Steve Lewis 308678b57a [WIP] configure ceilometer to dispatch to gnocchi 2016-01-25 11:59:22 -08:00
Steve Lewis 02aab9480f Add support for API through Apache + mod_wsgi
Also adds a delay and more retries to policy setup in order to ensure that
step completes successfully since the API takes a moment to stop returning
Status 503s.
2016-01-15 10:32:57 -08:00
Steve Lewis fe9ae35746 Set correct path for healthcheck 2015-12-17 15:32:21 -08:00
Steve Lewis e149172d1b Allow some endpoints to bypass auth
Allows / /versions and /status and other endpoints to be
accessed without auth and other endpoints to be accessed
according to policy.
2015-12-17 14:41:00 -08:00
Steve Lewis 06c295a826 Add missing config for auth to work 2015-12-17 13:07:05 -08:00
Steve Lewis d2b8efed74 Better tuning for haproxy config
Now uses /status as it should have initially, sets to host with
least connections which is good behavior for http usage
2015-12-17 12:49:29 -08:00
Steve Lewis 31137adbe2 Add healthcheck to /versions endpoint
Setting to /versions endpoint makes for easy HAProxy config
2015-12-17 12:04:55 -08:00
Steve Lewis 460519747e service reg. conf fixes + cleanup
During testing of service registration unknown variables were identified
and values for them are provided in defaults now.  These implied changes
to the README and other housekeeping was done while there. Similarly,
housekeeping was done in user_gnocchi_secrets to remove an unused
secret. Also, a gnocchi_storage_driver is defined in defaults and the
coordination url is defined to allow external system to be used for locks.
The gnocchi metricd service was excluded from running, is not configured.
Finally a couple of TODO notes were added to mark things that need to
be done for the role still.
2015-12-04 17:12:32 -08:00