I would like to generate the ssh key of all my ansible nodes and copy between thems, so all nodes can access among them.
Example:
[nodes]
172.16.8.231 node1
172.16.8.232 node2
172.16.8.233 node3
172.16.8.234 node4
I would like to copy node1, node2, node3 and node4 ssh keys to all nodes.
So node1 can access to node2, node3 and node4. And same for the rest of the nodes.
I generate the ssh key using the next module:
- name: Generate ssh key
user:
name: "{{ user }}"
generate_ssh_key: yes
ssh_key_bits: 2048
ssh_key_file: .ssh/id_rsa
I know how to create the ssh key on one node and copy to others, but what I want is to generate ssh key on all nodes and copy to others.