I'm trying to use Ansible to copy keys from multiple hosts to a remote host
user's authorized_key file. In my inventory, I have a collectors group and
receiver group, as follows:
[collectors]
c1
c2
c3
[receiver]
r1
I want to copy the ssh key from each host in the collectors group to the
authorized_key file of user1 in the receiver group. I know I should user
the authorized_key module, but I'm stuck on how to generate the "key"
directive so it contains all the keys from the collectors group.
- hosts: receiver
tasks:
- name: copy collectors group keys to authorized_keys file
authorized_key:
user: user1
key: ????? (not sure what to use here)
exclusive: yes
I'm looking for some help to properly set the "key" value, or if there is
some completely different and better way to accomplish my goal, please
share. Thanks!
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/0e51973e-d326-4b3c-8693-f37f11c539ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.