FATAL all hosts have already failed -- aborting - Ansible error

0 votes

I'm trying to create an infrastructure for ssh connections. This is my playbooks/tasks

- name: Copy ssh key to each server
  copy: src=static_folder_key dest=/home/ec2-user/.ssh/ mode=0600

- name: Enable ssh Agent
  shell: eval $(ssh-agent -s)

- name: Adding ssh key for static forlder project
  shell: ssh-add /home/ec2-user/.ssh/static_folder_key
  sudo: True

But I end up getting the following error:

FATAL: all hosts have already failed -- aborting
Feb 7, 2019 in Ansible by Anju
1,359 views

1 answer to this question.

0 votes

Hey @Anju, you could change your second task a little. Execute eval "$(ssh-agent)" first and then do ssh-add in the same step, like this:

 - name: Evaluating the authentication agent & adding the key...
    shell: |
      eval "$(ssh-agent)"
      ssh-add ~/.ssh/id_rsa_svn_ssh
answered Feb 7, 2019 by Sri

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How do I make my_dir available for all hosts? - Ansible

Hey @Kiara,  f you want to make my_dir available to ...READ MORE

answered Feb 1, 2019 in Ansible by Anisha
1,110 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,024 views
+2 votes
1 answer
+1 vote
3 answers
0 votes
1 answer

CRC check failed error when pulling ansible role from git

You can try adding --no-wait option to the ansible-galaxy import call ...READ MORE

answered Mar 14, 2019 in Ansible by Kanika
1,072 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP