Commit Graph

39 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov e32db7ae75 Add online_data_migrations for placement
According to the placement upgrade process, online_data_migrations
should be triggered right after upgrading database schema
and placement services on all controller nodes [1]

We also replace usage of  `need_service_restart` local fact
with `need_online_data_migrations` as first one is never actually used.

[1] https://docs.openstack.org/placement/latest/cli/placement-manage.html#placement-database

Change-Id: I430ea45fe321440d832a0a90747b80f5d197f073
2023-09-05 08:19:40 +02:00
Dmitriy Rabotyagov 87ca7b41e3 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/openstack-ansible/+/891474
Change-Id: I315c7fa58ee07786832d21c13f281968ee3d400a
2023-08-22 07:44:31 +00:00
Damian Dabrowski 30b4098fd2 Add TLS support to placement backends
By overriding the variable `placement_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the placement 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: Id84137b624624482939989098f1b04263d62c0fd
2023-04-29 18:43:16 +02:00
Erik Berg 39f3c1f016 Remove redundant vars line
This line has been here since the initial commit
Iaa11a8cc4d945712b62c3b9c2cb6ad168def34eb, but should already
be covered by the distribution_major_version line above.

Change-Id: Ia6b77dd8cd70e099e9b287625ab3320b1986f599
2022-09-14 13:04:41 +02:00
Dmitriy Rabotyagov 242e17c230 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: I4e9fff59bbfa9c8a1ae0236d077ac9ee2881c04b
Related-Bug: #1948456
2022-06-16 10:48:52 +00:00
Zuul ba338055bb Merge "Use common service setup tasks from a collection rather than in-role" 2022-05-05 17:51:09 +00:00
Marc Gariepy d419e6c003 Use common service setup tasks from a collection rather than in-role
Change-Id: I6d6831e5760c040cc46e4493b79b3aee58fbbb08
2022-05-05 09:53:33 -04:00
Jonathan Rosser 68894c47e1 Fix incorrect ansible tag
Change-Id: I5ed7d7a41e81243d6ad2dd7a4300cf772ed0ac7f
2022-05-05 10:34:34 +01:00
Jonathan Rosser ee909497f2 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: If58b7e10f39affe2f34af9e9503bc1f90caa4b0e
2022-01-12 08:14:32 +00:00
Dmitriy Rabotyagov f8e279cc3d 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



Change-Id: I374d125994239a885007081d0490e4a2c7018235
2021-11-30 15:17:24 +02:00
Dmitriy Rabotyagov 0dfcbc27ec Allow to override placement policy files
We implement `placement_policy_overrides` variable in order to allow
management of placement policy files when needed.

Change-Id: If219ac80ceed2bf455a7de83b848c9d0a66371a4
2021-03-28 18:15:21 +00:00
Jonathan Rosser 60938dca24 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: I58b9cec20349c722631e5934c44efb54153daab7
2021-03-10 13:30:09 +00:00
Jonathan Rosser 3fcf510959 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I2197cf5a9a19e6af0912f21dcc12cd7551dc2e85
2021-02-23 18:06:48 +00:00
OpenStack Proposal Bot 03491ef4dc Updated from OpenStack Ansible Tests
Change-Id: I75756a4b78bc7c906278c3d316aaba1575a05116
2020-10-19 09:20:47 +00:00
Dmitriy Rabotyagov a53fa6743d Trigger service restart
We need to trigger restart of the service once config is changed

Change-Id: I9417f519ba272a8a2ebe08e71311cba27220c4cc
2020-10-08 18:05:17 +03:00
OpenStack Proposal Bot 668a20db62 Updated from OpenStack Ansible Tests
Change-Id: I7853cfedce34a81e711729e95bf91d2b2313af40
2020-10-01 14:31:46 +00:00
Dmitriy Rabotyagov 2bcd1ac750 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: If086478f8ea9a0ffb763fd05d6a110e1c12f32b3
2020-09-25 17:54:07 +03:00
Dmitriy Rabotyagov 7d122d7333 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: Ic831664bd500b8a3ed22238fef0b19ed56313d72
2020-08-20 19:33:45 +03:00
OpenStack Proposal Bot ce3419f328 Updated from OpenStack Ansible Tests
Change-Id: I0e6a8b1d8b5da0299060e3f21698aa81ec7d7ce4
2020-08-12 11:35:00 +00:00
OpenStack Proposal Bot b2c48667d0 Updated from OpenStack Ansible Tests
Change-Id: Ic62a5d41dfae4773bd6eff7583bdc40765a456e9
2020-06-08 19:56:45 +00:00
Dmitriy Rabotyagov (noonedeadpunk) 5c0a44c4df Revert "Add nova to placement DB migration"
As nova_placement -> placement takes place in S->T upgrade,
we don't need this code anymore, as S->U is not supported anyway,
and T->U don't need placement to be migrated again

This reverts commit 3d6cedf859.

Depends-On: https://review.opendev.org/692509
Change-Id: I281d8974ee22e65da8d03c6784bcbbbe79648351
2019-11-07 15:03:00 +00:00
Dmitriy Rabotyagov e2eb2a50a2 Drop common-db tag from db_sync task
placement_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: Ibb2a119a7de0be0ea381d575e994c14df67e2ce8
2019-10-30 16:52:25 +02:00
Dmitriy Rabotyagov 5749be8efe Add venv path to $PATH for db migration
Placement migration tool looks for placement binaries in $PATH.
We should append venv to $PATH to make migration work
in source installs.

Change-Id: I0a062a7424ecc7cdcd5a2b2042cdf1f3faad916b
2019-10-25 18:29:38 +03:00
Dmitriy Rabotyagov 3d6cedf859 Add nova to placement DB migration
While transitioning nova-placement to placement we need
to migrate data [1]. This patch adds this required step for properly
migrating placement with all data.

[1] https://docs.openstack.org/placement/latest/admin/upgrade-to-stein.html#migrate-the-data

Change-Id: I4e03ee7c0ead78a1296a8bd8447bce771967d742
2019-10-17 16:00:00 +03:00
Zuul 86bca75853 Merge "Allow venv python interpreter to be overridden" 2019-09-10 05:10:38 +00:00
Zuul 484c508f34 Merge "Start using uWSGI role" 2019-09-06 21:25:42 +00:00
Jonathan Rosser ace6eab220 Allow venv python interpreter to be overridden
Change-Id: I438a3b5757ba17e7e54aa9b5e03334784e5ef651
2019-09-05 17:56:47 +01:00
OpenStack Proposal Bot 8d82dc92b8 Updated from OpenStack Ansible Tests
Change-Id: I07c204887f285aa6ce4b1578a9b786a102932f0f
2019-09-04 15:18:02 +00:00
Dmitriy Rabotyagov 0195d269b7 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: Ied4b59787e9707bc886c7bcba8f4ac50865edcb9
2019-09-02 16:02:56 +03:00
Dmitriy Rabotyagov cfb431c4af service_setup: refactor service setup to a single file
This patch refactors the openstack user/service/endpoints creation to
service_setup.yml which will eventually be managed by
openstack-ansible-tests.

Change-Id: I64e01de412c6d2bfff18910b48c5156577027f2b
2019-08-24 17:47:14 +03:00
Dmitriy Rabotyagov b561dbf67a Convert dynamic includes to static imports
When task/role files are included using include_tasks, tags are not
passed to the included tasks. As a result, tags like swift-config
do not have the intended effect. This patch changes include_tasks
to import_tasks for all cases where dynamic vars or loops are not used
so that tags are properly handled.

Reference -
https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse.html
https://bugs.launchpad.net/openstack-ansible/+bug/1815043

Change-Id: I9c222cfc28c6838099bc155bf2d023cfd6112816
2019-08-07 20:27:29 +03:00
Zuul b576febdaa Merge "Use systemd-journald instead of log files" 2019-07-17 06:42:19 +00:00
Dmitriy Rabotyagov ab692dbc56 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: Ib24a5c96359c349781c48a5d82d7c64e793b8e43
2019-07-17 00:16:26 +03:00
OpenStack Proposal Bot 945c65fc86 Updated from OpenStack Ansible Tests
Change-Id: Ibbdf62d1efc9c3571fd9c150e8c0786679022423
2019-07-16 14:52:46 +00:00
Jonathan Herlin 77e7096686 Fix deprecation warning
TASK [os_placement : Record the need for a service restart] ********************
[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using
`result|changed` use `result is changed`. This feature will be removed in
version 2.9. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.

Change-Id: Ic9ea32ea34af157b127ab84517c1ecefaac28ab8
2019-07-10 10:43:12 +00:00
Guilherme Steinmüller 2bdc2eebb2 db_setup: refactor database setup to a common file
This patch refactors the database creation to db_setup.yml which
will eventually be managed by openstack-ansible-tests.

 This also re-orders the mq_setup to be done earlier so these system
level dependencies are ready before service activation.

Change-Id: Ic9a12d7f04288f838cfc80c2b7725d20fec1dde9
2019-06-17 17:45:43 +00:00
Dmitriy Rabotjagov b7fb6ffe93 Drop private argument for include/import role
Since ansible 2.8 dropped private argument is not supported anymore:
https://github.com/ansible/ansible/issues/45038

Change-Id: Ic2d0c3de1db26b319cedab7ee1dacf997a87ff86
2019-05-17 11:58:59 +03:00
Mohammed Naser 2ee8cdc3d3 Update role for new source build process
The variables placement_developer_mode and placement_venv_download
no longer carry any meaning. This review changes placement 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 source build 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.

Change-Id: Ieac9e2fba7e222d31c29eebf699968455a727758
2019-03-28 13:44:05 -04:00
Guilherme Steinmüller 32c1eb8488 Add initial placement role
This patch adds the support for the placement service with
a simple functional test which hits the API (which in turn
hits the database and keystone for authorization).

Depends-On: I878e8c479d8963b339b5e1f6031f649c0f87082f
Change-Id: Iaa11a8cc4d945712b62c3b9c2cb6ad168def34eb
2019-02-06 15:47:53 -05:00