Commit Graph

245 Commits

Author SHA1 Message Date
Aleksandr Chudinov e8de2a5f0b Add property protection configuration
Allows to configure property protection according to
https://docs.openstack.org/glance/latest/admin/property-protections.html

Change-Id: I9b4c0985969a4945ce8a1058206376b0347fbb27
2024-02-28 11:30:50 +02:00
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 ff895d3bad Remove glance_cinder_store filters override
At the moment glance_cinder_store.filters is distributed through
glance_store [1] package.
Moreover, for quite some time glance has migrated to using privsep [2]
so internally maintained filters are not up to date anymore.

[1] f3f5bdb45b/etc/glance/rootwrap.d/glance_cinder_store.filters
[2] c369ba013f

Related-Bug: #900930
Change-Id: Ie097a019f058bac123acf14f51253c272c56aca5
2023-11-14 18:55:14 +01:00
Zuul 2b0da5f562 Merge "Fix linters and metadata" 2023-08-14 10:37:13 +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 bf912df1e3 Apply tags to systemd_service include
In order to be able to use tags to run systemd_service role solely,
they must be applied properly when role is included.

Change-Id: I121167e87b7aa68a75af17cbde084de5b1961264
2023-07-13 14:58:22 +02:00
Zuul 1f989219b4 Merge "Add TLS support to glance backends" 2023-05-03 12:20:41 +00:00
James Gibson 736d36b79d Add TLS support to glance backends
By overriding the variable `glance_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the glance 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: I5a0302c2fcc73a869de5633b2332a3b53c99590e
2023-04-29 18:36:46 +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 f7c7e4864e Ensure service is restarted on unit file changes
At the moment we don't restart services if systemd unit file is changed.

We knowingly prevent systemd_service role handlers to execute
by providing `state: started` as otherwise service will be restarted twice.
With that now  we ensure that role handlers will also listen for systemd
unit changes.

Change-Id: I5a52c0de14ee3a6215edb64dbc3bd48512d57e2e
Closes-Bug: #2009029
2023-04-07 08:27:38 +00:00
Dmitriy Rabotyagov ee521f91f2 Stop using need_service_restart local fact
We can reduce complexity of logic on when to restart glance as we
anyway leverage in-role handlers to restart service when needed.

Patch adds also triggering service restart when install_packages
are changed.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/866693
Change-Id: Ieeeb9bc3b8922700e0c70f150cf1af0a75c805ea
Needed-By: https://review.opendev.org/c/openstack/openstack-ansible/+/866126
2022-12-06 12:53:09 +01:00
Zuul 504e641ed4 Merge "Remove redundant vars line" 2022-09-20 19:50:19 +00:00
Erik Berg af3c839eb3 Remove redundant vars line
This line was introduced by I65d8e66673f5372fe880680a035842ffcd775ac2
for centos-7 support, and should already be covered by the
distribution_major_version line above.

Change-Id: I8a2a93aa3ecbb01451e940b7e71e5ac5bf48b880
2022-09-14 13:03:30 +02:00
Zuul 152abb5f6c Merge "Support service tokens" 2022-06-16 13:21:20 +00:00
Dmitriy Rabotyagov 613e645a20 Remove mention of haproxy-endpoints role
Role was never migrated to usage of haproxy-endpoints role
and included task was used instead the whole time.
With that to reduce complexity and to have unified approach, all mention
of the role and handler are removed from the code.

Change-Id: I01225e479e22f3867e811055c8e5e87f644bf46e
2022-06-14 18:02:05 +00:00
Dmitriy Rabotyagov fc6f342194 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: Ib7fd1a80affe0fa8c6b030fdbfdd60693f104cd6
Related-Bug: #1948456
2022-06-14 14:36:52 +00:00
Dmitriy Rabotyagov c9a9e2f87b Fix glance mounts compatability
When default value has any concatenation, it tries to resolve variables
and always contcatenate even when it's not needed.

With that we need to set defaults for the variables that are inside
defaults, otherwise even if default not needed - task would fail on
default being undefined.

Change-Id: I4f445f280a71173f1b72a3b37bd9d54ea5694ac2
2022-06-14 16:36:14 +02:00
Zuul 1d8cb0dbd9 Merge "Use systemd_mount native syntax for mounts" 2022-04-25 22:47:45 +00:00
Dmitriy Rabotyagov 44b443dacb Allow os_glance to run in check mode
Let role fetch config file regardless of mode. This is safe operation
to run in check mode and shouldn't affect anything.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/837706
Change-Id: I5352028c967685e2b2d666fc4850afe9bf6ffd10
2022-04-13 17:31:39 +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
Zuul b3a65f317f Merge "Use common service setup tasks from a collection rather than in-role" 2022-01-28 21:21:31 +00:00
Jonathan Rosser 9f54a5a634 Use common service setup tasks from a collection rather than in-role
Change-Id: Ica9144f21cd675112d07008a387f65f8e468d378
2022-01-13 11:30:16 +00:00
Jonathan Rosser c801091880 Refactor use of include_vars
Use a first_found lookup instead of a with_first_found loop so that
the 'paths' parameter can be used.

This ensures that only vars from the role are included, and not vars
from a parent calling role. This can happen when a parent role has
a higher priority vars file available for inclusion than the role
it calls.

Change-Id: If4b1fe7ec14ffb03be79d29e9d21d9ab829cb4ec
2022-01-12 08:35:28 +00: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 0af66c540f Stop managing NFS mount destinations
Systemd mount role now takes care of creating mount destinations
so there is no reason to handle this manually.

In addition to that, if user/group were not provided explicitly to the
ones set for NFS export, role was failing with permission denied
during re-run

Change-Id: Ib158e14c6f296795bb1f6eabdcfc23b80cbcd871
2021-12-09 16:14:42 +00:00
OpenStack Proposal Bot 868eef21e6 Updated from OpenStack Ansible Tests
Change-Id: Ib97fb94458688738f8d3fbcb14504cfb35ec899b
2021-12-04 17:39:57 +00:00
Dmitriy Rabotyagov 6bc829f2b2 Use config_template as a collection
Since we still use ceph-ansible that has their own implementation of
config_template module it's worth to use mentioned module as a collection
explicitly.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819814
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-tests/+/819897


Change-Id: I030ca151599a9d6548951dddbc3a27c8d0f35f8c
2021-11-30 15:55:45 +00:00
Dmitriy Rabotyagov 6ed40be146 [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.

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

Change-Id: I03a29bab6663d1d0ee6130707ea5865ebbd916d5
2021-05-05 19:13:33 +00:00
OpenStack Proposal Bot b042ba545f Updated from OpenStack Ansible Tests
Change-Id: I504c1e528d697b9ab28671a3640a4e7b0b743272
2021-04-19 09:57:45 +00:00
Jonathan Rosser 7f2614ce4e Remove references to unsupported operating systems
All references to Gentoo, SUSE, Debian stretch and Centos-7  are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible

Change-Id: Id4f43e11bb02733b90f8bdf49e86f7a37656c68f
2021-03-10 12:16:38 +00:00
Jonathan Rosser ae6c72997c Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I03b51e2cf342b8b1434503f2bd0f4b30dcd5258e
2021-02-23 18:05:14 +00:00
Dmitriy Rabotyagov 3876d57364 Do not symlink ceph libraries for distro path
ceph_client role checks length of the `openstack_service_venv_bin` variable
to determine if libraries symlinking into venv should occur. So for
distro path this should be empty string as no symlinking should be done.

Change-Id: I775d882382b06110358879034f735a8c6e73ec93
2020-10-30 17:33:44 +02:00
OpenStack Proposal Bot 1db1e5a367 Updated from OpenStack Ansible Tests
Change-Id: Ib0377fa03cc06d75806816c183951cf39a1ebd53
2020-10-19 09:19:54 +00:00
Dmitriy Rabotyagov a51937db34 Trigger uwsgi restart
When we were migrating service to uwsgi usage, we clean forgot to
trigger uwsgi restart on service config change.

Change-Id: I4f230347a9c464244a6bac42e4234b627ca460ed
2020-10-08 14:53:21 +03:00
OpenStack Proposal Bot c721616ae4 Updated from OpenStack Ansible Tests
Change-Id: Ic1318b60671daee354028088a7d2b8c2e1c4e283
2020-10-01 14:30:06 +00:00
Dmitriy Rabotyagov c92707637f Revert use of _glance_first_play_host for post install tasks
run_once can't be replaced with such condition since config files should
be put against all groups, and not only api one.

Change-Id: I345fcfbab0b7735ae671ff592c8549eb4dd53b02
2020-09-22 07:24:29 +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
Zuul ab5de45fa7 Merge "Use the utility host for db setup tasks" 2020-08-21 15:40:25 +00:00
Dmitriy Rabotyagov d480f24e3a 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: I7da95890045b216ba8946616790b7cd33ef2db52
2020-08-20 17:39:09 +03:00
OpenStack Proposal Bot a489cc86fa Updated from OpenStack Ansible Tests
Change-Id: Id1dcf4e0ca5c3e4e157a4814c2732b8e91ab7cfa
2020-08-12 11:32:49 +00:00
Zuul a11b596f8c Merge "Cleanup glance-registry service" 2020-07-08 13:40: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
OpenStack Proposal Bot 912a834604 Updated from OpenStack Ansible Tests
Change-Id: I245ba6c8959874b3badd78af971863a1fe8e3b60
2020-06-08 19:54:39 +00: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 351f02646c Drop common-db tag from db_sync task
galnce_db_sync has no relation to common-db, and independent step
during glance configuration. common-db tag should be applied only
to the common tasks

Change-Id: I16df6895014f74f7e3d89489b10e91681511faa9
2019-10-30 16:44:50 +02:00
Dmitriy Rabotyagov 4e966b4f4a Drop duplicated keys
Change-Id: Ib8def3441b6c3a634cbb53a44d295b71586fed8a
2019-10-16 17:32:20 +03:00
Panagiotis Karalis c27d0123ab Turn the filesystem directory to be configurable
Update the ownership of the directory about NFS mount point(s).

This patch could be also stand as an improvement for future use.

Making the filesystem directory configurable, we are able to store
the image in the different directory (or in a new path) under
glance_system_user_home repo, which is able to be configured
dynamically, for instance, via deployment of a scenario.

Change-Id: I7403ac9bd85ea3ed149e13cb57c51039602f6ba1
Signed-off-by: Panagiotis Karalis <pkaralis@intracom-telecom.com>
2019-09-19 19:45:04 +03:00
Zuul ae681ded4e Merge "Allow venv python interpreter to be overridden" 2019-09-10 05:03:16 +00:00
Zuul 1ff3968959 Merge "Start using uWSGI role" 2019-09-06 15:30:22 +00:00
Jonathan Rosser a46cb9cfb2 Allow venv python interpreter to be overridden
Change-Id: I31d0d5bb3f65006a8b4b617aba70c3524df6e255
2019-09-05 17:34:23 +01:00