Commit Graph

192 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 17fc5d6465 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: I32efef68c8ade24fb164f2cfcecd8e7147bf5f0e
2023-07-14 05:42:23 +00:00
Dmitriy Rabotyagov a184e4d224 Ensure service is restarted on unit file changes
At the moment we don't restart services if systemd unit file is changed.

We knowingly prevent systemd_service role handlers to execute
by providing `state: started` as otherwise service will be restarted twice.
With that now  we ensure that role handlers will also listen for systemd
unit changes.

Change-Id: Ibb1b0159ca8267ce3ab6ffb1752ab10ddb4b8139
2023-04-10 15:49:06 +02:00
JF Taltavull ced6900147 Fix wrong pathname in pre install task
/etc/cinder was used instead of /etc/ceilometer in the task
that removes config directory. So the config directory was
never removed.

Change-Id: Idb8555a98e412cde15a5a328a4a7471202aaf6c3
2022-09-22 14:27:56 +02:00
Erik Berg ef08afd798 Remove redundant vars line
This line snuck in with I64e3f78eff6bf084fa7ab54d88b667b8fb07c15e
probably to bring it in line with other OSA roles, but should already
be covered by the distribution_major_version line above.

Change-Id: Ib0633cb165ae1f8eee2955cea73837f5117b13d9
2022-09-15 10:51:38 +02:00
Jonathan Rosser 0524ffc5dc Remove legacy pipeline cleanup task
Change-Id: I566019a0af35436c93d1b25494ed5e89aa081807
2022-02-02 04:07:40 -05:00
Zuul 042d577376 Merge "Use common service setup tasks from a collection rather than in-role" 2022-01-13 13:15:50 +00:00
Jonathan Rosser a7d7cd0184 Use common service setup tasks from a collection rather than in-role
Change-Id: Id23cddf14b94a8a6c04d90092e23d0cc322d026c
2022-01-12 17:38:44 +00:00
Jonathan Rosser e640259330 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: I64e3f78eff6bf084fa7ab54d88b667b8fb07c15e
2022-01-12 08:39:27 +00:00
OpenStack Proposal Bot 906488aed4 Updated from OpenStack Ansible Tests
Change-Id: Ia37371a9c77d7b2f6e46d8ad0ed663a0d13133bd
2021-12-04 17:39:40 +00:00
Dmitriy Rabotyagov 3a31674df6 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: I9fd74b740de2ce0608c4c076c6fa961674bdbde7
2021-11-30 15:18:41 +02:00
OpenStack Proposal Bot 0672c756f1 Updated from OpenStack Ansible Tests
Change-Id: I4e68ae297d3d534c42d1698e79f0b1658426afb3
2021-11-22 12:10:23 +00:00
Jonathan Rosser f9ed9485cc Fix u-c filter regex
Change-Id: Ib941e051af7414c82d43d721dd826d4b35a96a79
2021-06-03 11:13:14 +00:00
Zuul 5226a1cf5b Merge "Move ceilometer pip packages from constraints to requirements" 2021-03-16 16:55:05 +00:00
Jonathan Rosser e00da435b4 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: Ifa117789eaa79b3107a4a3dd8d1e1379ca04d238
2021-03-16 08:00:40 +00:00
Jonathan Rosser 5d1110c710 Move ceilometer pip packages from constraints to requirements
This is necessary to support the new pip resolver

Change-Id: I3b63e170e42fa12cb4226f7512ab79f0506d95e8
2021-03-12 16:05:49 +00:00
Jonathan Rosser 769da7271d 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: Ia0b927fe775d5638cd09ecb91af550892764353d
2021-03-10 12:16:37 +00:00
Dmitriy Rabotyagov be84a509c4 Unify deployment of ceilometer files
This aims to make possible to define ceilometer_pipeline_user_content
filepath instead of making huge overrides. In the meanwhile default
behaviour should be kept with minimal influence on the existing
deployments.

