Ansible: Create File With Content - ShellHacks
www.shellhacks.com › ansible-create-file-with-contentDec 29, 2021 · Create File With Content using Ansible. To create an empty file we can use the Ansible’s file module (or win_file ): - name: "Ansible | Creating an empty file" file: path: "< filePath >" state: touch. To create a file with a content, use the Ansible’s copy module (or win_copy ): - name: "Ansible | Creating a file with content" copy: dest: "< filePath >" content: | < line1 > < line2 >.