Commit Graph

167 Commits

Author SHA1 Message Date
OpenStack Release Bot 25fbe656a4 Update master for stable/2023.2
Add file to the reno documentation build to show release notes for
stable/2023.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.2.

Sem-Ver: feature
Change-Id: I44098fcfc74fdaba1bc2c82311d4fd49705fdc25
2023-12-07 11:05:27 +00:00
Dmitriy Rabotyagov a0fb5a6df2 Filter loop lists instead of conditionally run them
Filtering loops should execute faster and do not iterate over elements
that we don't need.

Change-Id: Iee2e706c50b59679f48afbd6f067922887154e5c
2023-10-27 22:25:47 +02:00
Zuul 2ce606c40a Merge "Remove conditions on systemd version" 2023-10-17 17:41:14 +00:00
Zuul 381321d821 Merge "Reduce output by leveraging loop labels" 2023-10-17 17:41:13 +00:00
Zuul 86e451b295 Merge "Use TOX_CONSTRAINTS_FILE" 2023-10-17 13:28:03 +00:00
Jonathan Rosser 1beb241764 Remove conditions on systemd version
All the supported platforms are now using more modern systemd versions
than detected with the logic in this role, so remove
the redundant tasks and conditions.

Change-Id: I0ddaefc575f1b0cbf85696cde25aa69907fede9f
2023-10-10 14:42:46 +01:00
Dmitriy Rabotyagov 4e68dde47a Reduce output by leveraging loop labels
Systemd service element does contain quite bug dictionary and
output of it is not really useful for most tasks. To make output smaller
and at the same time more informative we leverage loop labels.

With that we convert all with_items to be proper loops.

Change-Id: I90d2fb4110d2a47af184e90382538e015eb87b13
2023-09-26 17:09:44 +00:00
niuke 9e96739c85 Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated.
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

Change-Id: I3793933504f301af105f8aa49a28f91f425d9219
2023-08-08 17:35:55 +08:00
Dmitriy Rabotyagov b763b73ffc 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.

Change-Id: I4aab8ba621228d3fbf79b1da8227be41f3258b5f
2023-07-12 11:58:33 +00:00
Dmitriy Rabotyagov f3396119a4 Fix tags usage for included tasks
With usage of include_tasks tags must be applied accordingly,
which was missing. That prevented running service load whenever
systemd-service tag was used.

Change-Id: Id48457c43e38e19f781bfe11d1fb6eaeb9fdde6f
2023-03-03 12:39:08 +01:00
Zuul 59736cb4af Merge "Ensure daemon is reloaded on socket change" 2023-01-25 17:31:49 +00:00
Dmitriy Rabotyagov 17f833f27a Restart sockets when they are changed
At the moment it's possible only to forcefully restart sockets under
each run, which is not idempotent and may cause interruptions for
service. To avoid that we add a way to restart socket just on config
change with same logic applied as for service.

Change-Id: Ifb6fd9461d7b6a65191b918c0863406cf4de6725
2023-01-23 19:15:09 +01:00
Dmitriy Rabotyagov 6a40ec0b85 Ensure daemon is reloaded on socket change
At the moment our verification if socket has been changed
is not valid, since we're checking if string 'true' is presnet in the
list, while list consist of only boolean variables. So we replace
map filter with selectattr as it can apply truthy test to the elements
while selecting them and checking list length.

Change-Id: Ib456b4dc2d631bf81633035820444f13ec0f06cb
Related-Bug: #2003631
2023-01-23 16:29:46 +01:00
Dmitriy Rabotyagov ed30679416 Update tox.ini to work with 4.0
With tox release of 4.0, some parameters were deprecated and are ignored now
which causes tox failures. One of the most spread issues we have is using
`whitelist_externals` isntead of `allowlist_externals`


Change-Id: Ib07b10672187610c046e84b7d8a884d4ddb58164
2022-12-27 17:53:07 +01:00
OpenStack Release Bot 69f36cff8e Update master for stable/zed
Add file to the reno documentation build to show release notes for
stable/zed.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.

