Commit Graph

124 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 9ab52c9d2a Adopt for usage openstack_resources role
With efforts to create a resources in same, unified way,
we convert tempest role to use openstack_resources
for creating and managing openstack resources, like projects, flavors,
networks, images, etc. This should reduce maintenance costs
in case of futher collection updates and unify approach.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/878794
Change-Id: I848ab09f8b6c81681f0ce0b5c0cc53b5653791c5
2023-11-10 13:12:57 +00:00
Dmitriy Rabotyagov 045f45c12c 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: Iaab0ad50fd65287094522f77283a0112859d7730
2023-07-14 20:58:47 +02:00
Damian Dabrowski 2d1f4b405b Add TLS support to trove backends
By overriding the variable `trove_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the trove 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: I15223354a28f0cc6c203f0cb3a19b9af834d4158
2023-04-29 18:44:15 +02:00
Dmitriy Rabotyagov 7b326d50c7 Adopt project_info fetch to collection 2.0
With ansible-collection version 2.0 return of project_info module
has changed. We need to adopt usage of module return to the new format.

Change-Id: Ib4f3ced7f2175e5187f8c16f88fbfbcb3a472d0b
2023-04-10 18:30:47 +02:00
Dmitriy Rabotyagov 27880b4b50 Change networks_info output structure
With commit [1] to collection output structure of networks_info module
has been changed. With that we adpot to the new format.

[1] 9272146cf7

Change-Id: Ia0d50b96a4af59352a89c566137d8b0208338b6b
2022-08-29 20:16:49 +02:00
Dmitriy Rabotyagov 3ddd45d335 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: I7b01de89b459b4992ed9531e6c81259af21ba997
2022-06-15 19:37:00 +02:00
Zuul 735f536e01 Merge "Use common service setup tasks from a collection rather than in-role" 2022-01-13 13:16:54 +00:00
Jonathan Rosser a0710f538e Use common service setup tasks from a collection rather than in-role
Change-Id: I02152618bd19800316b875f04da9e907f3446510
2022-01-12 17:21:32 +00:00
Jonathan Rosser 910fd589b7 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: I41a360e6f99ecd0ca5e4c13888bff4f363d8bc33
2022-01-12 08:07:10 +00:00
OpenStack Proposal Bot e19e27133b Updated from OpenStack Ansible Tests
Change-Id: I0e76cf0c6060dbd14707fb8d4b8a4ff993ab20c1
2021-12-04 17:41:51 +00:00
Dmitriy Rabotyagov d1e1b65144 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: I377c7b182861a8c53c3ab43690c2bed0d648f3ae
2021-11-30 15:17:28 +02:00
Dmitriy Rabotyagov 390989cfc7 Do not override service project description
By default OSA shares `service` project across services. So we should
not override _project_description with services

Change-Id: I0e194c5bf0ae4de1c9dd906c36955b6217d3f601
2021-04-23 10:35:25 +03:00
Zuul 418be1cebe Merge "Update trove configuration" 2021-04-22 16:01:27 +00:00
Zuul eca0398277 Merge "Updated from OpenStack Ansible Tests" 2021-04-19 15:55:28 +00:00
OpenStack Proposal Bot 10ae1b5f20 Updated from OpenStack Ansible Tests
Change-Id: Ib09b4341ebfe263490c9dde65ed7d0253e3ea170
2021-04-19 10:00:18 +00:00
Dmitriy Rabotyagov c92b99d3f4 Update trove configuration
We haven't payed attention to the trove for a while and we need to
align configuration with current state of the service.
trove-conductor and trove-taskmanager configs are not
loaded by trove services anymore (at least by default), so we merge all
options into trove.conf

Also defaults and deprecated options are dropped from the config.

We implement bunch of new variables to cover missed logic and
some usecases.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/784565
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/784113
Change-Id: I2ba758de38ed3fee10fe1485aa25621eddbf9046
2021-04-14 10:18:29 +00:00
Dmitriy Rabotyagov 0de33a0243 Use uWSGI for trove-api
This migrate trove-api to usage of the uwsgi from native service to
align with other service way of deployment and since that's how service
is tested in devstack.

Change-Id: I83ad3af282942ff9714757e863f393894ac35f45
2021-04-14 13:17:44 +03:00
Zuul ec9de1702a Merge "Use ansible_facts[] instead of fact variables" 2021-04-13 11:26:45 +00:00
Dmitriy Rabotyagov 875954ef3c Add image upload option
Allow deployers to manage trove guestimages with trove role. This will
allow us to correctly test role with tempest, since we were not able to
upload images with tags otherwise

Change-Id: If2f550ef09cd01ec5eab485f0d81ecfaf32f924f
2021-04-08 09:09:06 +00:00
Dmitriy Rabotyagov eccf80bb7f [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.

config_template has been choosen instead of the copy, since it can
properly handle content that has been lookuped.

We make a separate task not to restart service when it's not needed.

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

Change-Id: I866fea573429ddcedf1547d9fa8a7caae448eca2
2021-03-30 16:54:44 +00:00
Jonathan Rosser f67c296bff Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I29de46e830e0a63c1da90043ec08c5dcc56b7e3e
2021-03-25 10:20:05 +00:00
Dmitriy Rabotyagov d14cd8cea4 Retry on creating trove network
For pretty weird reason, first request to create a network to the neutron
fails with 500 without reasonable stack trace. Re-running request succeeds.
So we adding retries to the task which resolves metnioned issue.

Change-Id: I5b09dc3bc52d98df756cdc60c5e94cd1e7344e9a
2021-03-24 18:18:22 +00:00
Dmitriy Rabotyagov 3791237a51 Use new openstack.cloud collection names
os_ prefixed module names are deprecated for a while and will be removed
Current usage generates a warning for users.

Change-Id: Ie473569d866d6d8a9995f73f7cf5472e60589523
2021-02-16 21:33:15 +02:00
Dmitriy Rabotyagov 0629e28768 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: Ic2fa270a3582db3da01b3c449fbdd8c2d5045062
2021-01-08 19:02:06 +02:00
OpenStack Proposal Bot 65c50b48b6 Updated from OpenStack Ansible Tests
Change-Id: If6ce227ac1e57905b1626a30d2227dffd86a5170
2020-10-19 09:21:08 +00:00
Zuul 24f2244fa0 Merge "Define condition for the first play host one time" 2020-10-06 12:16:06 +00:00
OpenStack Proposal Bot ce741dbfa6 Updated from OpenStack Ansible Tests
Change-Id: I4634270912d8430d3b84d808877ee4e7c25c8967
2020-10-01 14:32:22 +00:00
Dmitriy Rabotyagov 7fffe91d5a 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.

Depends-On: https://review.opendev.org/755484
Change-Id: If7f26c8020d4b02ab9e82dcb69a7ba91a3b5d145
2020-10-01 13:41:06 +00:00
Dmitriy Rabotyagov 653aeffecf 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: I4f469df19bb371b0d38a6438a05054cd21152abd
2020-08-20 19:46:21 +03:00
OpenStack Proposal Bot e64fb69561 Updated from OpenStack Ansible Tests
Change-Id: I2edce5e48d0a1009841bdcdc9c75f84ad14b5c2e
2020-08-12 11:35:41 +00:00
Zuul 9e4b4ac8c6 Merge "Updated from OpenStack Ansible Tests" 2020-06-09 07:52:31 +00:00
OpenStack Proposal Bot ec2278b8ad Updated from OpenStack Ansible Tests
Change-Id: I81ffb9867dfb74fd96cdcf714e9f984cc6ddaad7
2020-06-08 19:57:25 +00:00
Jonathan Rosser e07ea77e58 Use ansible openstack collection
Depends-On: https://review.opendev.org/718431
Depends-On: https://review.opendev.org/718362
Change-Id: I7f82e588e297d85a66c20500adc0b06da895717f
2020-05-20 14:00:28 +01:00
Jonathan Rosser d396b68028 Replace usage of deprecated os_*_facts ansible modules
These are changed to os_*_info modules which return their data
not as facts but via ansible registered variables.

Change-Id: I5a3b2cbcfadeb88f60d9ce2c94cdd949cd0c14ed
2020-05-14 13:46:05 +00:00
Kourosh Vivan 04aa9a527a Fix keystone API call
API call should use trove_service_net_endpoint_type

Change-Id: Ib25705c08787164d2f070cc4acbdc0837bc30c8b
Close-bug: #1738529
2019-11-13 15:00:39 +01:00
Zuul 0e6301003f Merge "fix the spelling mistake" 2019-09-20 15:20:44 +00:00
jiasirui 315cf27026 fix the spelling mistake
Change-Id: Ief8809b3d2a62e2bf07b68962fd071f466cf0048
2019-09-12 18:54:57 +08:00
Jonathan Rosser 9028ee66a2 Allow venv python interpreter to be overridden
Change-Id: Ie45c77b2c775cdde343b0281b42c38e39f10f3bf
2019-09-11 21:39:13 +01:00
Zuul 854b22e45f Merge "Updated from OpenStack Ansible Tests" 2019-09-10 16:16:00 +00:00
OpenStack Proposal Bot bc9082b24d Updated from OpenStack Ansible Tests
Change-Id: I1f11d711ce8d543262e12b73a0b0d39b9ec78ca8
2019-09-04 15:19:35 +00:00
Dmitriy Rabotyagov 00ab880a0d Drop mod_wsgi support
As we don't provide wsgi file for mod_wsgi deployment (despite
having task to do that) and trove package don't contain wsgi application
we should drop apache mod_wsgi part of the setup as it's not functional.

Change-Id: I0a12fad27d3f994d79ead52ac90873a1e1362144
2019-09-04 14:47:05 +03:00
Dmitriy Rabotyagov 4e93d82133 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: If4896f1711ac655c33b6d4132ffd74085cb0f3b1
2019-08-08 14:09:55 +03:00
Zuul 4a3afe0043 Merge "Convert dynamic includes to static imports" 2019-07-18 21:18:08 +00:00
Dmitriy Rabotyagov 72f165602c 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 trove-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: I754049a0e37daadddf1fa52a3b651284ee02b27e
2019-07-17 20:03:22 +03:00
Dmitriy Rabotyagov ed8d692fa9 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: Ib16362a8becb6666f36e5abdb93c548de2a269da
2019-07-17 19:52:24 +03:00
OpenStack Proposal Bot 4261ed8ce0 Updated from OpenStack Ansible Tests
Change-Id: I6fabafcbca658070c697941b1d1d2961e86a225b
2019-07-16 14:53:17 +00:00
Zuul b3ea1035ff Merge "db_setup: refactor database setup to a common file" 2019-06-27 14:05:07 +00:00
OpenStack Proposal Bot 10399145d3 Updated from OpenStack Ansible Tests
Change-Id: Ie0a83f428d75c4c5f8c6e14df9084c21da53275e
2019-06-27 10:23:33 +00:00
Guilherme Steinmüller e4a8d5540d 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.

Depends-On: https://review.opendev.org/667287

Change-Id: I7c0bd52aab6c704548d969bb6dc8a5dea3eed8c0
2019-06-25 20:15:12 +00:00
Jonathan Rosser 951924ab51 Use keystone catalog and fix looking up and storing admin tenant id
Trove is now able to properly use the service catalog [1].

We have another[2] patch that this patch depends-on, which
causes us to have a circular dependency. As the change is minimal,
should be ok to squash them together to be able to fix that role.

The paragraph bellow contains the commit message of the patch that is
being squashed.

The 'Get admin tenant id' task was passing invalid arguments to the
os_project_facts module, and the 'Store admin tenant id' task was not
using the correct variable to retrieve the project id.

[1] https://review.opendev.org/#/c/574254/
[2] https://review.opendev.org/#/c/665458/

Change-Id: I779ba715d20d83b1efe4f07226a5eadd7e0a1870
2019-06-25 19:00:52 +00:00