My end goal it actually not to install all teh windows updates. I am just 
wanting to upgrade windows 10 boxes to 1909 and the 2004 updates. I am 
trying to get a group of Windows 10 PC of 5-10 and run a upgrade playbook 
and install the 1909 and the 2004 update after hours when the users are not 
at there PCs. 

On Wednesday, July 29, 2020 at 3:21:30 PM UTC-7, Alan Woods wrote:
>
> Hello.
>
> So this is the playbook now have:
>
> ---
>
> - hosts: win10-pro-4
>
>   gather_facts: no
>
>   tasks:
>
>     - name: Install Windows Updates
>
>       win_updates:
>
>         category_names:
>
>           - Application
>
>           - Connectors
>
>           - CriticalUpdates
>
>           - DefinitionUpdates
>
>           - DeveloperKits
>
>           - FeaturePacks
>
>           - Guidance
>
>           - SecurityUpdates
>
>           - ServicePacks
>
>           - Tools
>
>           - UpdateRollups
>
>           - Updates
>
>         state: installed
>
>         reboot: yes
>
>  
>
>     - name: Ensure that WinRM is started when the system has settled
>
>       win_service:
>
>         name: WinRM
>
>         start_mode: delayed
>
> It is weird I have a playbook that tells me what updates there are to 
> install. I ran this playbook I got these updates:
>
>
>
> It is weird I have a playbook that tells me what updates there are to 
> install. I ran this playbook I got these updates:
>
> 2020-07-29 13:48:43Z WUA is available in current logon process, running 
> natively
>
> 2020-07-29 13:48:43Z Creating Windows Update session...
>
> 2020-07-29 13:48:43Z Create Windows Update searcher...
>
> 2020-07-29 13:48:43Z Setting the Windows Update Agent source catalog...
>
> 2020-07-29 13:48:43Z Requested search source is 'default'
>
> 2020-07-29 13:48:43Z Search source set to 'default' (ServerSelection = 0)
>
> 2020-07-29 13:48:43Z Searching for updates to install
>
> 2020-07-29 13:48:48Z Found 4 updates
>
> 2020-07-29 13:48:48Z Creating update collection...
>
> 2020-07-29 13:48:48Z Adding update b3fb7000-1397-452f-81d3-4e9515450bfc - 
> 2020-01 Update for Windows 10 Version 1909 for x64-based Systems (KB4497165)
>
> 2020-07-29 13:48:48Z Adding update d4ea5ecd-03e8-44d2-ada7-bd4fb61446ef - 
> 2020-06 Security Update for Adobe Flash Player for Windows 10 Version 1909 
> for x64-based Systems (KB4561600)
>
> 2020-07-29 13:48:48Z Adding update d8cbe3a9-bcf6-4b76-8e21-e6b063bdc2a9 - 
> 2020-07 Cumulative Update Preview for .NET Framework 3.5 and 4.8 for 
> Windows 10 Version 1909 for x64 (KB4562900)
>
> 2020-07-29 13:48:48Z Adding update e596074e-3f2a-4ac5-b254-e37440d50c47 - 
> 2020-07 Cumulative Update for Windows 10 Version 1909 for x64-based Systems 
> (KB4565483)
>
> 2020-07-29 13:48:48Z Calculating pre-install reboot requirement...
>
> 2020-07-29 13:48:48Z Check mode: exiting...
>
> 2020-07-29 13:48:48Z Return value:
>
> {
>
>     "updates":  {
>
>                     "d8cbe3a9-bcf6-4b76-8e21-e6b063bdc2a9":  {
>
>                                                                  
> "categories":  [
>
>                                                                               
>       
> "Updates",
>
>                                                                               
>       
> "Windows 10, version 1903 and later"
>
>                    
>                                                              ],
>
>                                                                  "title":  
> "2020-07 Cumulative Update Preview for .NET Framework 3.5 and 4.8 for 
> Windows 10 Version 1909 for x64 (KB4562900)",
>
>                                                                  "id":  
> "d8cbe3a9-bcf6-4b76-8e21-e6b063bdc2a9",
>
>                                                                  
> "installed":  false,
>
>                                                                  "kb":  [
>
>                                                                             
> "4562900"
>
>                                                                         ]
>
>                                                              },
>
>                     "d4ea5ecd-03e8-44d2-ada7-bd4fb61446ef":  {
>
>                                                                  
> "categories":  [
>
>                                                                               
>       
> "Security Updates",
>
>                         
>                                                             "Windows 10, 
> version 1903 and later"
>
>                                                                               
>   
> ],
>
>                                                                  "title":  
> "2020-06 Security Update for Adobe Flash Player for Windows 10 Version 
> 1909 for x64-based Systems (KB4561600)",
>
>                                                                  "id":  
> "d4ea5ecd-03e8-44d2-ada7-bd4fb61446ef",
>
>                                                                  
> "installed":  false,
>
>                                                                  "kb":  [
>
>                                                      
>                        "4561600"
>
>                                                                         ]
>
>                                                              },
>
>                     "e596074e-3f2a-4ac5-b254-e37440d50c47":  {
>
>                                                                  
> "categories":  [
>
>                                                                               
>       
> "Security Updates"
>
>                                                                               
>   
> ],
>
>                                                                  "title":  
> "2020-07 Cumulative Update for Windows 10 Version 1909 for x64-based 
> Systems (KB4565483)",
>
>                                                                  "id":  
> "e596074e-3f2a-4ac5-b254-e37440d50c47",
>
>                                                                  
> "installed":  false,
>
>                                                                  "kb":  [
>
>                                                                             
> "4565483"
>
>                                                                         ]
>
>                                                              },
>
>                     "b3fb7000-1397-452f-81d3-4e9515450bfc":  {
>
>                                                                  
> "categories":  [
>
>                                                                               
>       
> "Updates",
>
>                                                                               
>       
> "Windows 10, version 1903 and later"
>
>            
>                                                                      ],
>
>                                                                  "title":  
> "2020-01 Update for Windows 10 Version 1909 for x64-based Systems 
> (KB4497165)",
>
>                                                                  "id":  
> "b3fb7000-1397-452f-81d3-4e9515450bfc",
>
>                                                                  
> "installed":  false,
>
>                                                                  "kb":  [
>
>              
>                                                                "4497165"
>
>                                                                         ]
>
>                                                              }
>
>                 },
>
>     "found_update_count":  4,
>
>     "changed":  false,
>
>     "reboot_required":  false,
>
>     "installed_update_count":  0,
>
>     "filtered_updates":  {
>
>  
>
>                          }
>
> }
>
> 2020-07-29 13:48:48Z Native job completed with output: 
>
> Name                           Value                                          
>                                                                               
>                                            
>
>                                                                               
>                        
>
> ----                           -----                                          
>                                                                             
>
>                                                                               
>                                                                     
>
> updates                        {d8cbe3a9-bcf6-4b76-8e21-e6b063bdc2a9, 
> d4ea5ecd-03e8-44d2-ada7-bd4fb61446ef, e596074e-3f2a-4ac5-b254-e37440d50c47, 
> b3fb7000-1397-452f-81d3-4e9515450bfc}                                         
>                                                                             
>
>
> found_update_count             4                                
>                                                                               
>                                                                               
>                                                                               
>   
>
> changed                        False                                          
>                                                                               
>                                                                               
>                                          
>                          
>
> reboot_required                False                                          
>                                                                               
>                                                                           
>                                                                       
>
> installed_update_count         0                                              
>                                                                               
>                              
>
>                                                                               
>                                      
> filtered_updates               {}
>
>
>
> [image: updates.png]
>
> Then I ran the playbook to install the updates. This is the output of the 
> play:
>
>
>  [vagrant@controller FeatureUpdatePlays]$ ansible-playbook update1.yml 
> -vvv
>
> ansible-playbook 2.9.10
>
>   config file = /etc/ansible/ansible.cfg
>
>   configured module search path = 
> ['/home/vagrant/.ansible/plugins/modules', 
> '/usr/share/ansible/plugins/modules']
>
>   ansible python module location = 
> /usr/lib/python3.6/site-packages/ansible
>
>   executable location = /usr/bin/ansible-playbook
>
>   python version = 3.6.8 (default, Apr 16 2020, 01:36:27) [GCC 8.3.1 
> 20191121 (Red Hat 8.3.1-5)]
>
> Using /etc/ansible/ansible.cfg as config file
>
> host_list declined parsing /etc/ansible/hosts as it did not pass its 
> verify_file() method
>
> script declined parsing /etc/ansible/hosts as it did not pass its 
> verify_file() method
>
> auto declined parsing /etc/ansible/hosts as it did not pass its 
> verify_file() method
>
> Parsed /etc/ansible/hosts inventory source with ini plugin
>
>  
>
> PLAYBOOK: update1.yml 
> ********************************************************************************************************
>
> 1 plays in update1.yml
>
>  
>
> PLAY [win10-pro-4] 
> ***********************************************************************************************************
>
> META: ran handlers
>
>  
>
> TASK [Install Windows Updates] 
> ***********************************************************************************************
>
> task path: 
> /home/vagrant/ansible/win_10_Updates/FeatureUpdatePlays/update1.yml:5
>
> win_updates: running win_updates module
>
> Using module file 
> /usr/lib/python3.6/site-packages/ansible/modules/windows/win_updates.ps1
>
> Pipelining is enabled.
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> EXEC (via pipeline wrapper)
>
> win_updates: check win_updates results for automatic reboot: {"updates": 
> {"d8cbe3a9-bcf6-4b76-8e21-e6b063bdc2a9": {"id": 
> "d8cbe3a9-bcf6-4b76-8e21-e6b063bdc2a9", "title": "2020-07 Cumulative Update 
> Preview for .NET Framework 3.5 and 4.8 for Windows 10 Version 1909 for x64 
> (KB4562900)", "categories": ["Updates", "Windows 10, version 1903 and 
> later"], "kb": ["4562900"], "installed": true}, 
> "d4ea5ecd-03e8-44d2-ada7-bd4fb61446ef": {"id": 
> "d4ea5ecd-03e8-44d2-ada7-bd4fb61446ef", "title": "2020-06 Security Update 
> for Adobe Flash Player for Windows 10 Version 1909 for x64-based Systems 
> (KB4561600)", "categories": ["Security Updates", "Windows 10, version 1903 
> and later"], "kb": ["4561600"], "installed": true}, 
> "e596074e-3f2a-4ac5-b254-e37440d50c47": {"id": 
> "e596074e-3f2a-4ac5-b254-e37440d50c47", "title": "2020-07 Cumulative Update 
> for Windows 10 Version 1909 for x64-based Systems (KB4565483)", 
> "categories": ["Security Updates"], "kb": ["4565483"], "installed": true}, 
> "b3fb7000-1397-452f-81d3-4e9515450bfc": {"id": 
> "b3fb7000-1397-452f-81d3-4e9515450bfc", "title": "2020-01 Update for 
> Windows 10 Version 1909 for x64-based Systems (KB4497165)", "categories": 
> ["Updates", "Windows 10, version 1903 and later"], "kb": ["4497165"], 
> "installed": true}}, "failed_update_count": 0, "found_update_count": 4, 
> "changed": true, "reboot_required": true, "installed_update_count": 4, 
> "filtered_updates": {}, "_ansible_parsed": true}
>
> win_updates: rebooting remote host after update install
>
> EXEC (via pipeline wrapper)
>
> win_updates: rebooting server...
>
> EXEC (via pipeline wrapper)
>
> win_updates: validating reboot
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> EXEC (via pipeline wrapper)
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> EXEC (via pipeline wrapper)
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> EXEC (via pipeline wrapper)
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> EXEC (via pipeline wrapper)
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> EXEC (via pipeline wrapper)
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> EXEC (via pipeline wrapper)
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> win_updates: attempting to get system boot time
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> EXEC (via pipeline wrapper)
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> win_updates: attempting post-reboot test command
>
> EXEC (via pipeline wrapper)
>
> win_updates: system successfully rebooted
>
> win_updates: checking WUA is not busy with win_shell command
>
> Using module file 
> /usr/lib/python3.6/site-packages/ansible/modules/windows/win_shell.ps1
>
> Pipelining is enabled.
>
> EXEC (via pipeline wrapper)
>
> win_updates: shell wait results: {"start": "2020-07-29 09:06:41.805623", 
> "stdout": "False\r\n", "cmd": "(New-Object -ComObject 
> Microsoft.Update.Session).CreateUpdateInstaller().IsBusy", "stderr": "", 
> "changed": true, "rc": 0, "delta": "0:00:04.001559", "end": "2020-07-29 
> 09:06:45.807182", "_ansible_parsed": true, "stdout_lines": ["False"], 
> "stderr_lines": []}
>
> win_updates: ensure the connection is up and running
>
> wait_for_connection: attempting ping module test
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> Using module file 
> /usr/lib/python3.6/site-packages/ansible/modules/windows/win_ping.ps1
>
> Pipelining is enabled.
>
> EXEC (via pipeline wrapper)
>
> win_updates: running win_updates module
>
> Using module file 
> /usr/lib/python3.6/site-packages/ansible/modules/windows/win_updates.ps1
>
> Pipelining is enabled.
>
> EXEC (via pipeline wrapper)
>
> changed: [win10-pro-4] => {
>
>     "changed": true,
>
>     "filtered_updates": {},
>
>     "found_update_count": 4,
>
>     "installed_update_count": 4,
>
>     "reboot_required": false,
>
>     "updates": {
>
>         "b3fb7000-1397-452f-81d3-4e9515450bfc": {
>
>             "categories": [
>
>                 "Updates",
>
>                 "Windows 10, version 1903 and later"
>
>             ],
>
>             "id": "b3fb7000-1397-452f-81d3-4e9515450bfc",
>
>             "installed": true,
>
>             "kb": [
>
>                 "4497165"
>
>             ],
>
>             "title": "2020-01 Update for Windows 10 Version 1909 for 
> x64-based Systems (KB4497165)"
>
>         },
>
>         "d4ea5ecd-03e8-44d2-ada7-bd4fb61446ef": {
>
>             "categories": [
>
>                 "Security Updates",
>
>                 "Windows 10, version 1903 and later"
>
>             ],
>
>             "id": "d4ea5ecd-03e8-44d2-ada7-bd4fb61446ef",
>
>             "installed": true,
>
>             "kb": [
>
>                 "4561600"
>
>             ],
>
>             "title": "2020-06 Security Update for Adobe Flash Player for 
> Windows 10 Version 1909 for x64-based Systems (KB4561600)"
>
>         },
>
>         "d8cbe3a9-bcf6-4b76-8e21-e6b063bdc2a9": {
>
>             "categories": [
>
>                 "Updates",
>
>                 "Windows 10, version 1903 and later"
>
>             ],
>
>             "id": "d8cbe3a9-bcf6-4b76-8e21-e6b063bdc2a9",
>
>             "installed": true,
>
>             "kb": [
>
>                 "4562900"
>
>             ],
>
>             "title": "2020-07 Cumulative Update Preview for .NET 
> Framework 3.5 and 4.8 for Windows 10 Version 1909 for x64 (KB4562900)"
>
>         },
>
>         "e596074e-3f2a-4ac5-b254-e37440d50c47": {
>
>             "categories": [
>
>                 "Security Updates"
>
>             ],
>
>             "id": "e596074e-3f2a-4ac5-b254-e37440d50c47",
>
>             "installed": true,
>
>             "kb": [
>
>                 "4565483"
>
>             ],
>
>             "title": "2020-07 Cumulative Update for Windows 10 Version 
> 1909 for x64-based Systems (KB4565483)"
>
>         }
>
>     }
>
> }
>
>  
>
> TASK [Ensure that WinRM is started when the system has settled] 
> **************************************************************
>
> task path: 
> /home/vagrant/ansible/win_10_Updates/FeatureUpdatePlays/update1.yml:23
>
> Using module file 
> /usr/lib/python3.6/site-packages/ansible/modules/windows/win_service.ps1
>
> Pipelining is enabled.
>
> <win10-pro-4> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 
> win10-pro-4
>
> EXEC (via pipeline wrapper)
>
> ok: [win10-pro-4] => {
>
>     "can_pause_and_continue": false,
>
>     "changed": false,
>
>     "depended_by": [],
>
>     "dependencies": [
>
>         "RPCSS",
>
>         "HTTP"
>
>     ],
>
>     "description": "Windows Remote Management (WinRM) service implements 
> the WS-Management protocol for remote management. WS-Management is a 
> standard web services protocol used for remote software and hardware 
> management. The WinRM service listens on the network for WS-Management 
> requests and processes them. The WinRM Service needs to be configured with 
> a listener using winrm.cmd command line tool or through Group Policy in 
> order for it to listen over the network. The WinRM service provides access 
> to WMI data and enables event collection. Event collection and subscription 
> to events require that the service is running. WinRM messages use HTTP and 
> HTTPS as transports. The WinRM service does not depend on IIS but is 
> preconfigured to share a port with IIS on the same machine.  The WinRM 
> service reserves the /wsman URL prefix. To prevent conflicts with IIS, 
> administrators should ensure that any websites hosted on IIS do not use the 
> /wsman URL prefix.",
>
>     "desktop_interact": false,
>
>     "display_name": "Windows Remote Management (WS-Management)",
>
>     "exists": true,
>
>     "name": "WinRM",
>
>     "path": "C:\\WINDOWS\\System32\\svchost.exe -k NetworkService -p",
>
>     "start_mode": "delayed",
>
>     "state": "running",
>
>     "username": "NT AUTHORITY\\NetworkService"
>
> }
>
> META: ran handlers
>
> META: ran handlers
>
>  
>
> PLAY RECAP 
> *******************************************************************************************************************
>
> win10-pro-4                : ok=2    changed=1    unreachable=0    
> failed=0    skipped=0    rescued=0    ignored=0   
>
>
>
>
> Now when I run the playbook to find what updates are available it shows 
> none which is good. However, when I go to the windows 10 box it shows the 
> downloads still pending. You can see in the screen shot. So I am not sure 
> how to get the windows 10 box to actually install them. 
>                                          
>
> ...

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ce0edeaa-5f5a-4d68-b350-0371d3e3ba12o%40googlegroups.com.

Reply via email to