How can I start tomcat service on windows using ansible-playbook? I have installed ansible using cygwin by following this tutorial.
vito Answered question March 8, 2021
You need to use the win_service module to modify any service in Windows using ansible. Below is the sample playbook to start the Tomcat9 service,
--- - hosts: win tasks: - name: Start tomcat win_service: name: Tomcat9 state: started
Change the service name as per the Tomcat version you have installed.
hiberstackers Edited answer April 30, 2021