The win_updates module will give a reboot_required: True return value when
one is required. With that information you can register the task and then
have a follow up win_reboot task when reboot_required: True. See below
for how to accomplish this.
- name: Install Windows Updates
win_update
Hey Mike,
What you given is absolutely correct. But i was blocked with different
condition. While patching some updates won't move forward without restart.
in that case if i restart the connection established with ansible server
will lost. For that i am using pause module in ansible. Once that
Hey Sunil
You should be using the win_reboot module to handle updates. It reboots the
server and waits for it to come back online so it should be seemless and
won't continue until it is ready for another task. Your playbook would look
something like this
- name: install updates
hosts: window
Hi Jordon,
I am almost there. Your code is working absolutely fine. But need to handle
below logic.
1) We can't say how many updates will ask for reboot so having win_updates
multiple times in playbook can't work (we cannot hard code) --> If we have
the logic when ever reboot is triggered the
Me too new just from my scenario I am suggesting to use a handler on play
book level.
And then added a notify to handler on each task where I expect a reboot to
be done.
Below is a trial run we did.
.
├── README.md
├── ansible.cfg
├── group_vars
│ ├── all
│ ├── ccenter.yml
│ ├── linux.yml