---

- name: Try to ping host with expected credentials
  action: ping
  ignore_unreachable: true
  ignore_errors: yes
  register: pingtest
- meta: clear_host_errors
- name: Shift if ping fails
  set_fact:
    bootstrap_used: yes
    ansible_user: '{{ bootstrap_user }}'
    ansible_become_pass: '{{ bootstrap_become_pass }}'
  when: pingtest.failed | d(pingtest.unreachable) | d(false)
