我在操作员中收集了ansible_date_time事实,但希望在我的statusDescriptor字段之一上将其显示为“ Month Day,time”,例如东部时间的“ May 10th 10:36 PM”。我们如何使用ansible实现这一目标?
tasks:
- debug: msg="{{ lookup('pipe','date') }}"
由于pipe
返回给定命令的输出,因此您可以构建date
命令可用的任何可能格式。对于日期支持的可能格式,请运行man date