Windows service management is a building block on the road to automating everything, and a key Ansible by Red Hat #WindowsAutomation use case.

Check out this (4-minute) demo video to see it in action!

Main demo playbook code:

stopservice.yml:

---
- name: Stop a service
  hosts: all
  gather_facts: false
  tasks:
  - name: Stop spooler
    win_service:
      name: spooler
      state: stopped

startservice.yml:

---
- name: Start a service
  hosts: all
  gather_facts: false
  tasks:
  - name: Start spooler
    win_service:
      name: spooler
      start_mode: auto
      state: started

And you can download a free, 60-day evaluation of Ansible Tower via Red Hat’s site today:

https://www.redhat.com/en/technologies/management/ansible/try-it?sc_cid=7013a000002DffaAAC

Spread the word. Share this post!