I'm currently setting up a system with ansible and want to automate it as much as possible.
So I'm creating the public keys on my ansible machine and copy them to the hosts so that I can control the hosts as much as possible from the outside.
Now I need to setup connectivity between my hosts via public keys.
I'm using the lineinfile
module to ensure that the keys are present in the authorized_keys
and known_hosts
files. Is there a way to read the contents of a file (on the machine from where ansible is run) and use it as input for the lineinfile
module?