Hi guys/gals,
Any way I can do ssh-copy on multiple hosts via Ansible ad-hoc? I have already added around 50 new hosts in the ansible_hosts inventory file but hit a wall in copying ssh to those new hosts.
Hi guys/gals,
Any way I can do ssh-copy on multiple hosts via Ansible ad-hoc? I have already added around 50 new hosts in the ansible_hosts inventory file but hit a wall in copying ssh to those new hosts.
do you mean your ssh key?
http://docs.ansible.com/ansible/latest/authorized_key_module.html
you could do something like
ansible all -m authorizied_key -a “user=mark key=cat ~/.ssh/id_xor.pub
”
I suppose you mean "ssh-copy-id" to put your pubkey on the ~50 new
hosts that don't have it yet.
What do you mean by "hitting a wall"?
Is it host keys that aren't known yet? Then disable that:
http://docs.ansible.com/ansible/latest/intro_configuration.html#host-key-checking
Or is it something else?
Dick
Sorry for the confusion. Yes, i mean "ssh-copy-id" and hoping to send my pubkey on the new 50 hosts via ad-hoc ansible.
I already tried disabling host_key_checking in the config file but no luck. I guess our machines would require ssh keys and the only option for me is to send it to thise machines
Any other ways you can suggest sending those pubkeys in a single go?
Well if the machines require pubkey authentication (i.e. password authentication not allowed), then you’re stuck as there would be no way to authenticate at all.
Is that the case?
If so you have a bootstrap issue aka chicken and egg problem, and need to provision the keys through other means (as ansible requires SSH).
Dick