Commit Graph

51 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov e164cd56d8 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: I2e3f464534bffe9edd9d969c8d6a24adce06c02c
2023-10-20 14:17:25 +02:00
Dmitriy Rabotyagov 3125263df0 Stop generating ssh keypair for zun and kuryr user
There is no obvious need to have an SSH keypairs for zun and kuryr users
I was not able to find any proof in the project installation guide that
such keypairs were ever needed. Thus, such functionality is removed.

Change-Id: Icdaf2fec944aae95947ff421bf47d88e0cc0505e
2023-10-14 08:48:05 +00:00
Dmitriy Rabotyagov dddc665165 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: Ice967ef99da11e6bd5a7dffc0a5e3d377f8598f4
2023-07-14 21:30:29 +02:00
Zuul 7a63351303 Merge "Add TLS support to zun backends" 2023-05-21 22:04:52 +00:00
Damian Dabrowski aaf4b3f201 Add TLS support to zun backends
By overriding the variable `zun_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the zun 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: I85f90c573007f422b004b41e785bd1c86a21ec92
2023-05-19 09:06:00 +00:00
Dmitriy Rabotyagov bbea608c37 Allow to customize location of kv storage
This patch adds variables to easier control location of cluster-store
kv storage, including possibility to use zookeeper instead of etcd.

Change-Id: Ib413178268c4b5ae3ee7df57dcacbefde323819a
2023-05-19 11:05:18 +02:00
Dmitriy Rabotyagov 51e347dcb9 Install kata containers from source
At the moment there are no repositories exists for Ubuntu/Debian
to install kata from. The only options are snap or source installation.

To avoid using snap, we're fetching kata release from github and
proceeding with source installation.

With that we also update docker version to existing in the repos,
as otherwise it get's 23.0.0 installed, which fails to startup
due to removal of standalone mode support.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/883194
Change-Id: I3ee976062d9288536270f9b1d80750749174af22
2023-05-19 09:01:00 +00:00
Dmitriy Rabotyagov 04b99a0f81 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: Id451d06bcc40c94e9ef021dd7e3c1d14703e73cc
2022-06-16 19:24:26 +00:00
Dmitriy Rabotyagov 4bf971f33d Update Zun api-paste
This also removes  CPUFilter from Zun filters as this filtering should be
done by Placement.

Change-Id: I3e463f7442ea6b17d73429e7e4dff2fb71217a30
2022-02-03 17:28:00 +00:00
Damian Dabrowski 996dce8a8c Enable recursion in combine() filter
Ansible's combine() filter needs recursive=True parameter in order to recursively merge nested hashes.

https: //docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#combining-hashes-dictionaries

Change-Id: Ie081e4e9bdf84e0f3c1f0116fcd6c76e47573895
2022-01-11 19:18:58 +01:00
Damian Dabrowski 954c0a96d0 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: Ib258eeb4989236215d645b21ed25f9d35c3a2a0a
2021-12-03 13:47:46 +00:00
Zuul 34b01f7c6d Merge "Refactor definition of lock path" 2021-12-02 22:59:49 +00:00
Dmitriy Rabotyagov ae6f549766 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: I0fb662cc3fe241bf3934306b7ee8a3c8fdbcf747
2021-12-02 10:10:56 +00:00
Dmitriy Rabotyagov e72c788d94 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: I8b7b266d2a0633b40d38581e734ad00714b89885
2021-12-02 08:07:37 +00:00
Andrew Bonney eb78628c36 kata: disable installation on debian bullseye
Kata packages for debian 11 are not currently available without
involving Snap or source builds. As Kata is not essential to run
Zun, installation is disabled, but deployments could install it
themselves before switching 'zun_kata_enabled' back to True.

Bullseye CI is disabled temporarily as kernel panics are
encountered during tempest tests. This wastes a significant
amount of CI time.

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

Change-Id: I90fc8304dc7c398fdfccba31173c86f0cbf0ea7e
2021-11-30 17:07:03 +00:00
Zuul f51699d0e7 Merge "Add variables for rabbitmq ssl configuration" 2021-05-26 11:55:55 +00:00
Jonathan Rosser 796e49fa5b Add variables for rabbitmq ssl configuration
Change-Id: Ib261b39367603d386fe8416c407bfb7770afa844
2021-05-18 12:55:19 +00:00
Jonathan Rosser 599e30daaa Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: Ie427a6343fd888c9a1dd5c37a6285d33cd008b3e
2021-05-05 11:57:35 +01:00
Dmitriy Rabotyagov 513e730990 Allow to override zun policy files
We implement `zun_policy_overrides` variable in order to allow
management of zun policy files when needed.

Change-Id: If58446a2ca1aa645e098df86c3d76c8ac94bf1a1
2021-03-22 20:16:31 +02:00
Jonathan Rosser 1c65e2fcca Switch default virtualenv to python3
Change-Id: Ib44b9f40f3b707662efb652ca760af700a5d7317
2021-03-10 09:07:16 +00:00
Andrew Bonney b5bd190e24 Improve image and network cleanup procedure
This adds periodic cleanup of the directory which zun uses to
temporarily cache images loaded from Glance to avoid it becoming
too large.

Docker image cleanup is adjusted to make it less aggressive as
the 'until' filtering has been seen to clear images which were
created more recently than one hour.

The network pruning is removed as this causes zun to become out
of sync with Docker which can prevent creation of new containers
on pruned networks.

Finally, the default is to leave cleanup disabled so that it can
be enabled purely based upon user preference.

As Systemd timers cannot be disabled, this is achieved via a file
presence check with can be overridden for manual execution.

Change-Id: I4532d9975a2e68a12a7755ca3798a59f4928593c
2021-02-19 09:37:32 +00:00
Zuul 695af8ba41 Merge "defaults: set up docker overrides using systemd role" 2021-02-12 10:45:45 +00:00
Jonathan Rosser fe94ff67b3 Move zun pip packages from constraints to requirements
This is necessary to use the new pip resolver

Change-Id: Ia3782bf272a5970b6992d82e6732854af5e7a561
2021-02-07 19:39:47 +00:00
Andrew Bonney 7cc411f944 defaults: set up docker overrides using systemd role
Following on from https://review.opendev.org/765815, this change
moved the custom Docker configuration into variables rather than
its own template.

Depends-On: https://review.opendev.org/771216
Change-Id: I79371382227d0e9fdb710bff3875dc492210eae5
2021-02-01 08:26:07 +00:00
Andrew Bonney 67f1047af5 Add configuration for zun-wsproxy service
This fixes the configuration for the zun-wsproxy service which
relays messages from the Docker daemon, providing output from
containers' consoles to the Horizon dashboard.

Depends-On: https://review.opendev.org/769142
Change-Id: I7158e202be2e778a7a64e9ef2656f496caae97be
2021-01-25 13:07:44 +00:00
Andrew Bonney 154ecfe25a Prevent zun-wsproxy binding to all IP addresses
This issue is preventing metal upgrade jobs for
victoria->master from deploying haproxy correctly following the
merge of https://review.opendev.org/769142/.

This is intended to be a minimal patch to fix the binding
so that it can be backported in order to fix the upgrades.

Change-Id: I1c3dcbc21bee1bf6c66c9c2f77c4ff832db49f19
2021-01-25 12:18:00 +00:00
Zuul 14fb242eb9 Merge "Add support for kata container runtime" 2021-01-18 16:11:51 +00:00
Zuul 371bc250d7 Merge "Reduce number of processes on small systems" 2021-01-18 15:58:33 +00:00
Zuul 90560e869a Merge "Use global service variables" 2021-01-13 12:15:44 +00:00
Andrew Bonney 6856c22cb6 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 divide amount of CPUs to number of threads for hyperthreaded CPUs

Change-Id: I67a874a94e7ef5793f484599f92cd81f20f42df3
2021-01-12 11:44:56 +00:00
Andrew Bonney fb440ce3d0 Add support for kata container runtime
This adds support for kata containers by installing and configuring
the relevant runtime.

The default remains as 'runc' but can be adjusted using the
variable added to the defaults.

Change-Id: Iea07012d092333c656b397f97b541a2f0a5f0e44
2021-01-12 08:30:57 +00:00
Dmitriy Rabotyagov 79f05091bd 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: Iced1c0986f448b2a19b1f81586e50a039c23f566
2021-01-08 19:09:03 +02:00
Andrew Bonney 6045bac2e8 Add timed cleanup script to handle old Docker data
The Docker image cache does not get emptied automatically and
can take up significant disk space. In addition, old networks can
leave iptables rules, network devices and routing table entries
behind.

This patch adds a periodic timer job to delete this data where it
is safe to do so and won't impact existing containers.

Change-Id: I7045fcbb8bcd7a9744cc35fb2668016bacab4f1b
2021-01-08 09:14:00 +00:00
Andrew Bonney 1a75a7dfbe defaults: start kuryr service before docker
If Docker starts first, it gets stuck in a starting state waiting
for the kuryr service to become available. This change swaps the
order to start kuryr first instead.

Change-Id: Ib2395c317c34cfbd4b72b1d19932a236bcff7a30
2021-01-06 09:11:37 +00:00
Andrew Bonney 6d6a4beb28 Update zun role to match current requirements
Brings together a set of existing patches and attempts to address
permissions issues with the kuryr-libnetwork plugin.

Defaults are chosen to match the requirements of the tempest tests

Change-Id: Ie674947ba6673a92e53f85de2cc8acdae5788f8f
Depends-On: https://review.opendev.org/767469
2020-12-17 08:44:37 +00:00
Dmitriy Rabotyagov 07d7845820 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: Ic57de36d5d240e6a5dda6e1794aa04d1f77fb962
2020-08-20 19:51:42 +03:00
Dmitriy Rabotyagov 7ee1939c1c 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] and fix zun-docker
systemd config.

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

Change-Id: Ic7b31506177ebb0f4f24eaff4db134aace5c0b1a
2020-03-25 22:26:05 +02:00
Dmitriy Rabotyagov f006a0c00a 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: I0675fb5e77171a1456c08ef4d6bfe0b0d949bbf6
2019-11-14 19:09:18 +02:00
Dmitriy Rabotyagov bc39aac81b Start using uWSGI role
Move service to use uWSGI role instead of internal python daemon.
This aims to unify deployments by using uwsgi for all services
api which support using them as wsgi applications.

Depends-On: https://review.opendev.org/693528
Change-Id: I69044a13106f16bbbef8ae83e79a08aa127a7d2a
2019-11-08 16:36:56 +02:00
Jonathan Rosser 5425851cf3 Allow venv python interpreter to be overridden
Change-Id: Idf31f0a3cda2932ba041defef803ac66c88a2e8e
2019-11-07 14:59:14 +00:00
Dmitriy Rabotyagov 0839ec0935 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: Id466ac20d9d18fa86a4615a73433a51720bafc8e
2019-07-17 20:32:48 +03:00
Dmitriy Rabotjagov 0684afa2c5 Update role for new source build process
The variables zun_developer_mode and zun_venv_download
no longer carry any meaning. This review changes zun 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 installation 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.

We also change include_tasks to import_tasks and include_role
to import_role so that the tags in the python_venv_build role
will work.

As part of commit xenial testing was removed. Instead centos 7
and opensuse 15 functional tests were added.

Change-Id: Ic8fc09372cf7397df6757c115b2c05dbb5db68f1
2019-03-29 12:43:52 +02:00
Jesse Pretorius 087ab53281 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: I7d801847f194d733bb2e5418f64571e68d8b42ad
2019-02-26 08:27:38 +00:00
Jesse Pretorius 6eb94ebfef 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: Ia3646f395a17c90de6ff7b23e31897573691b5d4
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-09-03 18:11:27 +01:00
Matt Riedemann 5b55303718 Remove deprecated Disk/RamFilter usage
As of change https://review.openstack.org/#/c/596502/ nova
has deprecated the RamFilter and DiskFilter since they are
not necessary when using the default scheduler driver
(filter_scheduler). This change removes their usage from
this deployment project.

Change-Id: I9c05016817cb03933292f09d06119795f8f451a0
2018-08-28 14:30:42 -04:00
Jesse Pretorius d4edcbde6d 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:
- zun_oslomsg_rpc_setup_host
- zun_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.

Finally, we remove the test mq setup tasks and clean up any unused
or unnecessary variables configured in tests.

Change-Id: I639a3fa3e138b1ae190325b9794969820267ec23
2018-07-27 12:42:19 +01:00
Andy Smith 4df8a013fe 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.

This patch:
* Add oslo.messaging variables for RPC and Notify to defaults
* Update transport_url generation
* Add oslo.messaging to tests inventory and update tests
* Install extra packages for optional drivers

Change-Id: I0b2138ca9eb49387948f2ca87800cf966a9414a8
2018-07-26 09:31:02 +00:00
Jesse Pretorius 9451adb165 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 openstack_openrc role is now executed once on the designated host, so
it is no longer necessary to execute it using include_role here.

The zun_requires_pip_packages variable is not used and is therefore removed.

Depends-On: https://review.openstack.org/579233
Depends-On: https://review.openstack.org/579959
Change-Id: I7108b43109136aac46bc87a0c59827a202f87be8
2018-07-06 13:50:16 +00:00
Jesse Pretorius 110c2038ed 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 'zun_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 'zun_galera_address' which
has been used for a long time, but never documented. A bunch of unused
variables have also been removed.

Change-Id: Ic1e3c870a220f67cc5220a1dbc644d8bf47b0f16
2018-06-28 17:11:29 +01:00
Kevin Carter b54e3f4497
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.

Change-Id: I119ab6ab6f57b04fcedba36006d2a04de91cfae3
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-06-11 22:59:37 -05:00