Create a file with content using Ansible.

You can use the copy module in Ansible to create a file in remote location with specific content.
Below is the sample script.

  - hosts: webapp
    gather_facts: False

    - name: Copy & Create File.
       dest: /home/justgeek/
       content: |
       On the remote server a file named will be created.
       with this content.

Leave a Reply

Your email address will not be published. Required fields are marked *