更新时间:2022-01-25 09:00:03
我不相信有一种内置的方法可以像这样即时生成日期,但您可以选择使用 lookup 可以使用最新版本.示例:
I don't believe there is a built-in way to generate the date on the fly like that but one option you have is to use a lookup which can shell out to date. Example:
log_path="/var/log/ansible.{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }}.log"