文件操作 - mandatory.yml
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3.12/site-packages/ansible/plugins/filter/mandatory.yml
编辑文件内容
DOCUMENTATION: name: mandatory version_added: "historical" short_description: make a variable's existance mandatory description: - Depending on context undefined variables can be ignored or skipped, this ensures they force an error. positional: _input options: _input: description: Mandatory expression. type: raw required: true msg: description: The customized message that is printed when the given variable is not defined. type: str required: false EXAMPLES: | # results in a Filter Error {{ notdefined | mandatory }} # print a custom error message {{ notdefined | mandatory(msg='This variable is required.') }} RETURN: _value: description: The input if defined, otherwise an error. type: raw
修改文件时间
将文件时间修改为当前时间的前一年
删除文件