文件操作 - relpath.yml
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3.12/site-packages/ansible/plugins/filter/relpath.yml
编辑文件内容
DOCUMENTATION: name: relpath author: Jakub Jirutka (@jirutka) version_added: "1.7" short_description: Make a path relative positional: _input, start description: - Converts the given path to a relative path from the O(start), or relative to the directory given in O(start). options: _input: description: A path. type: str required: true start: description: The directory the path should be relative to. If not supplied the current working directory will be used. type: str EXAMPLES: | # foobar => ../test/me.txt testing: "{{ '/tmp/test/me.txt' | relpath('/tmp/other/') }}" otherrelpath: "{{ mypath | relpath(mydir) }}" RETURN: _value: description: The relative path. type: str
修改文件时间
将文件时间修改为当前时间的前一年
删除文件