Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
Restart Windows services on 2 hosts 1 min apart
27 views
Skip to first unread message
Amit Kulkarni
unread,
Jun 5, 2023, 9:45:49 AM
6/5/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Hello All,
I wanted to restart 1 windows service on 2 hosts 1 min apart, is there any way we can achieve this.
Here is the my playbook Let me know in case of anything
---
-
name
:
restart the fedex service
hosts
:
Windows1
tasks
:
-
win_service
:
name
:
fedex
state
:
restarted
Atul Nasir
unread,
Jun 13, 2023, 9:12:49 PM
6/13/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
---
- name: Restart the FedEx service
hosts: Windows1
tasks:
- name: Restart the service
win_service:
name: fedex
state: restarted
- name: Pause for 1 minute
pause:
minutes: 1
when: inventory_hostname != groups['Windows1'][-1]
Reply all
Reply to author
Forward
0 new messages