W3cubDocs

/Ansible

win_service - Manages Windows services

New in version 1.7.

Synopsis

Manages Windows services

Options

parameter required default choices comments
name
yes
Name of the service
start_mode
no
  • auto
  • manual
  • disabled
Set the startup type for the service
state
no
  • started
  • stopped
  • restarted
started/stopped are idempotent actions that will not run commands unless necessary. restarted will always bounce the service.

Examples

# Restart a service
win_service:
  name: spooler
  state: restarted

# Set service startup mode to auto and ensure it is started
win_service:
  name: spooler
  start_mode: auto
  state: started

This is a Core Module

For more information on what this means please read Core Modules

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/win_service_module.html