I think the problem relates to the PsWindowsUpdate module that Ansible 
uses. I haven't played much with it, but it may have some bugs.

According to the code in the ansible module, it should never reboot without 
warning, but instead report back to Ansible wether a reboot is required or 
not (and then from there you could use my win_reboot role to invoke a 
controlled reboot if needed).

Anyways, what I'd recommend you to do is to use the logPath parameter to 
write information to a local logfile and then post that. I can't promise 
that we'll be able to sort this out, but at least with the log file we 
could try and find out what's going on. I'll also ping Pete who wrote the 
Ansible module and see if he has seen the behaviour you're experiencing.

-Trond

On Friday, September 4, 2015 at 4:22:53 PM UTC+2, Dimitri Yioulos wrote:
>
> Trond,
>
>
> Thanks so much for your post.
>
>
> Let me start by posting some info:
>
>
> Ansible host: CentOS 6.x
>
> Ansible ver.: 1.9.1
>
> Windows servers:  2008 R2
>
> PSWindowsUpdate:  previously installed.
>
> Oddly, I found that I had to re-register PSWindowsUpdate with Powershell 
> (it's possible I forgot this step when I first installed PSWU, but not 
> probable.  Anyway, ...).  The first win_updates module I used was the one 
> suggested by a respondent in another post: 
> https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fansible%2Fansible-modules-extras%2Fpull%2F854&sa=D&sntz=1&usg=AFQjCNFBl08j8HcDvgqXl5hTrtZWWyyh3A.
>   
> True, this may be for Ansible v. 2.0, and I'm using 1.9, but I thought I'd 
> give it a try.  Well, it worked, sort of.  The play fired off the 
> appropriate processes on the Windows servers, but the updates to a very 
> long time (using the Windows Update client on the server took a fairly 
> short time to install the updates, and prompt for a reboot).  It appears as 
> if they were being installed serially.  In addition, the play terminated 
> successfully, but only 21 of the 32 available updates were installed.  I 
> had to run my play again for the remainder of the updates to be installed.  
> There was never an indication via the play that a reboot might be 
> necessary, nor via the Windows Update client.
>
> I then rolled back to the original win_updates module, and tried again.  
> It, too, worked, and much more quickly.  However, about two-thirds of the 
> way through the update, the server rebooted and, of course, the play 
> aborted.  A check of the Windows Update client showed that, again, 21 of 
> the 32 updates had been installed.  Once again, I had to re-run the play.  
> If the systems hadn't rebooted, I might have considered this a success, as 
> long as all of the updates were applied in one go.  In my case, at least, I 
> don't want the servers to automatically reboot after updates have been 
> applied.  I have a couple of services, for example, to stop gracefully 
> before the update is done.
>
> I don't know if any of what I've mentioned constitutes a bug, or if 
> there's a tweak I can make to the module (I'm no programmer, so I wouldn't 
> know how, anyway).  Your continued advice is appreciated.
>
> Dimitri 
>
> On Wednesday, September 2, 2015 at 12:57:51 PM UTC-4, Dimitri Yioulos 
> wrote:
>
>> I'm trying to use the extras module win_updates to update my Windows 
>> servers.  The play runs without failure, but no updates are applied.
>>
>> Ideally, I want the install all available updates (e.g. critical, 
>> important, optional, etc.).  I've created a play to look like this:
>>
>> ---
>>
>> - hosts: windows
>>   gather_facts: true
>>
>>   tasks:
>>   - name: win update
>>     win_updates:
>>        category: security
>>
>> What do I need to do to make this install the updates, and how to I 
>> install all available updates?
>>
>> Thanks.
>>
>> Dimitri
>>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f46d7f4b-ae7a-44c2-88f8-1cd58550cc5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to