After some testing, I don't actually think the ping module will help. If it can't reach a target via SSH then it aborts playbook execution with a "fatal"/"unreachable" error.
Instead, the following code seems to work for testing SSH reachability. It uses whatever SSH users and ports are defined in ~/.ssh/config, the same way that you override these defaults for OSA overall.
After some testing, I don't actually think the ping module will help. If it can't reach a target via SSH then it aborts playbook execution with a "fatal" /"unreachable" error.
Instead, the following code seems to work for testing SSH reachability. It uses whatever SSH users and ports are defined in ~/.ssh/config, the same way that you override these defaults for OSA overall.
``` create- config client- keyrings nova-libvirt- secret
- name: Verify Ceph monitors are up
local_action: shell ssh {{ item }} "echo pong"
with_items: "{{ ceph_mons }}"
changed_when: false
failed_when: false
register: ceph_mon_upcheck
tags:
- ceph-config-
- ceph-auth-
- ceph-auth-
- name: Set ceph_mon_host to an online monitor host
ceph_ mon_host: '{{ item.item }}' upcheck. results }}" create- config client- keyrings nova-libvirt- secret
set_fact:
when: item.stdout == 'pong'
with_items: "{{ ceph_mon_
tags:
- ceph-config-
- ceph-auth-
- ceph-auth-
```