N
N
Nikon_NLG2015-12-16 12:20:54
Ansible
Nikon_NLG, 2015-12-16 12:20:54

How to skip ssh error in ansible?

Good afternoon.
Task: When installing the server, there is a default user, I create the second one and delete the first one. When you start the playbook, you want to check if the first one is alive. Unfortunately, ignore_errors has no effect.

tasks:
    - name: check if default user exists
      command: /bin/true
      user: default_user
      register: user_enabled
      ignore_errors: True
    - include: remove_default.yml
      when: user_enabled.rc == 0

Crashes with error
fatal: [xxx.xxx.xxx.xxx] => SSH Error: Received disconnect from xxx.xxx.xxx.xxx: 2: Too many authentication failures for default_user

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2015-12-16
@opium

enter the correct keys or password

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question