Change-Id: I0a0ac1b9bbdb8b6a68f870f0ae03edbee8c63d68
2020-11-20 08:05:17 +00:00
OpenStack Proposal Bot 94d5c528e7 Updated from OpenStack Ansible Tests
Change-Id: I82dbe1b7b707a621ab867210a3101cbde74a3560
2020-10-19 09:19:41 +00:00
OpenStack Proposal Bot bf3f466560 Updated from OpenStack Ansible Tests
Change-Id: I8add39ca33940701101fa264773b7c522fc7feac
2020-10-01 14:29:41 +00:00
Dmitriy Rabotyagov aab69ae73a Revert use of _ceilometer_is_first_play_host for post install tasks
run_once can't be replaced with such condition since config files should
be put against all groups, and not only api one.

Change-Id: I5ead13059f0494d53a2d5961b03e8c618b3f5635
2020-09-22 10:23:28 +03:00
Zuul d134824ec2 Merge "Define condition for the first play host one time" 2020-09-21 08:58:09 +00:00
Dmitriy Rabotyagov 533c789316 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: I6247f86b26d1e0dac55fa863a19405ff171c82ff
2020-09-16 13:49:10 +00:00
OpenStack Proposal Bot 9390e17d10 Updated from OpenStack Ansible Tests
Depends-On: https://review.opendev.org/746679
Change-Id: I72bee2b46d84fdad61f9ad572510762ec8c60e52
2020-08-19 20:50:11 +00:00
OpenStack Proposal Bot e6beb1c166 Updated from OpenStack Ansible Tests
Change-Id: Ie31eae07a826852d46f9497225c7dc666b20add4
2020-06-08 19:54:05 +00:00
Zuul 43f1bcea67 Merge "Get ceilometer_lib_dir in more reliable way" 2020-05-12 12:22:28 +00:00
Dmitriy Rabotyagov cb6bc308c0 Get ceilometer_lib_dir in more reliable way
Instead of bothering with definition of python lib dirs per distro,
we can just get ceilometer library directory with python command.

`ceilometer_lib_dir` variable is mainly used by post_install task.
This variable is not set correctly at the moment if role is ran with
ceilometer-config tag. So this patch also fix running role with that tag

Change-Id: Id4fe9a8eef27bdd1c71104007e6b493f3f5109d5
2020-05-11 19:39:29 +00:00
Dmitriy Rabotyagov f50ea4f5e1 Make user provided content deployable
When src is provided to config_template module, content is simply
ignored. So we should set tmp_f only when content is not provided.
This also means that we should use native file lookup instead of
pipe.
Additionally when statements shouldn't include Jinja2 delimiters.

Change-Id: I9ff2fdea02ca71068dab9cfcab10ca60785821de
2020-05-04 12:38:17 +03:00
Dmitriy Rabotyagov ab81ea24bb Use py3 for CentOS
Unfortunatelly CentOS 7 do not have libvirt libraries
for py3, so isntead of symlinking them, we have to install devel package
and build them inside venv.

Change-Id: Ibcfb82f2b34c0f9db299262ed3b200f87953e043
2020-03-12 10:24:37 +00:00
Georgina Shippey fe9208c08a Check host is within group
A fix on my patch: https://review.opendev.org/#/c/694055/
If the current host is not in the ceilometer-agent-notification group
then the intersection of the current hosts group_names will produce an
empty list. This should be checked before evaluating the next conditional.

Change-Id: Ib3a84516e0f00e84c6869fa58e9595062c6fbede
2019-12-19 11:39:23 +00:00
Dmitriy Rabotyagov 5594eecdfb Pass _service_region to service_setup tasks
This was missing so the default RegionOne would always be used.

Change-Id: I38e68379ea50c2f4370083f5b480b6a8fbfb0985
2019-12-08 06:49:10 +02:00
Georgina Shippey c3c1a12c31 Check conditional length before evaluation
Ceilometer sometimes may not be used. On a run through of Stein to Train
upgrade there is an error:

'Error while evaluating conditional ... list object has no element 0'

This patch ensures that the ansible group has members before trying to
reference the first group member.

