Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs for win_service for custom account rights #59155

Merged
merged 1 commit into from
Jul 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/ansible/modules/windows/win_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,15 @@
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)
'''
Expand Down Expand Up @@ -168,6 +172,14 @@
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
Expand Down