I've been looking at the -vvvv output and it doesn't really help. I guess I should ask this question.. Does this module work for copying over the initial key? Or does it only work if there is already an ssh-key set up for ansible to use?
On Tuesday, February 23, 2016 at 2:32:30 PM UTC-5, Dick Davies wrote: > > Try with '-vvvv' for starters, and compare with SSHing with the > servers directly. > > > > On 23 February 2016 at 18:48, chrono <carl.b...@gmail.com <javascript:>> > wrote: > > Hello, > > > > I wrote a playbook that checks out brand new servers that are built for > my > > team. To make things truly one-and-done, I thought it would be clever > to > > include a play that copies the ssh public key from our ansible > controller to > > the freshly built remote hosts. > > > > I tried using the authorized_key module, but it doesn't seem to work.. > > > > Here is the play: > > > > --- > > - name: Checkout new build > > hosts: all > > remote_user: blah > > tasks: > > - name: copy ssh key to remote host > > authorized_key: > > user: blah > > key: "{{ lookup('file', '/home/blah/.ssh/id_rsa.pub') }}" > > > > > > Here is the error I get: > > > > TASK [setup] > > ******************************************************************* > > fatal: [hostname redacted]: UNREACHABLE! => {"changed": false, "msg": > > "ERROR! SSH encountered an unknown error during the connection. We > recommend > > you re-run the command using -vvvv, which will enable SSH debugging > output > > to help diagnose the issue", "unreachable": true} > > > > Here is the command I am running: > > > > ansible-playbook -i /home/blah/ansible/inventory/newBuilds.hosts > > /home/blah/ansible/playbooks/linuxCheckout/linuxCheckout.yml --ask-pass > > > > > > Am I doing something wrong? > > > > Best regards, > > > > -C > > > > -- > > 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 ansible-proje...@googlegroups.com <javascript:>. > > To post to this group, send email to ansible...@googlegroups.com > <javascript:>. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/ansible-project/52be1e8d-ccec-4241-bc18-98e1ede7b77c%40googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. > -- 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 ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1c22cb8c-e86f-452c-a2d3-53cdad068199%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.