Commit Graph

100 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 1c49c7d2c8 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: I30eff91392dcab1e76c4fee89ead7a6e03838b2d
2023-07-14 19:56:42 +02:00
Damian Dabrowski 81a0273a50 Add TLS support to sahara backends
By overriding the variable `sahara_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the sahara 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: I28e2a2ac7a2534f731f1ce8b0c76f6c55e987eb2
2023-04-29 18:43:28 +02:00
Dmitriy Rabotyagov 816e498c5c 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: I7064765e62d9e1a86fb20232429731840f697a88
2022-06-15 19:20:56 +02:00
Marc Gariepy 2ce1f60bde Use common service setup tasks from a collection rather than in-role
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_tempest/+/842758
Change-Id: I1e637517953ba9a65e987c181464678c81365ec0
2022-05-20 19:02:52 +00:00
OpenStack Proposal Bot 81d675530b Updated from OpenStack Ansible Tests
Change-Id: Id47719feff8528c0d671022a470d683d29d176ad
2021-12-04 17:41:17 +00:00
Dmitriy Rabotyagov 54a6645c5a 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: If7ed1c8281d3e78c5905ccc570456e998d191370
2021-11-30 15:17:26 +02:00
Dmitriy Rabotyagov 183f5f739d Fix linters
Change-Id: I8d2e355830713b34722d1db5ca89f6d8375510f8
2021-05-27 13:12:59 +00:00
Zuul 92004f42fe Merge "[goal] Deprecate the JSON formatted policy file" 2021-04-20 11:02:22 +00:00
OpenStack Proposal Bot ece2defc0e Updated from OpenStack Ansible Tests
Change-Id: I0a78a8fc1d9e662940636ae4e30250290fbcf250
2021-04-19 09:59:39 +00:00
Dmitriy Rabotyagov 63c3e47a57 [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

Depends-On: https://review.opendev.org/c/openstack/sahara/+/768521
Change-Id: I606e1dda74f630242905fdf74ee19eaf66030edf
2021-04-06 13:00:17 +00:00
Jonathan Rosser b8f9f0432f Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I5f2438f064fe097b990dfdd433cc6fb84cd3b3d3
2021-03-16 08:16:22 +00:00
OpenStack Proposal Bot 3a74d75eac Updated from OpenStack Ansible Tests
Change-Id: I3a7e51ddd0a35f4305e0ad73fac6d7eb381f1570
2020-10-19 09:20:52 +00:00
OpenStack Proposal Bot 616e413561 Updated from OpenStack Ansible Tests
Change-Id: I06b5a6349cb809cf675f7f458dfb98a4c6577998
2020-10-01 14:31:55 +00:00
Dmitriy Rabotyagov 602e895307 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: I33362163d54a1b54ba4a0cd13764f28fe6485040
2020-09-25 18:16:07 +03:00
Dmitriy Rabotyagov 0dcd1ba011 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: I1564252d2362dbb5858e1d0222c3b344488d389d
2020-08-20 19:38:35 +03:00
OpenStack Proposal Bot 7be619bd4d Updated from OpenStack Ansible Tests
Change-Id: I829fe45c699becb0530928a3dee0a20dc904feb5
2020-08-12 11:35:11 +00:00
OpenStack Proposal Bot e46b5437d7 Updated from OpenStack Ansible Tests
Change-Id: Ieb327c6c18a4b6c60c816929c7bf3ee555b6ca79
2020-06-08 19:56:56 +00:00
Jonathan Rosser e0328cc68e Allow venv python interpreter to be overridden
Change-Id: I37300557a4318e7468298b5575e7dec02bae7eff
2019-09-11 21:26:28 +01:00
Zuul f6f8799439 Merge "Start using uWSGI role" 2019-09-06 15:33:22 +00:00
Dmitriy Rabotyagov dde6129387 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: Iaca1e2f680d7281b4d8c0fd47907823a515f4240
2019-09-06 10:07:39 +03:00
OpenStack Proposal Bot 2358a41ae2 Updated from OpenStack Ansible Tests
Change-Id: I6f0dd06cd3143d0a25b234f75972cc868c196bdd
2019-09-04 15:18:35 +00:00
Dmitriy Rabotyagov 6d8b558f17 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: I45b018381a9958e3df12d1eccd5fafc0fcc45ad0
2019-08-07 20:55:24 +03:00
Dmitriy Rabotyagov 4e78f8b6f8 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: I0f9eeeb5db890ba2119f7e8a5e85b9f6923092d6
2019-07-18 13:06:00 +03:00
Dmitriy Rabotyagov b9af252909 Convert systemd services to common role(s)
This removes the systemd service templates and tasks from this role and
leverages a common systemd service role instead. This change removes a
lot of code duplication across all roles all without sacrificing
features or functionality. The intention of this change is to ensure
uniformity and reduce the maintenance burden on the community when
sweeping changes are needed. The exterior role is built to be OSA
compatible and may be pulled into tree should we deem it necessary.

Change-Id: If8a201dd964ea769c688f78abc2a688782e3be4d
2019-07-18 13:04:31 +03:00
Dmitriy Rabotyagov 59d2acb823 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 sahara-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: I74bda8876e0f043cd7362ab04fcdb74d24d35d72
2019-07-18 12:49:06 +03:00
OpenStack Proposal Bot fb4405991d Updated from OpenStack Ansible Tests
Change-Id: Ie981b6b8c3e8da18ca76628ea2c53b08ec09c1fc
2019-07-16 14:52:57 +00:00
Zuul 0426a2a7f6 Merge "Updated from OpenStack Ansible Tests" 2019-07-15 22:25:19 +00:00
Guilherme Steinmüller 0d4cf84f1e 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/668019

Change-Id: Ic8f7f2dc97cb8160bab123a87a2673675cff4c15
2019-06-27 18:45:48 +00:00
OpenStack Proposal Bot ed03494268 Updated from OpenStack Ansible Tests
Change-Id: I24403fa111f48244f4f1c47b1800897b86ee4f46
2019-06-27 10:23:08 +00:00
OpenStack Proposal Bot 01913d4069 Updated from OpenStack Ansible Tests
Change-Id: I7546f8730378a4d31e10a9b18c35c0baa4809b9f
2019-04-17 19:12:14 +00:00
OpenStack Proposal Bot bbc862c868 Updated from OpenStack Ansible Tests
Change-Id: Id7e0fc21a66fcbdaadad66662d3f8b4bb3029431
2019-04-17 07:25:57 +00:00
OpenStack Proposal Bot 97f2e8e906 Updated from OpenStack Ansible Tests
Change-Id: I92b572e0a6471eba8289f6fc9c366662b073b6ad
2019-04-13 20:23:36 +00:00
OpenStack Proposal Bot 5f12cec733 Updated from OpenStack Ansible Tests
Change-Id: I2abe94b7a4c780366717ea6e12b205d5c1ca7853
2019-04-01 13:19:22 +00:00
Guilherme Steinmüller cb1098d25c Update role for new source build process
The variables sahara_developer_mode and sahara_venv_download
no longer carry any meaning. This review changes sahara 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: I74f5fa25b70fbb5c514af3a72b5b6654d5c8e24d
2019-03-27 17:00:06 +00:00
Zuul 54efce28bd Merge "Remove the private option from include_role" 2019-03-20 05:16:36 +00:00
Luigi Toscano ed7ccad898 Fix deployment and tests (correct URIs, plugins)
- install also the Sahara plugins. The existing variable sahara_plugin_base
  is now used also for the list of installed plugins, in addition to
  the list of loaded plugins.
  The default set includes now all the available plugins.
- fix the URIs used by role tests. They will eventually go away
  in favor of the integrated tests, but they are needed right now.

Change-Id: I5a4066ad9e2cca7bbfeb82bca5b2e65badef2e22
2019-03-12 22:49:02 +01:00
Kevin Carter 45a9538013 Remove the private option from include_role
The private option on include role was never implemented and
will no longer be developed. This change removes the option
so ansible no longer raises a deprecation warning.

Change-Id: Ifb39c4b7daf1b781bfd894cd426c9e21451b9390
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2019-02-22 00:40:07 +00:00
Jesse Pretorius 5accd3d078 Enable overriding the service setup host python interpreter
In order to enable the service setup host python interpreter to
be changed easily, we make it a variable. This will be useful
when someone sets the service setup host to be the utility
container, because we'll be able to set this var by default.

Change-Id: I6ff22dd4438df02b4a485ae75e8ea895c0f8f57e
2018-11-30 16:29:12 +00:00
ZhijunWei 7f595f01b1 Update messaging notification configuration
This patch removes the conditional inclusion of the notification
section of the service configuration. This ensures that oslo.messaging
notifications use the correct transport for deployments that have
separate rpc and notify messaging backends. For example, if the
transport_url is not provided in the notification section of the
service configuration, the transport_url specified in the default
section will be used instead.

This patch conditionally selects the notifier driver. The noop
driver will be selected when notification publishing is disabled.
The messagingv2 driver is selected when notification publishing is
enabled.

Change-Id: Ib68aa2669b5d70626ed2777d5601d8914207451d
Closes-Bug: #1794320
2018-09-27 02:03:41 +00:00
Luigi Toscano 98c27423a9 Deploy Sahara with unversioned endpoints
Sahara supports unversioned endpoint also for the stable API v1.1,
and this is a requirement in order to use the experimental API v2.
See https://review.openstack.org/#/c/582285/ for more details.

Following the pattern used for other services with unversioned
endpoints, the sahara_service_*uri variables are directly and all
sahara_service_*url can thus be removed.

Closes-Bug: #1782147
Change-Id: I2d4477de6a3ad58fe58152b18e18a9a6dffdafd4
2018-09-13 23:21:40 +02:00
Zuul 41bdfdb798 Merge "use include_tasks instead of include" 2018-09-08 21:22:22 +00:00
Jesse Pretorius 284ffef2a5 Use a common python build/install role
In order to radically simplify how we prepare the service
venvs, we use a common role to do the wheel builds and the
venv preparation. This makes the process far simpler to
understand, because the role does its own building and
installing. It also reduces the code maintenance burden,
because instead of duplicating the build processes in the
repo_build role and the service role - we only have it all
done in a single place.

We also change the role venv tag var to use the integrated
build's common venv tag so that we can remove the role's
venv tag in group_vars in the integrated build. This reduces
memory consumption and also reduces the duplication.

This is by no means the final stop in the simplification
process, but it is a step forward. The will be work to follow
which:

1. Replaces 'developer mode' with an equivalent mechanism
   that uses the common role and is simpler to understand.
   We will also simplify the provisioning of pip install
   arguments when doing this.

Depends-On: https://review.openstack.org/598957
Change-Id: Ibd021f211f4608636e27283ca831aac4e3ef4efe
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-09-03 11:09:32 +00:00
OpenStack Proposal Bot 1a41e46e54 Updated from OpenStack Ansible Tests
Change-Id: I3d7e7e8a85f8611d547c7f3075b8ca8859fe3c51
2018-08-20 10:50:09 +00:00
ZhijunWei 55df48c58f use include_tasks instead of include
include is marked as deprecated since ansible 2.4[0]

Switch to include_tasks or import_playbook as necessary

[0] https://docs.ansible.com/ansible/2.4/include_module.html#deprecated

Change-Id: Idf00933d271b5e80bda9113ccaa1f3bc71eb60c6
2018-08-19 12:43:59 -04:00
OpenStack Proposal Bot 227705955e Updated from OpenStack Ansible Tests
Change-Id: I511a09f0aa5c548754ba6ed70a8db7470401b87a
2018-08-15 13:41:59 +00:00
Zuul 806629b39c Merge "Setup oslo.messaging extra packages for optional drivers" 2018-08-09 06:18:54 +00:00
Jesse Pretorius a9455eb451 Allow tags to be used for MQ tasks
The use of 'include_tasks' and a loop of variables creates
a situation where a user is unable to use tags to scope the
inclusion of only the MQ tasks when running the playbooks.

The use-case this is important for is when the rabbitmq
containers are destroyed and rebuilt in order to resolve
an issue with them, and the user wishes to quickly recreate
all the vhosts/users.

Ansible's 'include_tasks' is a dynamic inclusion, and dynamic
inclusions are not included when using tags. The nice thing
about dynamic inclusions is that they completely skip all
tasks when the condition does not apply, cutting down deploy
time. However, given the use-case, we should rather take on
the extra deployment time.

This patch changes the dynamic inclusion to a static one,
adds a 'common-mq' tag to cover all MQ implementations,
and re-implements the 'common-rabbitmq' tag for the tasks
that relate to RabbitMQ specifically.

It also implements conditionals for each task set so that
the rpc/notify tasks can be skipped if a vhost/user is not
required for that purpose (eg: swift does not use RPC, and
most roles will not use notifications by default).

Depends-On: https://review.openstack.org/588191
Change-Id: I077a267824b6142874d052d10227ea055abd6069
2018-08-07 15:01:40 +01:00
Jean-Philippe Evrard 7fbcb8c98b Fix usage of "|" for tests
With the more recent versions of ansible, we should now use
"is" instead of the "|" sign for the tests.

This should fix it.

Change-Id: Ib42bf56d7151f5af957041e4e61b7cf646819565
2018-07-30 10:51:39 +02:00
Andy Smith cb44aacbe0 Setup oslo.messaging extra packages for optional drivers
Change-Id: I5d29c1f459a62de868c8342e843025093b92f5fc
2018-07-27 14:10:33 -04:00
Jesse Pretorius 3b86334e2f Move MQ vhost/user creation into role
There is no record for why we implement the MQ vhost/user creation
outside of the role in the playbook, when we could do it inside the
role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we implement two new variables:
- sahara_oslomsg_rpc_setup_host
- sahara_oslomsg_notify_setup_host

These are used in the role to allow delegation of the MQ vhost/user
setup for each type to any host, but they default to using the first
member of the applicable oslomsg host group.

We also adjust some of the defaults to automatically inherit existing
vars set in group_vars form the integrated build so that we do not
need to do the wiring in the integrated build's group vars. We still
default them in the role too for independent role usage.

Change-Id: I72c26ad851beb5a48cd2d841dca67c547a074847
2018-07-17 22:08:56 +01:00