I need to create or overwrite files on remote hosts. The lineinfile or blockinfile are useful when updating files, but do not create them from scratch or completely overwrite existing ones.
The obvious solution is to use copy , but I would like to have as much stand-alone play as possible, without the files on the side. Can I include the contents of a file in a playbook to create?
Maybe something similar to a variable with the contents of the file, which can be used as the src= parameter for copy (I tried this, but it does not work, since src expects a local file)
source share