Reg: Service check and stop during windows update.

15 views
Skip to first unread message

harshc...@gmail.com

unread,
Nov 16, 2021, 6:25:40 AM11/16/21
to Ansible Project
Hello All,

I am doing windows server patching for some of the windows servers on my environment.

Now i have a requirement in which i have to check a service if it exists and stop it before installing update/patch.

can someone please help me on this such that playbook should first check for the service, stop it and then go for windows patching.

Script i am using now for windows patch update:

- name: Windows Update 
  hosts: all 
  gather_facts: false 
  tasks: 
     - name: Running Windows Update 
       win_updates: 
           category_names: ['SecurityUpdates','CriticalUpdates','UpdateRollups', 'Updates', 'DefinitionUpdates'] 
           reboot: yes

Thanks in advance

Wei-Yen Tan

unread,
Nov 16, 2021, 6:27:19 AM11/16/21
to ansible...@googlegroups.com
Create a new play before this one to do your pretask. 

From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of harshc...@gmail.com <harshc...@gmail.com>
Sent: Wednesday, November 17, 2021 12:25:39 AM
To: Ansible Project <ansible...@googlegroups.com>
Subject: [ansible-project] Reg: Service check and stop during windows update.
 
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/794e7384-553c-4fb0-805b-e6285c560d80n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages