win_service - Manages Windows services

Author:Chris Hoffman

Synopsis

New in version 1.7.

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
    

    Table Of Contents

    Previous topic

    win_ping - A windows version of the classic ping module.

    Next topic

    win_stat - returns information about a Windows file