azure - Ansible 在 azure 批处理节点上更新 HKEY
问题描述
作为 ansible 工作流程的一部分,我希望在运行时使用 ansible 更新天蓝色批处理池 Windows 图像以禁用 Windows 更新
我创建了一个天蓝色批处理节点:
- 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 任务并执行 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
我想在天蓝色批处理池中运行时执行它。有谁知道如何用 ansible 存档?
解决方案
要在批处理池中启动时运行某些内容,您只需将其作为启动任务的一部分 ( https://docs.microsoft.com/en-us/rest/api/batchservice/pool/add#starttask )。
但是,在这种情况下,您可能应该只使用 Azure 功能来关闭自动更新https://docs.microsoft.com/en-us/rest/api/batchservice/pool/add#windowsconfiguration
推荐阅读
- javascript - express js没有执行最后一个功能
- ruby - 安装多个版本时,只有一个版本的 Ruby 有效
- r - 在 R 中定义函数时如何实现列索引?
- matlab - 使用 ImageMagick 创建动画
- cmake - 在 CMake 中为多个配置混合构建标志
- javascript - React Native 项目的增强现实 (AR)
- django - ubuntu 上没有文件夹 - clamd.scan/clamd.sock
- python-3.x - 在 Raspberrypi 上使用烧瓶网络服务器拍摄照片
- python-3.x - 如何在不递归的情况下找到树中节点的总和
- c# - 弹丸不是我的武器的射击方向