Commit Graph

54 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 6a25236b25 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: I9110294e492a501204c8e92448a2f2929781a509
2023-07-14 18:49:03 +02:00
Damian Dabrowski 0b6f8da608 Add TLS support to manila backends
By overriding the variable `manila_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the manila 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: I38b95b73301d2210f64105c20f389c74498a5345
2023-04-29 18:47:26 +02:00
Dmitriy Rabotyagov c0a1f262eb Create backends when running against manila_share
For backends creation we verify that API is reachable. With that on real
deployments we disable container we're running against on haproxy.

This results in task failure. To avoid that we add backends when
share/data services for manila. This is done in separate play when
all API backends should be enabled and functioning properly.

Change-Id: I6dcbae2896668f5fbb6f09bffc94cb6e90699e92
Closes-Bug: #1979209
2022-06-23 10:26:22 +02:00
Zuul b5426ccb9b Merge "Remove mention of haproxy-endpoints role" 2022-06-16 23:21:28 +00:00
Dmitriy Rabotyagov f728ca5707 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: Ie5ebb4d68ed06cff26462dc55092fda8a9ad2f44
2022-06-15 19:11:22 +02:00
Dmitriy Rabotyagov 0ea23558e7 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: Ia04bd0a729100ed3f0bade9185b0703ce903635f
2022-06-15 17:01:41 +00:00
Dmitriy Rabotyagov 0db9f1f959 Delegate share type creation to setup host
Instead of running manilaclient on manila host, we're delegating
execution to service_setup_host. This reduce
complexity and remove some requirements for manila hosts.

With that we also replace usage of manilaclient
with openstackclient.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/845998
Change-Id: Ie04d9e1690e0f053e86e28e0bf1d6c3aa43774b0
2022-06-15 14:32:02 +00:00
Zuul 77ce3dc017 Merge "Use common service setup tasks from a collection rather than in-role" 2022-01-13 13:35:46 +00:00
Jonathan Rosser 91da6dbee7 Use common service setup tasks from a collection rather than in-role
Change-Id: Ia350d1da1043513eefad6806813dcf1dc7fcd005
2022-01-12 17:30:00 +00:00
Jonathan Rosser f07b0f764a 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: I4983e2e13eb3ec29b0417094cf66629ce0f89052
2022-01-12 08:28:46 +00:00
Zuul 83fba27a14 Merge "Updated from OpenStack Ansible Tests" 2021-12-06 18:41:07 +00:00
OpenStack Proposal Bot 7593b2a1d2 Updated from OpenStack Ansible Tests
Change-Id: I5653b5209c227d414b3334a45dfe60b0f35b80d2
2021-12-06 09:00:13 +00:00
Dmitriy Rabotyagov 58c289d7cb 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
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/820008
Change-Id: I495f99d1378233d1b5d6ebc8ef101f683129a84f
2021-12-06 08:59:58 +00:00
Dmitriy Rabotyagov 0ccd0c0360 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/+/820010
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/820192
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/820417

Change-Id: I4198e13defb5b2f7fb443364027ccf902bf19c90
2021-12-06 08:59:08 +00:00
OpenStack Proposal Bot 415b5ad7a8 Updated from OpenStack Ansible Tests
Change-Id: I740d54d0610c3fc757f6569e927f0e9b31887c51
2021-06-03 10:46:00 +00:00
Dmitriy Rabotyagov 286414c2a6 Set manila_backends to empty dict by default
This simplifies logic across the role and not verify if variable is
defined each time we're attempting to use it.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/787341
Change-Id: I6db4ad6e6389b1ff63dc52a1e48c477a97905d17
2021-05-20 18:52:19 +00:00
Jonathan Rosser 590e0235ab Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I175072167602b6ec400d21b9350533a58901f890
2021-05-18 16:32:14 +00:00
Jonathan Rosser e85642f80c 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: I508c7aea34bb706b58fc69be8bfb6c06d50f2f40
2021-05-18 16:32:05 +00:00
Dmitriy Rabotyagov de29f07d77 [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.

CephFS Native hook has been removed since [2] as manila leverages MGR
now and doesn't require having directory in share.

Additionally bionic test is removed as we don't have Octopus infra
mirrors for it.

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

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/791202
Change-Id: I7a1807e4b984e31cb6250132f35d4c27f0b69b0c
2021-05-13 13:11:04 +00:00
Zuul dfc29c7bac Merge "Add Manila key generation and distribution" 2020-11-18 16:26:18 +00:00
Mohammed Naser a045397c57 Add Manila key generation and distribution
Change-Id: I2515dc4abf93f2d30157a376c8a9a497c865aaf5
2020-11-17 11:13:01 +02:00
OpenStack Proposal Bot c5bd07ab21 Updated from OpenStack Ansible Tests
Change-Id: Ieefa49bc6827aa24f268afd60a6a928a37e34738
2020-11-17 09:01:49 +00:00
Mohammed Naser abbfec221b 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.

Change-Id: I946adf21b58e117508dcc470c0fb3e9c2565c26d
2020-11-06 12:59:12 +00:00
Zuul 8244eafdae Merge "Define condition for the first play host one time" 2020-11-04 00:58:14 +00:00
Dmitriy Rabotyagov 4bbf35b981 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: I9dbb96df92711467aaa7676534adfd1f7013cb27
2020-11-01 12:17:23 +02:00
Dmitriy Rabotyagov 9ae55e0ebb 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: I6c46414fe773b85cea6d8e90d67450f712f96937
2020-10-30 17:40:54 +02:00
Zuul 5acd4d65b4 Merge "Updated from OpenStack Ansible Tests" 2020-08-25 11:12:33 +00:00
Dmitriy Rabotyagov 98738c9c6f 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: I51f7612381c6b7180cc1af1f564196aa08b2ed15
2020-08-20 19:00:34 +03:00
OpenStack Proposal Bot 3ab102c500 Updated from OpenStack Ansible Tests
Change-Id: Iff8acef9481ac4d6508e7e5b8bf817a5c9bc367d
2020-08-12 11:33:45 +00:00
Jonathan Rosser f6a41ea31b Ansible 'skipped' is a test not a filter
The old syntax is no longer valid in ansible 2.9

Depends-On: https://review.opendev.org/727827
Change-Id: I199c95b30ead538b8920ac73c924bc9a2756c8bc
2020-05-14 05:56:53 +00:00
Kourosh Vivan 6170d71caa Fix python path when deploy host is not localhost
When we don't use localhost as deploy host, we need to use
manila_service_setup_host_python_interpreter variable.

This variable give the correct python path (in a venv for example when
we use a utility container as a setup host)

Change-Id: I34070aad44cfcbb59773196b0f74c10225bc9124
2020-02-25 11:17:41 +01:00
Dmitriy Rabotyagov d09f038ac7 Fix _manila_backends fact
Previously _manila_backends was set only in case manila-share and
manila-api are the same host, which is the case only for aio deployments
Now fact will be set in an appropriate way.

This also drops facts refresh task since it's not need since queens and
uses tempfile for creating temporary directory

Change-Id: Ie5f95b7e80cd7fd26ee1f25aedf938abff131623
2020-02-20 17:23:22 +02:00
Mohammed Naser 67c4bc8316 refactor: service group names
The uwsgi role assumes that the keys used match the service names
and all of our other services follow this pattern so let's keep
it the same for this.

Change-Id: Id740ff6704bddad306f7470665717dd5c8674e82
2020-01-30 19:06:29 +02:00
Dmitriy Rabotyagov a97cbbd565 Add manila CI
This patch aims to fix and cleaup manila role and add CI into it.

Changes it implements:
* Fix endpoint creation
* adds playbook.yml in examples to use integrated linters check
* adds role CI tests using integrated repo
* adds sqlite installation

Depends-On: https://review.opendev.org/704163
Depends-On: https://review.opendev.org/702853
Depends-On: https://review.opendev.org/674653
Depends-On: https://review.opendev.org/703136
Change-Id: I0807180bd9b2ccbf2f1ebb6a72d74e9f0d126ba6
2020-01-30 14:07:20 +01:00
OpenStack Proposal Bot 6785a1ccfc Updated from OpenStack Ansible Tests
Change-Id: Iec0cf4be3ca3fe8575b732aca5224f0c1635731c
2019-11-01 13:43:54 +00:00
Dmitriy Rabotyagov ac36db35ea 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: Ie7533f10054abe382e21bca875d084449ee3047d
2019-10-21 18:34:59 +03:00
Jonathan Rosser 43038143e6 Allow venv python interpreter to be overridden
Change-Id: I8a9e586fb2e48eb13b7477e3ead6858cac902688
2019-09-11 21:02:25 +01:00
OpenStack Proposal Bot 990737a70a Updated from OpenStack Ansible Tests
Change-Id: I14fd536e09aa02131ec117b171eba6e3cad47045
2019-09-04 15:15:34 +00:00
Dmitriy Rabotyagov 203eb8772a smart_sources: Use config files from repo
Do not carry and maintain rootwrap and api files, since they are present
inside pip packages and deployed during installation.
This also adds deployment of rootwrap filters for manila-share nodes.

Change-Id: I41b680f5dcb5be92e3304c591d9a4705cf138a72
2019-08-08 16:00:18 +03:00
Dmitriy Rabotyagov 924fe699cd Fix db_setup condition
This patch changes condition when db_setup is launched
since it used non-existent key for retrieving host for execution.

Change-Id: I98fc2e4703cfec45da118958bf79a4bea70b5ff9
2019-07-29 20:14:42 +03:00
OpenStack Proposal Bot c558e90172 Updated from OpenStack Ansible Tests
Change-Id: I319aed777aae872ec8cb06e3a2d164f6fdda1763
2019-07-16 14:52:06 +00:00
OpenStack Proposal Bot 764f9356c7 Updated from OpenStack Ansible Tests
Change-Id: I4feee8b021c972f80f7997947e9387d15c30f99b
2019-06-18 18:16:04 +00:00
OpenStack Proposal Bot 2e7744dbbb Updated from OpenStack Ansible Tests
Change-Id: I63b3361c48332765d550daf59ee026d67a305a6d
2019-06-11 22:18:19 +00:00
Guilherme Steinmüller 6fe22f0f0f 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: I6941e8f928dca35791b313caafe7dbf9202ed689
2019-06-04 02:58:05 +00:00
Dmitriy Rabotjagov 747c7fdcb4 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: I9ae5bde63f2f2356b310e2b2d4f042cb250d13df
2019-05-17 11:54:20 +03:00
OpenStack Proposal Bot 3c09551ae1 Updated from OpenStack Ansible Tests
Change-Id: Ia0ea27cf3c09337e330666e09704940627ded02e
2019-05-09 11:34:53 +00:00
OpenStack Proposal Bot 41bab7f1c0 Updated from OpenStack Ansible Tests
Change-Id: I16963714dc2337d392a5cafffde21420b5f72272
2019-04-17 19:11:50 +00:00
OpenStack Proposal Bot 108503208a Updated from OpenStack Ansible Tests
Change-Id: I54e95e935b13b54d295de51f7562938a486f80af
2019-04-17 07:25:36 +00:00
OpenStack Proposal Bot ec32b233c2 Updated from OpenStack Ansible Tests
Change-Id: Ib3efeb76a522b1e8f20985e34b83e917a27e24eb
2019-04-13 20:22:45 +00:00
OpenStack Proposal Bot 90d05deae1 Updated from OpenStack Ansible Tests
Change-Id: Ibcf557058afdd27e50e2c5c1a6ee7318184028da
2019-04-01 13:19:00 +00:00