From edfdf30bcb4fb87183b4e6e987e014783743230c Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Wed, 17 Jul 2019 17:03:47 +1000 Subject: [PATCH] Improve docs for win_service for custom account rights (#59155) --- lib/ansible/modules/windows/win_service.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/ansible/modules/windows/win_service.py b/lib/ansible/modules/windows/win_service.py index 20391f5985d..2fc19f57c9f 100644 --- a/lib/ansible/modules/windows/win_service.py +++ b/lib/ansible/modules/windows/win_service.py @@ -111,11 +111,15 @@ options: a local or domain account. - Set to C(LocalSystem) to use the SYSTEM account. - A newly created service will default to C(LocalSystem). + - If using a custom user account, it must have the C(SeServiceLogonRight) + granted to be able to start up. You can use the M(win_user_right) module + to grant this user right for you. type: str version_added: '2.3' seealso: - module: service - module: win_nssm +- module: win_user_right author: - Chris Hoffman (@chrishoffman) ''' @@ -168,6 +172,14 @@ EXAMPLES = r''' name: service name register: service_info +# This is required to be set for non-service accounts that need to run as a service +- name: Grant domain account the SeServiceLogonRight user right + win_user_right: + name: SeServiceLogonRight + users: + - DOMAIN\User + action: add + - name: Set the log on user to a domain account win_service: name: service name