Sem-Ver: feature
Change-Id: I05f796d3444ac44101e3190eb17e6f551c666408
2022-12-13 13:05:57 +00:00
Dmitriy Rabotyagov 62bd24859e Allow to define pre-start and post-stop tasks
WHile you can leverage config_overrides for that, it might become
tricky if you need to define more then 1 pre/post exec tasks.

Change-Id: I3d8b36f5e9f4be89eaff848d8ba88a38ce5285e4
2022-10-14 12:11:06 +02:00
jiaqi07 d0472412dd Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

Change-Id: I841ad4ad1b35e97180914f3d5307910bef9f02dc
2022-07-28 19:50:17 +08:00
Dmitriy Rabotyagov 4bc059e9d9 Switch sphinx language to en
With sphinx release of 5.0.0, they changed default for language variable
to 'en' from None. With that current None valuable is not valid and should
not be used.


Change-Id: I55beac04ca11efef8a700d8f8544a853fd4af744
2022-05-30 16:01:11 +02:00
Zuul 389dd8ae72 Merge "Reload systemd after installing a service unit override" 2022-04-25 19:42:25 +00:00
Jonathan Rosser ba6c16ad26 Reload systemd after installing a service unit override
If systemd_service is used to install only an override for an existing
unit it is necessary to reload the systemd daemon for the override
to take effect.

Change-Id: I64c0203ee13b3abbc441274c9304b7103a0bb23c
2022-04-14 16:35:04 +00:00
Dmitriy Rabotyagov f441fc5be4 Pass systemd_service role in check mode
In order to pass check mode we should get get_systemd_version
regardles of mode with command. It is not a breaking change and safe to
run anytime.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/837706
Change-Id: I9ce85a091e3328d7215665ac308f2980537ce921
2022-04-13 13:12:27 +02:00
OpenStack Proposal Bot fcd5233302 Updated from OpenStack Ansible Tests
Change-Id: I7d07da1723570d38bdbcadfe1aa643539cd070f3
2022-03-31 20:13:10 +00:00
Marc Gariepy 4ae5921212 Cleanup setup.py config
Change-Id: I788dd401f875953267783111efdc1ceaf1463f7f
2022-03-31 10:35:29 -04:00
Jonathan Rosser 1013a1526e Allow StandardOutput to be set for a systemd service
See https://www.freedesktop.org/software/systemd/man/systemd.exec.html

Change-Id: I64470b53f5177e9a4e450beaa474036e44705349
2022-01-27 12:13:05 +00:00
Dmitriy Rabotyagov 1f7091a11c Add ability to create templated services
This functionality is pretty neat and used widely if you need to pass
specific argument to the unit service, but rest of the parameters can
be left intact.

Change-Id: I6eb80ac0f9f0257402697a255518bb2c66d0dfd5
2022-01-14 10:37:39 +00:00
Zuul 17852bc111 Merge "Add 'load' boolean for services." 2022-01-13 15:25:45 +00:00
Zuul c0a5954685 Merge "Suppress 'Service' directive if ListenStream is specified" 2022-01-13 15:25:43 +00:00
Jonathan Rosser 0589c81386 Add 'load' boolean for services.
Some services, such as socket activated ones with '@' naming cannot be
loaded.

Change-Id: I7d95378f393c8b8cc729cc9b3a30dfe4208393b2
2022-01-13 10:01:32 +00:00
Zuul 26602576f6 Merge "Drop plugins from role requirements" 2022-01-12 13:45:11 +00:00
Dmitriy Rabotyagov 454f620667 Drop plugins from role requirements
Change-Id: I9bcdf00b88d5556670610a502a7522d308ce2da2
2022-01-11 16:57:14 +02:00
Jonathan Rosser abbc5c8ab8 Suppress 'Service' directive if ListenStream is specified
This is mutually exclusive configuration

