Commit Graph

17 Commits

Author SHA1 Message Date
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
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
Zuul 7461a113ad Merge "Revert "Build out the PrivateNetwork function for services"" 2020-07-06 17:49:24 +00:00
Zuul 7b35ac0465 Merge "Remove fail: tasks" 2020-07-06 17:02:06 +00:00
Marc Gariepy b701c30e62 remove ansible_python_interpreter
ansible_python_interpreter is now set to auto in the tests repo.
it doesn't need to be overwritten in the test anymore.

Depends-On: https://review.opendev.org/734676/
Change-Id: I08b449ebbb2658c02f9f2d69ff3d7c4372d24376
2020-06-11 15:58:58 -04:00
Jonathan Rosser 9924a05f97 Revert "Build out the PrivateNetwork function for services"
This reverts commit 6285b6c638.

There is no use made of this functionality anywhere outside the tests
for this role, so revert the code. The intention is to reduce general
overhead in systemd_service and reduce the number of skipped tasks
in an OSA deployment.

Conflicts: tests/test.yml
Change-Id: I3d28967a64ea9d91219294bdc30d337c9c6d2e50
2020-06-10 08:18:26 +01:00
Jonathan Rosser 492031108e Remove fail: tasks
Assume that the operator knows what they are doing. These tasks
are skipped for every service which bumps up the number of tasks
and runtime.

Change-Id: I73f38d6b9cc897537053d810d5cdd61ed74671fb
2020-06-09 19:38:32 +00:00
Kevin Carter 6285b6c638 Build out the PrivateNetwork function for services
This change adds the ability to effectively use the PrivateNetwork
functionality systemd provides for services. Now, if enabled, services
can be created in a network namespace which isolates it from the reset
of the host. Additional options have been added allowing access into the
network namespace over ephemeral devices as needed.

Highlights:
* Isolated private networking for services will sandbox using a stand
  alone namespace which has no access to anything via the network.
* Access into a private namespace can be provided over a single network
  interface which can be IP'd via local DHCP + NAT or using an upstream
  DHCP server.
* Tests have been added to exercise the new functionality.

All of the funcality has been documented in the defaults of this role.

Change-Id: I6751765131f32393a1605eb2100bec46199d980a
Signed-off-by: Kevin Carter <kevin@cloudnull.com>
2019-02-09 04:06:44 +00:00
Kevin Carter 79e6cdb138 Add docs and tests to the environment capabilities
Systemd service units may require additional environment settings to
be effective. This patch adds two new variables to the systemd_service
role which will allow operators to add environment variables to a
given service as needed. These options be be supplied globally or
from within a service definition.

Documentation on how these options are used has been added to the
defaults file.

A test has been added to ensure we're exercising the new capability.

Change-Id: If4ea993b7173ac3218f051a1d4f0fba9aeb838ea
Signed-off-by: Kevin Carter <kevin@cloudnull.com>
2019-01-11 13:26:30 -06:00
Jesse Pretorius 520465f895 Set container_name as host_var in test inventory
The connection plugin no longer falls back on using the
inventory_hostname as the container_name. Set container_name as a host
var for each container in the test inventory.

In this role's case there are no containers, so I've just removed
the group_var so that the test setup is uniform with other roles
which do use containers.

Change-Id: I5a5063c93eecc7981f6413f37871a97eb0197c85
2018-10-22 11:09:50 +00:00
Kevin Carter d1472289c2
Add timer services
Systemd provides for "timers" which is replacing cron. This change
implements timers as an option to any created service.

Change-Id: I8fdca58fcb43726560521c7c25f7e57cfb61353b
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-05-02 11:19:50 -05:00
Jesse Pretorius 07483d1859 Update run_tests.sh and remove tests-repo-clone.sh
The lint tests make use of the common linters test
used by the roles, so we need to ensure that the
run_tests.sh script is updated and the configuration
adjusted accordingly.

Change-Id: Id1d112c30978cf2e0a0ec32c899ef56290ef806d
2018-03-27 23:12:28 +01:00
Logan V 72efb59ad5 Add service restart handler
A global var systemd_service_restart_changed is added which toggles
restart on unit file change for all systemd_services.

A systemd_services var 'restart_changed' is added to toggle restarts
on a per-service basis.

systemd daemon is not reloaded in a loop anymore, it is only
reloaded once, in a handler, when unit files change.

Consumer roles of systemd_service can listen to the handler
'systemd service changed' to implement additional orchestration when
service units are modified.

Change-Id: I803bca638c30696004f934ad1e28920786948f38
2018-03-23 02:22:46 +00:00
Kevin Carter 7745439f35
Add tests to the service role
* Document the optionality in the defaults
* validate the input in the tasks before it's templated
* Standardize on the exec(starts,stops,reloads} interface
* Update the readme
* Add functional test

Change-Id: Icae36f970178b1cc79d069a94321afb1732a8c5c
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-03-21 17:47:22 -05:00
Logan V d66dc97872 Add base role tests
Depends-On: https://review.openstack.org/#/c/554402/
Change-Id: I220eb6eac324cc085efa7f50f06a72d2e5f846ac
2018-03-19 23:01:15 -05:00
Kevin Carter c302169881
include built docs
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-05-22 23:46:39 -05:00
Kevin Carter 3287637b2d
Initial Commit
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-05-19 10:24:55 -05:00