From 83a0975611a3948d055c1f670f00799895b63847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Tue, 9 Jul 2024 00:30:10 +0200 Subject: [PATCH] Add dinit as a service_mgr (#83489) --- changelogs/fragments/dinit.yml | 3 +++ lib/ansible/module_utils/facts/system/service_mgr.py | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/dinit.yml diff --git a/changelogs/fragments/dinit.yml b/changelogs/fragments/dinit.yml new file mode 100644 index 00000000000..4122fa7b9a5 --- /dev/null +++ b/changelogs/fragments/dinit.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - service_mgr - add support for dinit service manager (https://github.com/ansible/ansible/pull/83489). diff --git a/lib/ansible/module_utils/facts/system/service_mgr.py b/lib/ansible/module_utils/facts/system/service_mgr.py index 4dfa7e99d44..0d5462fdd62 100644 --- a/lib/ansible/module_utils/facts/system/service_mgr.py +++ b/lib/ansible/module_utils/facts/system/service_mgr.py @@ -144,6 +144,8 @@ class ServiceMgrFactCollector(BaseFactCollector): service_mgr_name = 'systemd' elif os.path.exists('/etc/init.d/'): service_mgr_name = 'sysvinit' + elif os.path.exists('/etc/dinit.d/'): + service_mgr_name = 'dinit' if not service_mgr_name: # if we cannot detect, fallback to generic 'service'