Change-Id: Icf43a8421f4d52570ea89f5db0722c0d99bafd85
2022-01-11 03:25:53 -05:00
OpenStack Proposal Bot 9859d1645d Updated from OpenStack Ansible Tests
Change-Id: I3ea54451cc328fb64ab017f38c295436f0e92078
2021-12-17 16:50:42 +00:00
Zuul 1011acf6d2 Merge "Add integrated linters test" 2021-12-06 19:14:01 +00:00
Dmitriy Rabotyagov 74a2cdd0ec Add integrated linters test
Change-Id: Id0de75860060474ce470bcf17b4204fa0604c29d
2021-12-06 13:35:33 +02:00
Zuul a49b5544f1 Merge "Use config_template as a collection" 2021-12-02 10:28:58 +00:00
Dmitriy Rabotyagov bdaa91dbbf 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: I2e32017b48f9143ff0e42175cc10feebf342f2f3
2021-11-30 15:17:08 +02:00
Dmitriy Rabotyagov fc698fb11a Use slice name for lock/run by default
Change-Id: I883d6520e7da4491929252677193f733808da6a3
2021-11-30 12:39:38 +00:00
Dmitriy Rabotyagov a3800b6368 Deprecate systemd_lock_path variable
To remove complexity from the code we remove variable systemd_lock_path
since variable systemd_lock_dir with common functionality has been
introduced.

Change-Id: I61bb44450a7fb1cface2b93302e02c8fd358a034
2021-11-04 20:41:24 +02:00
Dmitriy Rabotyagov 46185f389e Update run and lock path for systemd
Since /var/run is a symlink to /run and /var/lock is a symlink to
/run/lock for all modern operationg systems, it makes sense to
change default paths that are used.

To make such changes more flexible, ``systemd_run_dir`` and
``systemd_lock_dir`` are introduced.

Change-Id: I60d321fcdce3d3a94233cc25c92898d9e9f2a9b8
2021-11-04 20:30:47 +02:00
OpenStack Proposal Bot 9d14e194ca Updated from OpenStack Ansible Tests
Change-Id: I0141c8b2e151636de5a25685de0a17940e24230c
2021-03-22 08:56:16 +00:00
Zuul 2fd3f5e4f7 Merge "[reno] Stop publishing release notes" 2021-03-18 10:46:59 +00:00
Jonathan Rosser 60b0cc5a62 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: Ia8feb40a3d350c8ff759111b828b633f1c8e8c7b
2021-03-16 08:59:57 +00:00
OpenStack Proposal Bot a0455830d4 Updated from OpenStack Ansible Tests
Change-Id: I82a66e7591585531f72d0fc4b4334f7f40fb06a9
2021-03-12 22:23:54 +00:00
dmitriy c8ac916186 [reno] Stop publishing release notes
Since we copy all release notes to the integrated repo there is not need
in publishing release notes for each repository. We should only verify their
validity and linting.


Change-Id: I172036c213917ca036e8f148bcce0816f9738bdb
2021-01-22 18:23:13 +02:00
Erik Berg 1cc15d7923 Make systemd.service more consistent
This file doesn't need to change based on the whims of which order
the after_targets decide to jumble themselves into. By sorting the
after_targets we get less changes.

Change-Id: I7cba791c6d6d90390e5adaf63a4797cbc320cbc5
2021-01-21 18:52:50 +01:00
Andrew Bonney 3c924d2531 templates: fix typo in string/mapping check
A small typo that appears to have been missed during review,
which can cause strings (for example) to be iterated over rather
than included directly.

Change-Id: Id1a9d7088f97b709c46d5f4563c0c498604f999e
2021-01-18 13:01:29 +00:00
Zuul 6937a0a67a Merge "Add option to create systemd native service overrides" 2021-01-14 10:29:02 +00:00
Zuul 6ad5f1486d Merge "Add possibility to configure systemd sockets" 2021-01-14 10:21:16 +00:00
Dmitriy Rabotyagov 6bebc97d86 Add option to create systemd native service overrides
Since there might be a necessity to override already existing in the
system services, like provided ones by system packages, which we
just want to adjust, we need option to create service overrides in
systemd.servce.d directory.

Change-Id: Ic7488edbc0487fe932c706dc26f2f8adb36cb427
2021-01-06 10:53:22 +00:00
Dmitriy Rabotyagov 763eb7638f Add possibility to configure systemd sockets
We need to be able to configure systemd-sockets. Since they are attached
to the service it make sense to make it as an element to the service.

Change-Id: Ic481921151fc8d7af7f1ca9b003adb8e3c967e16
2021-01-06 10:53:07 +00:00