From 27f61db86b69743181529dd6ee34951b244e075e Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Tue, 25 May 2021 20:55:21 +0530 Subject: [PATCH] service: Document internal working of the module (#74726) service module acts as proxy module for all service manager modules, just like `package` module. This is helpful in heterogeneous environments to manage services. Fixes: #74507 Signed-off-by: Abhijeet Kasurde --- changelogs/fragments/74507_service.yml | 2 ++ lib/ansible/modules/service.py | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 changelogs/fragments/74507_service.yml diff --git a/changelogs/fragments/74507_service.yml b/changelogs/fragments/74507_service.yml new file mode 100644 index 00000000000..e2cb8c288da --- /dev/null +++ b/changelogs/fragments/74507_service.yml @@ -0,0 +1,2 @@ +minor_changes: +- service - add description how service module works internally (https://github.com/ansible/ansible/issues/74507). diff --git a/lib/ansible/modules/service.py b/lib/ansible/modules/service.py index ce0b2a6e2a5..884d31b9138 100644 --- a/lib/ansible/modules/service.py +++ b/lib/ansible/modules/service.py @@ -16,6 +16,14 @@ short_description: Manage services description: - Controls services on remote hosts. Supported init systems include BSD init, OpenRC, SysV, Solaris SMF, systemd, upstart. + - This module acts as a proxy to the underlying service manager module. While all arguments will be passed to the + underlying module, not all modules support the same arguments. This documentation only covers the minimum intersection + of module arguments that all service manager modules support. + - This module is a proxy for multiple more specific service manager modules + (such as M(ansible.builtin.systemd) and M(ansible.builtin.sysvinit)). + This allows management of a heterogeneous environment of machines without creating a specific task for + each service manager. The module to be executed is determined by the I(use) option, which defaults to the + service manager discovered by M(ansible.builtin.setup). If `setup` was not yet run, this module may run it. - For Windows targets, use the M(ansible.windows.win_service) module instead. options: name: