Ansible在azure批处理节点上更新HKEY

Ansible在azure批处理节点上更新HKEY,azure,ansible,azure-batch,Azure,Ansible,Azure Batch,作为ansible工作流的一部分,我希望在运行时使用ansible更新azure批处理池windows映像以禁用windows更新 我已创建azure批处理节点: - name: Create Batch Account azure_rm_batchaccount: resource_group: MyResGroup name: mybatchaccount location: eastus auto_storage_account:

作为ansible工作流的一部分,我希望在运行时使用ansible更新azure批处理池windows映像以禁用windows更新

我已创建azure批处理节点:

- name: Create Batch Account
  azure_rm_batchaccount:
      resource_group: MyResGroup
      name: mybatchaccount
      location: eastus
      auto_storage_account:
      name: mystorageaccountname
      pool_allocation_mode: batch_service
我知道,事实上,我可以在azure批处理节点中使用Start task并执行a cmd将Hkey更改为NoUpdate=1

我准备了一个ansible片段:

- name: "Ensure 'Configure Automatic Updates' is set to 'Disabled'"
  win_regedit:
    path: HKLM:\Software\Policies\Microsoft\Windows\Windowsupdate\Au
    name: "NoAutoUpdate"
    data: "1"
    type: dword
我想在azure批处理池的运行时执行它。
有人知道如何用ansible存档吗?

要在批处理池中启动时运行某些东西,只需将其作为开始任务()的一部分就可以了

不过,在这种情况下,您可能只需要使用Azure功能来关闭自动更新