一、file模块(重点)
file模块用于对文件或文件夹相关的操作,主要用来设置文件、链接、目录的属性,或者移除文件、链接、目录,很多其他的模块也会包含这种作用,例如copy,assemble和template。
https://docs.ansible.com/ansible/latest/modules/file_module.html#file-module
| 参数 | 说明 |
|---|---|
| path | 文件绝对路径 |
| state | 操作(touch文件新建、absent删除、link软连接、hard硬链接、directory目录创建) |
| owner | 设置所有者 |
| group | 设置所属的... |

