windows - 重启命令失败,错误是:关机:错误的日期转换:
问题描述
我正在为 Windows 使用 ansible。下面提到的重新启动剧本代码在一组机器中执行,而不是在另一组机器中执行。
---
-
gather_facts: true
hosts: SoftwareUpgrade
tasks:
-
win_updates:
category_names:
- CriticalUpdates
- SecurityUpdates
reboot: no
-
win_reboot:
msg: "Reboot initiated by Ansible"
reboot_timeout: 7200
post_reboot_delay: 600
test_command: whoami
connect_timeout: 5
错误
致命:[此处输入机器 FQDN]:失败!=> {"changed": false, "elapsed": 0, "msg": "Reboot command failed, error was: shutdown: Bad date conversion: /r\r\n\r\n#< CLIXML\r\n <Obj 版本="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"> System.Management.Automation.PSCustomObjectSystem.Object<I64 N="SourceId">1<PR N="Record">准备模块以供首次使用。0-1-1Completed-1 ", "rebooted": false, "start" :“2021-08-17T09:06:54.071067”}
工作盒在本地,失败在云上。另一个区别是操作系统(工作是 2012 年,失败是 2019 年)。
在运行与 Oracle 客户端安装、bat 运行、powershell 运行和安装 JDK 相关的其他剧本时,我没有看到任何问题。唯一的问题是重启命令(win_reboot
ansible 模块)。即使是没有任何参数的简单重启也会失败。
解决方案
推荐阅读
- android - 如何测试使用 ActivityResult API 的 Activity?
- python - 如何解决 python 上的 openCV 问题 - 未加载库:@rpath/libglib-2.0.0.dylib
- excel - 如果范围内的单元格不为空,则添加具有该特定值的行并复制一些其他值
- mysql - 从出生日期计算年龄与年龄之间的条件
- reactjs - 从 redux 获取数据。为什么我的加载屏幕不起作用?
- reactjs - 如何在成帧运动中为背景图像设置动画?
- browser - WebUSB API 和 PC/SC 智能卡读卡器
- docker - 通过 docker-compose 与 Collabora CODE / Nextcloud / Traefik 反向代理混合内容错误
- pentaho - 为什么我在 pentaho 中过滤行年龄 > 0 时会减号?
- java - 我收到一个未知的列错误,但我确实有该列?