日期日期过滤器可将数据和时间显示为“ 5月11日,10:36 PM”

问题描述 投票:0回答:1

我在操作员中收集了ansible_date_time事实,但希望在我的statusDescriptor字段之一上将其显示为“ Month Day,time”,例如东部时间的“ May 10th 10:36 PM”。我们如何使用ansible实现这一目标?

datetime ansible ansible-2.x ansible-facts
1个回答
0
投票
tasks: - debug: msg="{{ lookup('pipe','date') }}"

由于pipe返回给定命令的输出,因此您可以构建date命令可用的任何可能格式。对于日期支持的可能格式,请运行man date

© www.soinside.com 2019 - 2024. All rights reserved.