Commit Graph

146 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov bf019ab6d7 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
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/888517
Change-Id: I53c0166beb446802641c701f6e43d5e317f9d54a
2023-08-23 09:31:20 +02:00
Damian Dabrowski 4b2134df19 Add TLS support to aodh backends
By overriding the variable `aodh_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the aodh 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: Ibb4d7b465f07fff6c172b38aa647fd8d6a4fcd43
2023-04-29 18:35:33 +02:00
Erik Berg f6ff84cdcc Remove redundant vars line
This line snuck in with I6e1931e55c3b492ea0b5eb6e093c7cb5f5e826ac
probably to bring it in line with other OSA roles, but should already
be covered by the distribution_major_version line above.

Change-Id: Ia84ef13bb31b52e7f3875ed731cf06ddbcdb5951
2022-09-15 10:40:51 +02:00
Dmitriy Rabotyagov 3e94523ec7 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-os_gnocchi/+/846347
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/845690
Change-Id: I883d84859811714362c5b58f33dfae808317bfdc
2022-06-17 13:40:57 +00:00
Jonathan Rosser e70f0e2bef Use common service setup tasks from a collection rather than in-role
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/834889
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_ceilometer/+/840724

Change-Id: I9afa64ad181656a3594e364f06442eac0282de5f
2022-05-05 19:30:31 +00:00
Jonathan Rosser 88c914ac6b 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: I6e1931e55c3b492ea0b5eb6e093c7cb5f5e826ac
2022-01-12 11:17:20 +00:00
OpenStack Proposal Bot 6ab60d2ed1 Updated from OpenStack Ansible Tests
Change-Id: I005c91c73321bcf2b3d90488637adab28ea9aea4
2021-12-04 17:39:29 +00:00
Dmitriy Rabotyagov 4546eb97ee 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: I8012108a59b52156fefc0d73011465066f922c4e
2021-11-30 15:17:15 +02:00
Zuul 9a099cc13f Merge "Updated from OpenStack Ansible Tests" 2021-05-06 14:46:59 +00:00
Dmitriy Rabotyagov 705b782589 [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.

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/openstack-ansible-os_gnocchi/+/781513
Change-Id: Ifd1190981a2c50b54efa129f60b0d4a0f448bb60
2021-05-05 19:15:53 +00:00
OpenStack Proposal Bot b8dfe761d6 Updated from OpenStack Ansible Tests
Change-Id: I0082c74d11fe802207c9f20929895e7cb4284b18
2021-04-19 09:56:44 +00:00
Jonathan Rosser 37efa0a469 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I83375d4d96fee13c21dc133dbf5a5b8ed64b826a
2021-03-16 07:58:51 +00:00
Jonathan Rosser c25a19af45 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

Depends-On: Ia88b8e606a19ad8ee20665e125df1079b0a771ff
Change-Id: I88c4317a711ec9c8e00b13a2f4deede1e53830b1
2021-03-11 14:37:27 +00:00
OpenStack Proposal Bot 445242ed3f Updated from OpenStack Ansible Tests
Change-Id: I55dd0147b687baab8dd806a6569418a7888e5c2f
2020-11-10 10:10:12 +00:00
Zuul fdff574188 Merge "Updated from OpenStack Ansible Tests" 2020-10-13 12:21:17 +00:00
Dmitriy Rabotyagov 84aadded6a Trigger uwsgi restart
When we were migrating service to uwsgi usage, we clean forgot to
trigger uwsgi restart on service config change.

Change-Id: I267740e0a2c342e1ac3277a236d8a7f23830134b
2020-10-08 15:04:18 +03:00
OpenStack Proposal Bot 8673a88019 Updated from OpenStack Ansible Tests
Change-Id: I601c196795a391dfeb7a9c884e8790eeb059a8f1
2020-10-01 14:29:25 +00:00
Jonathan Rosser 26269fb471 Correct aodh_galera_address to aodh_db_address
Change-Id: Ida7db3a952b5b142538bde578f554a36dd582c3f
2020-09-30 12:33:10 +01:00
Jonathan Rosser d4e570e47b 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: I1171b6a45563e4eccf45e8840e5dd332001ff3b7
2020-09-28 17:15:33 +01:00
Dmitriy Rabotyagov 9d6c68acdd 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: Ia57c07c583be6e3fb9582b1d4a2da0deb4854154
2020-09-15 15:58:37 +00:00
OpenStack Proposal Bot 175e82adb6 Updated from OpenStack Ansible Tests
Change-Id: Ieca55c71de66dfe7d873f4db84a9801cd8726a15
2020-08-12 11:31:56 +00:00
OpenStack Proposal Bot b6d059b8d4 Updated from OpenStack Ansible Tests
Change-Id: Ic75bc21cb2c961cb8d800f5776eaf1aa1601a4a0
2020-06-08 19:53:44 +00:00
Jonathan Rosser 6fca9b86cb Allow venv python interpreter to be overridden
Change-Id: Ia5e78895c6bde67d680019055cfa8f96d38a26ee
2019-09-11 09:51:13 +01:00
Zuul ef51898fef Merge "Migrate aodh to use uWSGI role" 2019-09-09 20:37:44 +00:00
OpenStack Proposal Bot 6ff08a4731 Updated from OpenStack Ansible Tests
Change-Id: Ie6ed1378f23645e71a80019f33b9ce482bb43680
2019-09-04 15:11:43 +00:00
Dmitriy Rabotyagov 91b2196646 Migrate aodh to use uWSGI role
This patch moves aodh-api from usage of apache with mod_wsgi
to uWSGI role, which means unification across another roles and
reduced maintenance costs

During migration period tasks that ensures apache won't listen
on panko_service_port are present, but they are supposed to be removed
after train release.

Depends-On: https://review.opendev.org/678025/
Change-Id: I9377d46b4b79f79dbf448b23c67ff21b80714b6c
2019-09-04 15:36:21 +03:00
Dmitriy Rabotyagov 97c03b8dec 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.

Depends-On: https://review.opendev.org/674295/
Change-Id: I7c0dac84dd127a9c33a8a3eb97d547e3d04497f5
2019-08-07 11:07:58 +00:00
Dmitriy Rabotyagov 480d74bb71 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: I2492ed205a94541160e72a9cb3631e0b255d5b53
2019-07-16 21:36:56 +03:00
OpenStack Proposal Bot 14891358c8 Updated from OpenStack Ansible Tests
Change-Id: I55dd2ba009b8962ca0ea3e96fc4ea5a35f707286
2019-06-18 18:15:19 +00:00
Guilherme Steinmüller 7224c37af7 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: I3f459958e7d420e7adfc6f3747080e3fc20f59d7
2019-06-04 02:20:14 +00:00
OpenStack Proposal Bot 07ea68ebfa Updated from OpenStack Ansible Tests
Change-Id: Ifdb464469f12fc60ac57ecb6b703c554da836daf
2019-05-09 11:34:08 +00:00
OpenStack Proposal Bot 739066d665 Updated from OpenStack Ansible Tests
Change-Id: I7c05157a1f9f7aa9b7a04cd08adc197a2ecc6552
2019-04-17 19:11:14 +00:00
OpenStack Proposal Bot b610552775 Updated from OpenStack Ansible Tests
Change-Id: I62a99f419e94ea91b09591d5581805611dd943ce
2019-04-17 07:25:02 +00:00
OpenStack Proposal Bot f850b70252 Updated from OpenStack Ansible Tests
Change-Id: I89035cb3bafadcf95d67fa8ef31704a95ca1f754
2019-04-13 20:21:29 +00:00
OpenStack Proposal Bot 6fab507f95 Updated from OpenStack Ansible Tests
Change-Id: Icde5dfbc23ba79048da036c598b6f12cf80882b3
2019-04-01 13:18:24 +00:00
Mohammed Naser fa5c2dad78 Update role for new source build process
The variables aodh_developer_mode and aodh_venv_download
no longer carry any meaning. This review changes glance 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: I04e119c1404d8681ef7e5d964c95fbeb8970756b
2019-03-27 13:29:39 +00:00
Kevin Carter 35389c78f0 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: Ic6d9833c3f801476890ba4313f9ea3860cef155a
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2019-02-22 00:49:38 +00:00
Zuul 658b0229e9 Merge "venv: use inventory_hostname instead of ansible_hostname" 2019-02-09 04:59:06 +00:00
Heba Naser 798986061a venv: use inventory_hostname instead of ansible_hostname
It is possible that the hostname of the system does not match the
one in the inventory which means that the delegate_to or the
comparision to inventory_hostname will fail in the tasks later.

Change-Id: I811fa941aa18352fc410f578d849a68ad0d50bfe
2019-02-06 09:33:37 -05:00
Jesse Pretorius c21c3ca0ef 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.

Depends-On: https://review.openstack.org/632125
Change-Id: I8ab51d6035d06fea1ee1d7d6427be03115f41924
2019-01-21 16:17:43 +00:00
Jesse Pretorius d2dfb8cdbd Remove unnecessary package install duplication
Currently the devel packages are installed everywhere,
but they only need to be where the wheels are built.

Also, there is already a task to install the packages
needed on the target hosts when installing - so we do
not need to give the same list to the venv install role
because they will already have been installed.

Change-Id: I59394c17c8a5475cc41b583268e45df1da561e7d
2018-10-30 19:16:06 +00:00
Zuul d8aa793f9e Merge "Use a common python build/install role" 2018-09-03 13:12:54 +00:00
Jesse Pretorius d460cf1e36 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.
2. Simplifies the installation of optional pip packages.
   Right now it's more complicated than it needs to be due
   to us needing to keep the py_pkgs plugin working in the
   integrated build.
3. Deduplicates the distro package installs. Right now the
   role installs the distro packages twice - just before
   building the venv, and during the python_venv_build role
   execution.

Depends-On: https://review.openstack.org/598957
Change-Id: I4cee1b0b7d5bc3fa53052dabe66e6acdb69afd18
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-09-03 11:06:17 +00:00
caoyuan ac625f81dd 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: Id9296d69814f3ad72fee5095893fdd7f1729aa5c
2018-09-02 15:01:40 +00:00
OpenStack Proposal Bot 45401bcee1 Updated from OpenStack Ansible Tests
Change-Id: I018267ed7ad4c88217a16ca00e223e5f3b0779e8
2018-08-27 20:56:47 +00:00
OpenStack Proposal Bot d791dbf6a2 Updated from OpenStack Ansible Tests
Change-Id: Ie2810768087958e9e4be604e3920e58a2f076fe3
2018-08-15 13:40:03 +00:00
Zuul 1f7b3491e5 Merge "Setup oslo.messaging extra packages for optional drivers" 2018-08-09 06:23:28 +00:00
Jesse Pretorius f15fbf87cc 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: I02b3d5adff04783f36d0be60637e63d1fcffac34
2018-08-07 12:56:04 +00:00
Kevin Carter a99723f335
Add systemd journal logging to the service config
The systemd journal would normally be populated with the standard out of
a service however with the use of uwsgi this is not actually happening
resulting in us only capturing the logs from the uwsgi process instead
of the service itself. This change implements journal logging in the
service config, which is part of OSLO logging.

OSLO logging docs found here: <https://docs.openstack.org/oslo.log/3.28.1/journal.html>

Change-Id: I7bd5419e7f02593a16614746a974b5f8ab3aa504
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-07-31 14:44:42 -05:00
Jesse Pretorius 30ec2a87f6 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.

Change-Id: Ia05fc004e11eada426bc81c45bbc3732b9126bbe
2018-07-31 12:53:51 +01:00