I am using Ansible copy module as follows:
src: folder/file.cert
dest: file_dest.cert
Above works fine for files. But if I want to use Ansible Tower for certain inventories, I will provide file.cert as a variable.
Now src is not working anymore and I need to use the following:
content: file_cert_variable
dest: file_dest.cert
So far so good. But now I want to combine both worlds, so that I don't have to add a conditional in case we use Tower variables for some environments and, in other environments, files as source for certificates.
Is there a way to cover both cases with a single Ansible command?