"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 in Ansible by Anju
45 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 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 in Ansible by Anisha
35 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
175 views
0 votes
1 answer
0 votes
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 in Ansible by Kanika
71 views