我的任务是将文件夹中的文件、模板文件夹中的模板复制到远程主机``
模板文件只有文本。
templates/templateexample.txt.j2 =>这是要传输的示例模板。
变量/main.yml
---
project_files:
files:
- src: "examplefile1.txt"
dst: "~/examplefile1.txt"
mode: '0755'
force: false
templates:
- src: "templateexample.txt.j2"
dst: "~/templateexample.txt"
mode: '0755'
force: false
Run Code Online (Sandbox Code Playgroud) ansible ×1