Commit Graph

57 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 06291ec0e6 Create required freepool aggregate
For normal functioning of Blazar reservation it expects a nova agregate exist
to be used for host reservation.

Thus, to make deployment more convenient for deployer we add fuctionality
of creating such aggregate.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/904786
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/878794
Change-Id: I7f56b8c8f2394d5fae1476441c8e2e2a5f07467c
2024-01-05 21:30:49 +00:00
Dmitriy Rabotyagov 9f6ea81c64 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: Ic97b301d704d3bc19142315a69724c05f3cad875
2023-07-13 16:41:33 +02:00
Damian Dabrowski 8b39e84ec1 Add TLS support to blazar backends
By overriding the variable `blazar_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the blazar 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: Ic784cb180ff4cbc81c230b0a3a62015a71ea3f99
2023-04-29 18:35:56 +02:00
Damian Dabrowski c9d10f41fa Add uWSGI support to blazar
This patch adds uWSGI support to os_blazar role. All openstack services
should stay behind uWSGI.

It's also required for upcoming TLS backend feature. Blazar does not
have native TLS support so it needs to be handled by uWSGI.

Change-Id: I65511de4d5014a28f0f91536f9dbaf96fcb8e7a2
2023-04-24 12:48:23 +02:00
Damian Dabrowski c1418e167a Fix blazar_service_type
As described in [1], blazar_service_type should be set to 'reservation'.
Otherwise blazar CLI won't be able to find its endpoint.

[1] https://docs.openstack.org/blazar/latest/install/install-without-devstack.html

Change-Id: I01874c617e5da75010c54b64901c90a986468807
2023-04-17 20:16:41 +02:00
Erik Berg 1ed399ce86 Remove redundant vars line
Introduced by the discreet commit 'update to the latest'

Change-Id: I4dac82dd4e6a51a7b0fc99ec80c5ae2fa7981ea7
2022-09-15 10:47:18 +02:00
Dmitriy Rabotyagov 711160baea 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: I3a1c2d87a39eaf342411f3b607bc909f924944cb
2022-06-15 17:43:49 +02:00
Zuul 99d47ee2c7 Merge "Use common service setup tasks from a collection rather than in-role" 2022-01-13 15:59:10 +00:00
Jonathan Rosser 5e30d71ade Use common service setup tasks from a collection rather than in-role
Change-Id: Ib6b44ea47b092463994f1a44e70113cad1d00687
2022-01-13 11:24:30 +00:00
Jonathan Rosser b616643319 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: Ibd7e65b25fca496a6393692c6952c9604430ec92
2022-01-12 08:40:21 +00:00
OpenStack Proposal Bot 2f857a0c18 Updated from OpenStack Ansible Tests
Change-Id: Ie6b17a25901c28e41febd686080c8d02316fce57
2021-12-04 17:39:36 +00:00
Dmitriy Rabotyagov c5d1740fbe 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: I8abcf60dcc8a264c221de89ff01906edf3ce8a39
2021-11-30 15:17:13 +02:00
OpenStack Proposal Bot 1cc9878d8d Updated from OpenStack Ansible Tests
Change-Id: I981fe2e8ef660afa35c621823c6b76e1f5cceb4e
2021-04-19 09:56:57 +00:00
Zuul 6e8ccf3f89 Merge "Allow to override blazar policy files" 2021-03-19 20:43:35 +00:00
Dmitriy Rabotyagov fcc6a1b6ea Allow to override blazar policy files
We implement `blazar_policy_overrides` variable in order to allow
management of balazar policy files when needed.

Change-Id: I581a9c9659d3d023eb40cf2c6dfc2d01fa0a7464
2021-03-16 16:44:37 +02:00
Jonathan Rosser e89bd175d5 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: Ib92816da66e068fc119c55118f07873e5dba748a
2021-03-16 08:00:11 +00:00
OpenStack Proposal Bot 8f7815fecc Updated from OpenStack Ansible Tests
Change-Id: I96bc9771890f3ea9cebe5a9dbbd78afc86d0c4cc
2020-10-19 09:19:37 +00:00
Zuul cabc6efeed Merge "Define condition for the first play host one time" 2020-10-06 09:28:24 +00:00
OpenStack Proposal Bot 9cc1c035be Updated from OpenStack Ansible Tests
Change-Id: I543e45ebc2bd326e30a0b73a937a8d24a8601dbd
2020-10-01 14:29:36 +00:00
Dmitriy Rabotyagov a969b5ee77 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: I6f1937c329292028e772fbe96d2466000726e4b7
2020-09-11 15:00:25 +03:00
Dmitriy Rabotyagov 509deba53e 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: I731f05f07a92696292c1aa5bdde99089d34566a3
2020-08-20 14:22:09 +00:00
OpenStack Proposal Bot 0740c4f856 Updated from OpenStack Ansible Tests
Change-Id: Ic8d55525e2b3bd9c24bc26e7222153f906bb9ad7
2020-08-12 11:32:09 +00:00
OpenStack Proposal Bot 83f9b3daf6 Updated from OpenStack Ansible Tests
Change-Id: I99f129c6decbdaa3e93f75b36ade5d7e9a0cb1c0
2020-06-08 19:53:58 +00:00
Dmitriy Rabotyagov f3e02ed688 Add missing common-mq tag
Change-Id: I577ed59fd5e192677139cf5f54d73abc78505009
2019-10-30 16:36:20 +02:00
OpenStack Proposal Bot 3d53ca08fe Updated from OpenStack Ansible Tests
Change-Id: I5f90751a5cb17562dc6b8bf7c6e1e8dd0c2f5882
2019-09-04 15:12:12 +00:00
Dmitriy Rabotyagov 5cecf29e03 Replace include with import
During previous commit include_task was accidentally copy-pasted.

Change-Id: Id42d77095754fefff640a4d48c6a3f48f2997f25
2019-08-07 14:16:11 +03:00
Dmitriy Rabotyagov cffac775bb 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: I0af7cd2087a03b16c2f7ffd818cf5074c233e89a
2019-08-01 18:29:03 +03:00
Dmitriy Rabotyagov 75e563b036 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 neutron-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: I14bfdc0e488ffd2db1d0b82afd773674819ee0f4
2019-07-17 16:55:57 +03:00
OpenStack Proposal Bot c2f0b83dd0 Updated from OpenStack Ansible Tests
Change-Id: I44079f29d39fddf004aac19f9d68fe2aaeb23da5
2019-07-16 14:51:12 +00:00
Guilherme Steinmüller 935ddb972f 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
M
level dependencies are ready before service activation.

Change-Id: Ibe6976b8f7ee56d74c2caf316ae5628e1926ef09
2019-07-15 12:51:20 +00:00
OpenStack Proposal Bot 1db7b090ff Updated from OpenStack Ansible Tests
Change-Id: Id00f614fa662991186d6c277fa3869413a9febca
2019-06-18 18:15:25 +00:00
OpenStack Proposal Bot 28db41eed2 Updated from OpenStack Ansible Tests
Change-Id: I1018841138da2c8d996a40198df4c165beecb464
2019-06-11 22:17:08 +00:00
Dmitriy Rabotjagov 9d19640d60 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: Iab1ab38cef54f11b6ec43581913ef2ef85fd5cbe
2019-05-17 11:50:02 +03:00
OpenStack Proposal Bot a5cf8531a7 Updated from OpenStack Ansible Tests
Change-Id: I4258b28531f3630f4629dbe36423574900736bed
2019-05-09 11:34:13 +00:00
OpenStack Proposal Bot 3c56e06b1c Updated from OpenStack Ansible Tests
Change-Id: I3887e5509d6066e9d728ffdc8f74b5130b739a14
2019-04-17 19:11:19 +00:00
OpenStack Proposal Bot 2e3fd857ba Updated from OpenStack Ansible Tests
Change-Id: I947d1f1b20cbbd7ef0d042f43047a5231b956d76
2019-04-17 07:25:06 +00:00
OpenStack Proposal Bot b52fef9ba7 Updated from OpenStack Ansible Tests
Change-Id: I166569894450325ae6d0b830c9f9ef36c3bb1f67
2019-04-13 20:21:39 +00:00
OpenStack Proposal Bot 4da29c63cf Updated from OpenStack Ansible Tests
Change-Id: I4373366519890141c0b6d1575e0416087d737c3d
2019-04-01 13:18:29 +00:00
Mohammed Naser 4b0a53b3a3 Update role for new source build process
The variables blazar_developer_mode and blazar_venv_download
no longer carry any meaning. This review changes blazar 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.

It looks like the project now needs authentication for the root
of the host so we'll test for that instead of 204.

Change-Id: Id1dc8d378cb57d6ab2b59da76468a4a0859466b1
2019-03-28 13:53:48 -04:00
Jesse Pretorius cb561cc870 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: Id634d63517f891a97245e08b3965f387c49bb222
2018-11-30 15:33:25 +00:00
OpenStack Proposal Bot 97c1893870 Updated from OpenStack Ansible Tests
Change-Id: I1ade0f2eff296578d8cf0e64edad8c4718f6d74b
2018-09-28 06:18:49 +00:00
Taseer 3d2f1bf465 Add the MQ vhost/user creation and configuration
Change-Id: If92a53d9447c09e9a1388ca99b25380bb301b1bf
2018-09-24 12:35:47 +02:00
Taseer Ahmed 0ad0677d26 Fix functional tests for Blazar
The functional test check the responsiveness of the Blazar API. A
return of 204 code from the API verifies the success.

Rest of the changes ensure compliance with all the standards required
to make the linter and docs tests pass.

Change-Id: I640877817ad1ae312436932af87ad15094616f12
2018-09-04 18:38:34 +05:00
Jesse Pretorius 41910f2ab7 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: Ia84e9f0a7b7627182e4b10aa3fc4f0d708edfee8
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-09-03 11:06:40 +00:00
caoyuan 0dbe839d49 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: I3c341295715f974a30eed72c0a1c2f2fdcdf8bb3
2018-08-15 17:08:26 +08:00
Kevin Carter ed9e0d5399
Convert role to use a common systemd service role
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.

Change-Id: Ife802766cefa8862f2b0e42f06c100b30d65edf8
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-07-31 14:56:47 -05:00
Jesse Pretorius c7bc980de3 Execute service setup against a delegated host using Ansible built-in modules
In order to reduce the packages required to pip install on to the hosts,
we allow the service setup to be delegated to a specific host, defaulting
to the deploy host. We also switch as many tasks as possible to using the
built-in Ansible modules which make use of the shade library.

The 'virtualenv' package is now installed appropriately by the openstack_hosts
role, so there's no need to install it any more. The 'httplib2' package is a
legacy Ansible requirement for the get_url/get_uri module which is no longer
needed. The keystone client library is not required any more now that we're
using the upstream modules. As there are no required packages left, the task
to install them is also removed.

With the dependent patches, the openstack_openrc role is now executed once
on the designated host, so it is no longer required as a meta-dependency for
the role.

Change-Id: Ib41f12b837f73ea534c6a0f926a70f7a82d7a194
2018-07-17 10:34:02 +01:00
Jean-Philippe Evrard 4c79f16d80 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: If24282ee9c81ee73e8861b62ecef6736d7c0b054
2018-07-12 15:18:24 +00:00
Jesse Pretorius 1976e84796 Move database creation into role
There is no record for why we implement the database 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 a new variable called 'blazar_db_setup_host'
which is used in the role to allow delegation of the database setup
task to any host, but defaults to the first member of the galera_all
host group. We also document the variable blazar_galera_address which
has been used for a long time, but never documented. A bunch of unused
variables have also been removed.

Change-Id: Id500e2b2a5b981609becc883edd3d166f70103f4
2018-06-12 20:00:15 +01:00
Jean-Philippe Evrard a9ff199983 Add blazar base jobs
This introduces the most basic jobs for blazar, and makes
sure blazar passes lint tests.

This reverts commit a5b35ebf11,
effectively re-enabling zuul jobs, and adapts the role
to our latest standards (The lint tests were failing, as
the passwords were logged while setting up Blazar server)

Functional testing starts with -nv only. However, in this
commit we added the necessary `rabbitmq_all` group to
the infra1 group, to help further functional testing.

Co-Authored-By: Taseer Ahmed <taseer94@gmail.com>
Change-Id: Ic2560b53aebf69e4784ce56db6929fe010e6b11e
2018-05-29 12:09:47 +02:00