Change-Id: I4ffba430d174a32e586fefd8ee636b6b8405486e
2019-11-18 10:27:59 +00:00
Zuul fa5727c090 Merge "Add python3 compatibility for source installs" 2019-09-12 17:32:31 +00:00
Zuul 94b3de8a7f Merge "Allow venv python interpreter to be overridden" 2019-09-12 13:11:41 +00:00
Jonathan Rosser d46837f31e Add python3 compatibility for source installs
Change-Id: Ic7dbf1edf12090b815207017bf514c47c50feeea
2019-09-11 20:23:02 +01:00
OpenStack Proposal Bot 81c342a995 Updated from OpenStack Ansible Tests
Change-Id: I7d1ca774080d47ccef43954ed81dcc027452f282
2019-09-11 13:06:55 +03:00
Jonathan Rosser 0b171a5bb6 Allow venv python interpreter to be overridden
Change-Id: Id15e0c2fb7b88001cb1290157edad1caafc11523
2019-09-11 09:54:41 +01:00
OpenStack Proposal Bot 71e16fca3a Updated from OpenStack Ansible Tests
Change-Id: I448ef664a95b15507212f865c0d78dcccb07c872
2019-08-20 03:05:41 +00:00
Dmitriy Rabotjagov 0a6e505bc6 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: I1e7853c385fbd449c1e4d08e0d09725c4dff95a8
2019-07-29 11:34:08 +00:00
Dmitriy Rabotyagov fe1f87b387 Fix gnocchi db population
python3-gnocchiclient seems to be required for ceilometer to
correctly populate gnocchi db

Change-Id: I6c68e7d0710ea3fa3c45fa3aa27b40c9e3ca6f71
2019-07-26 05:09:56 +00:00
OpenStack Proposal Bot c0af00e427 Updated from OpenStack Ansible Tests
Change-Id: Ibff6748f39253731f4daff2d554e6e88bdde3de4
2019-06-18 18:15:27 +00:00
OpenStack Proposal Bot 4346f58fce Updated from OpenStack Ansible Tests
Change-Id: I9c31de44c20e321d5875bb8777fb87853f9e13f1
2019-06-11 22:17:14 +00:00
OpenStack Proposal Bot bae198d553 Updated from OpenStack Ansible Tests
Change-Id: I9fd1a675e628c22e502cf32ec22c18fa5a6a7077
2019-05-09 11:34:16 +00:00
OpenStack Proposal Bot ab370a2a4d Updated from OpenStack Ansible Tests
Change-Id: I0efe1bca26d784bcdb3b1eb531491716315fe2b0
2019-04-17 19:11:22 +00:00
OpenStack Proposal Bot aa326e020b Updated from OpenStack Ansible Tests
Change-Id: I94e7ff760ac50c4ddbddd463832a2926612651cf
2019-04-17 07:25:09 +00:00
OpenStack Proposal Bot 4b14906796 Updated from OpenStack Ansible Tests
Change-Id: I1636305476871ecaae22e784f7994b0ed9d49eca
2019-04-13 20:21:44 +00:00
OpenStack Proposal Bot 2e13c6fd87 Updated from OpenStack Ansible Tests
Change-Id: Iaed581a0b8b571204e0dda0d4e0a43453c5f99a4
2019-04-01 13:18:31 +00:00
Zuul 672011386e Merge "Update role for new source build process" 2019-03-27 21:49:12 +00:00
Dmitriy Rabotjagov bbf9cacdfd Update role for new source build process
Packages from ceilometer_developer_mode_distro_packages were moved
to ceilometer_devel_distro_packages list.

Change-Id: Ia47c56d7fccb36d99a6368b836b48613500beea6
2019-03-27 21:06:22 +02:00
Dmitriy Rabotjagov e68b1336a7 Cleanup config from keystone_authtoken section
keystone_authtoken is not used by ceilometer, so there is no need to
deploy and maintain it. In addition, improved logic of
ceilometer_service_setup include, as ceilometer need
keystone credentials only for pollsters,
so credentials are created only when ceilometer-polling group is defined

Change-Id: I8bfc4ca1e87edf70e61a03db0854d0ae32ab2bc7
2019-03-27 17:47:04 +02:00
Dmitriy Rabotjagov 77d0c1ad54 Update role for new source build process
The variables ceilometer_developer_mode and ceilometer_venv_download
no longer carry any meaning. This review changes ceilometer 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.

We also change include_tasks to import_tasks and include_role
to import_role so that the tags in the python_venv_build role
will work.

Change-Id: Ib6423249ad6d8c24382a0d82229f766d34255ee9
2019-03-27 10:18:21 +02:00