Answer the question
In order to leave comments, you need to log in
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
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question