Hey,
is there a way to use a file from the machine where I run ansible to use as input for the module lineinfile?
I'm assuming you know about templates
Can you give an example of the sort of thing you're trying to do?
You could use the file lookup to read in the contents of the file you wish, for instance:
{{ lookup(‘file’, ‘/path/to/file/you/want’) }}
Though as Dick mentioned above, it is almost always better to use templates when possible.
I’m not sure what you mean here? Are you wanting to create a file on the destination machine based on one on the source machine with changes? If so then templates are what you want (and the file module rather than lineinfile)
If you want to provide multiple patterns/changes to lineinfile then you either want to use templates and assemble or lineinfile and with_items…
If it’s something else perhaps you should tell us your use case rather than ask how to do something… Perhaps people have an entirely different way to do what you want…
Adam