首页 > 解决方案 > 无法使用 win_updates 进行修补

问题描述

我尝试了下面的剧本。但由于某种原因,它没有列出我可以在该服务器上的 SCCM 本地查看的补丁程序。请任何指点。

  hosts: all
  gather_facts: no
  tasks:
    - name: Install only particular updates based on the KB numbers for MVC
      win_updates:
#        server_selection: managed_server
        category_name:
        - SecurityUpdates
        - CriticalUpdates
        whitelist:
          - KB2993928
#        state: searched
#        log_path: d:\non-deploy\patches.txt   

我已经尝试过上面的剧本。我什至尝试过 state:search, server_selection: managed server too.(不成功)

我希望找到并应用补丁。

这是输出。

==========
2019-09-16 21:48:16Z WUA is available in current logon process, running natively
2019-09-16 21:48:16Z Creating Windows Update session...
2019-09-16 21:48:16Z Create Windows Update searcher...
2019-09-16 21:48:16Z Setting the Windows Update Agent source catalog...
2019-09-16 21:48:16Z Requested search source is 'default'
2019-09-16 21:48:16Z Search source set to 'default' (ServerSelection = 0)
2019-09-16 21:48:16Z Searching for updates to install
2019-09-16 21:48:20Z Found 0 updates
2019-09-16 21:48:20Z Creating update collection...
2019-09-16 21:48:20Z Calculating pre-install reboot requirement...
2019-09-16 21:48:20Z Check mode: exiting...
2019-09-16 21:48:20Z Return value:
{
    "updates":  {

                },
    "found_update_count":  0,
    "changed":  false,
    "reboot_required":  false,
    "installed_update_count":  0,
    "filtered_updates":  {

                         }
}
2019-09-16 21:48:20Z Native job completed with output: 
Name                           Value                                                                                                                                                                                                                                                                        
----                           -----                                                                                                                                                                                                                                                                        
updates                        {}                                                                                                                                                                                                                                                                           
found_update_count             0                                                                                                                                                                                                                                                                            
changed                        False                                                                                                                                                                                                                                                                        
reboot_required                False                                                                                                                                                                                                                                                                        
installed_update_count         0                                                                                                                                                                                                                                                                            
filtered_updates               {}                                                                                                                                                                                                                                                                           
==========

标签: ansible

解决方案


推荐阅读