Commit Graph

17 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov aa69a6fe5c Make glance_additional_stores work nicely with multi-store
While we assume that glance_additional_stores can be list of mappings
for multistore glance support, bunch of other logic in role still treats
it as simple list and make verifications against it. So in case one
dares to override variable according to our suggestion, they also need
to override bunch of other things.

We change defaults for `glance_available_stores` variable and always
define it as a multistore list of mappings.

Then we introduce a variable `glance_available_store_types` that is a
list of types for each of configured storage.

Logic of how storages are defined in glance config is also changed now.
Storages won't be defined if there's no "default" record for them in
glance_available_stores.

For each new store that deployer wants to provision, they now can pass
`config` key for glance stores, rather then use config overrides.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/901041
Change-Id: I1416e0f6e3ed79abd10f468b52fc712d35a61bd2
2023-11-27 11:36:33 +00:00
Dmitriy Rabotyagov c2428ab8da Add glance_bin to rootwrap defenition
At the moment rootwrap can not find privsep-helper binary as it's located
in glance bin directory, which is inside the virtual environemnt.
In order to properly use privsep we must define venv bin directory in
allowed exec_dirs of rootwrap.

This also introduces new variable  `glance_rootwrap_conf_overrides`
that allows to manage some extra overrides for rootwrap if needed.

Closes-Bug: #2043503
Change-Id: I4ee3fc33fdbeb50fc7b102bf62d6134f83c5925f
2023-11-14 18:50:18 +01:00
Dmitriy Rabotyagov 289ce991c4 Use correct default for glance_mount_points
Back in Yoga we've refactored way of mounting remote filesystems
for glance while keeping backwards compatibiltiy [1]

However, there was a copy/paste error made while defining
glance_mount_points with old format of glance_nfs_client.

[1] https://review.opendev.org/c/openstack/openstack-ansible-os_glance/+/837550

Change-Id: I755822089bf406f532a718db5b84df553cbc2084
Closes-Bug: #2032771
2023-11-06 08:33:09 +00:00
Dmitriy Rabotyagov 8e36b59745 Split lines to not exceed 160 characters limit
Change-Id: I05029ad2a2a8e351ecc7236cb779a045c3a44403
2023-09-18 15:38:17 +02:00
Zuul 4e0ca28c67 Merge "Add quorum support for glance" 2023-09-04 08:19:43 +00:00
Dmitriy Rabotyagov cf448d95c5 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: Ifb3711157e77d5c917d05e4a384dead2abe72a7c
2023-07-14 14:56:14 +02:00
Dmitriy Rabotyagov a5d922e4ed Add quorum support for glance
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/oslo.messaging/+/873630
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/873618
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/875399
Change-Id: I87a5a1bb5028706e1768f53f53c4567cbdff64c9
2023-07-06 14:04:59 +02:00
Damian Dabrowski fafd49959e Move _glance_available_stores to defaults
We need to define _glance_available_stores outside glance role to
use it in haproxy service definition.

It's a good idea to make `_glance_available_stores` public by moving it
out of role variables to role defaults beforehand.

Change-Id: Ieb10a0e5c9faf72c6bea4c45f7e216469971a1f3
2023-04-20 20:51:58 +02:00
Dmitriy Rabotyagov 887a59256e Use systemd_mount native syntax for mounts
Currently we have bunch of limitations related to the format
of ``glance_nfs_client``. While systemd_mount role is flexible enough
to allow mount cephfs or s3fs, variable format has weird assumptions
that we want to change for better flexability.

Since keys of variable are changing, new name for it was picked to
reflect purpose of the variable better.

Change-Id: Ic0d91a3a873b4253255beac79becf01b4a304695
2022-04-12 12:56:38 +02:00
Dmitriy Rabotyagov 091f33c8da Define _glance_available_stores in variables
Glance available stores is usefull outsie of the template as well, so we
move defining variable from Jinja template only to ansible variables.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-python_venv_build/+/822998
Change-Id: I312fdede3c3bffa0c897588d33fcc5d5d6988ccd
2021-12-27 16:53:47 +00:00
Dmitriy Rabotyagov 1c2f04b028 Define condition for the first play host one time
We use the same condition, which defines against what host some "service"
tasks should run against, several times. It's hard to keep it the same
across the role and ansible spending additional resources to evaluate
it each time, so it's simpler and better for the maintenance to set
a boolean variable which will say for all tasks, that we want to run
only against signle host, if they should run or not now.

Change-Id: Ida1d88be3ae8f52b6c467563a9b99a7f7d44c4c0
2020-09-16 11:54:27 +00:00
Dmitriy Rabotyagov ed736fd783 Cleanup glance-registry service
Glance-registry service has been removed in V cycle with [1]

We do all necessary cleanup to fully remove service deployment.

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

Change-Id: I0b2e2e39040fd0daef04724f94a39f2d11e4d105
2020-07-07 07:30:17 +03:00
Dmitriy Rabotyagov 0f7971c9cb Fix glance policy.json deployment
Glance has dropped default policy.json [1] which
was used by "smart sources". We are fixing this by setting content
to empty dict, that way the only content deployed will be the one
provided by overrides, so that won't change current behaviour.
Additionally `glance_policy_content` has been introduced, which
eventually is going to replace `glance_policy_overrides` in the future.

[1] dd1975bd3e

Change-Id: I3f365684542b390ea02c08ab56f76a447f65a814
2020-03-10 14:27:33 +02:00
Dmitriy Rabotyagov 4b2724b44b 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.

Depends-On: https://review.opendev.org/678025/
Change-Id: I6f129940e55130c289d94138171cee54dbd28fc1
2019-09-04 15:32:08 +03:00
Kevin Carter 9748e6b154
Cleanup files and templates using smart sources
The files and templates we carry are almost always in a state of
maintenance. The upstream services are maintaining these files and
there's really no reason we need to carry duplicate copies of them. This
change removes all of the files we expect to get from the upstream
service. while the focus of this change is to remove configuration file
maintenance burdens it also allows the role to execute faster.

  * Source installs have the configuration files within the venv at
    "<<VENV_PATH>>/etc/<<SERVICE_NAME>>". The role will now link the
    default configuration path to this directory. When the service is
    upgraded the link will move to the new venv path.
  * Distro installs package all of the required configuration files.

To maintain our current capabilities to override configuration the
role will fetch files from the disk whenever an override is provided and
then push the fetched file back to the target using `config_template`.

Change-Id: I3e7283bf778a9d686f3ae500b289c1fb43b42b92
Signed-off-by: cloudnull <kevin@cloudnull.com>
2019-02-18 09:06:26 -06:00
Kevin Carter c6cd170fb7 Correct role rerun when using glance with NFS
When using glance + NFS the role deploys everything perfectly the first
time however if the role is executed again it will result in failure due
to some base directories being a mount. This change adds a new variable
which will create a list of all NFS mount points. This list is then used
in the required tasks to ensure we're not attempting to recreate
directories that should already exist and are being used as
mount-points.

Change-Id: Id28176833c0b783c20ee1d2ce71fa0654ccf683e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-06-28 14:47:53 +00:00
Jesse Pretorius 545e362b05 Ensure that services restart in a particular order
Currently when multiple services share a host, the
restart order is random. This is due to an unordered
dict being used to facilitate the mapping of services
to their groups, names and other options.

This patch implements changes to the role to ensure
that services on the same host are restarted in the
correct order when the software/config changes.

Change-Id: I52fc66f861ce98cc8299c84edcfd5f18d74306b3
2017-06-30 13:27:56 +01:00