From d757995bb62dfa3f8022b5bf7a1a3082c7a93ce8 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Tue, 2 Jun 2020 20:37:02 +0530 Subject: [PATCH] service_facts: Update documentation about service status (#69757) Update documentation about undocumented service status provided by systemd Fixes: #69752 Signed-off-by: Abhijeet Kasurde --- changelogs/fragments/69752_service_facts.yml | 2 ++ lib/ansible/modules/service_facts.py | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 changelogs/fragments/69752_service_facts.yml diff --git a/changelogs/fragments/69752_service_facts.yml b/changelogs/fragments/69752_service_facts.yml new file mode 100644 index 00000000000..d91c753a46d --- /dev/null +++ b/changelogs/fragments/69752_service_facts.yml @@ -0,0 +1,2 @@ +minor_changes: +- service_facts - Added undocumented 'indirect' and 'static' as service status (https://github.com/ansible/ansible/issues/69752). diff --git a/lib/ansible/modules/service_facts.py b/lib/ansible/modules/service_facts.py index 79556baeb33..c8901631399 100644 --- a/lib/ansible/modules/service_facts.py +++ b/lib/ansible/modules/service_facts.py @@ -1,5 +1,5 @@ #!/usr/bin/python -# (c) 2017, Ansible Project +# Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # originally copied from AWX's scan_services module to bring this functionality @@ -13,7 +13,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'core'} -DOCUMENTATION = ''' +DOCUMENTATION = r''' --- module: service_facts short_description: Return service state information as fact data @@ -34,7 +34,7 @@ author: - Adam Miller (@maxamillion) ''' -EXAMPLES = ''' +EXAMPLES = r''' - name: Populate service facts service_facts: @@ -43,7 +43,7 @@ EXAMPLES = ''' ''' -RETURN = ''' +RETURN = r''' ansible_facts: description: Facts to add to ansible_facts about the services on the system returned: always @@ -55,17 +55,23 @@ ansible_facts: type: complex contains: source: - description: Init system of the service. One of C(systemd), C(sysv), C(upstart). + description: + - Init system of the service. + - One of C(systemd), C(sysv), C(upstart). returned: always type: str sample: sysv state: - description: State of the service. Either C(running), C(stopped), or C(unknown). + description: + - State of the service. + - Either C(running), C(stopped), or C(unknown). returned: always type: str sample: running status: - description: State of the service. Either C(enabled), C(disabled), or C(unknown). + description: + - State of the service. + - Either C(enabled), C(disabled), C(static), C(indirect) or C(unknown). returned: systemd systems or RedHat/SUSE flavored sysvinit/upstart type: str sample: enabled