【发布时间】:2018-03-15 15:38:06
【问题描述】:
使用ansible的win_update模块
剧本:
- name: Update
tasks:
- name: Check updates
register: result
win_updates:
state: searched
- debug: var=result
hosts: windows
主持人:
all:
children:
windows:
hosts:
somehost:
组变量:
ansible_user: someuser
ansible_password: somepassword
ansible_connection: winrm
ansible_port: 5986
ansible_winrm_server_cert_validation: ignore
在调试中得到结果:
ok: [somehost] => {
"result": {
"changed": false,
"failed": false,
"filtered_updates": {},
"found_update_count": 2,
"installed_update_count": 0,
"reboot_required": false,
"updates": {
"8fde14d1-2fd6-4705-b2ab-b2aaf1aa7a05": {
"id": "8fde14d1-2fd6-4705-b2ab-b2aaf1aa7a05",
"installed": false,
"kb": [
"4054518"
],
"title": "��������� ����� ��ࠢ����� ����⢠ ��⥬� ������᭮�� ��� ��⥬ Windows 7 �� ���� ����� x64 (KB4054518), 12 2017 �."
},
"bc3e1d56-c863-467e-a13d-77460eff0dcc": {
"id": "bc3e1d56-c863-467e-a13d-77460eff0dcc",
"installed": false,
"kb": [
"890830"
],
"title": "�।�⢮ 㤠����� �।������ �ணࠬ� ��� ������� x64: ���� 2018 �. (KB890830)"
}
}
}
}
我应该在哪里更改普通 Windows 更新标题名称的代码? win_update powershell 脚本或 winrm 或其他地方
更新: 不幸的是,当我使用稳定版本的 ansible (2.4.3.0) 时,出现错误:
ansible win10.dev -i hosts -m win_updates -a 'state=searched'
win10.dev | FAILED! => {
"changed": false,
"module_stderr": "An error occurred while creating the pipeline.\r\n + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException\r\n + FullyQualifiedErrorId : RuntimeException\r\n \r\nTimed out waiting for scheduled task to start\r\nAt line:334 char:9\r\n+ Throw \"Timed out waiting for scheduled task to start\"\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : OperationStopped: (Timed out waiti...d task to start:String) [], RuntimeException\r\n + FullyQualifiedErrorId : Timed out waiting for scheduled task to start\r\n \r\n\r\n",
"module_stdout": "",
"msg": "MODULE FAILURE",
"rc": 1
}
在这个线程中(https://github.com/ansible/ansible/issues/25298)我没有找到决定,所以我必须使用ansible存储库的@devel分支。
【问题讨论】:
标签: windows ansible cyrillic windows-update