f8187bda2c
To detect if we can copy keyrings off a monitor, we do not need to introduce a hard dependency on SSH contact, we only need to ensure that the ansible has a working execution path to the monitor over what ever connection plugin is used. Change-Id: Idb9a178ca2165920804eee12a54419722aa64f51
41 lines
1.2 KiB
YAML
41 lines
1.2 KiB
YAML
---
|
|
# Copyright 2015, Serge van Ginderachter <serge@vanginderachter.be>
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# look for 1 ceph monitor host that is up
|
|
- name: Verify Ceph monitors are up
|
|
wait_for_connection:
|
|
connect_timeout: 3
|
|
timeout: 10
|
|
delegate_to: "{{ item }}"
|
|
with_items: "{{ ceph_mons }}"
|
|
changed_when: false
|
|
failed_when: false
|
|
register: ceph_mon_upcheck
|
|
|
|
- name: Set ceph_mon_host to an online monitor host
|
|
set_fact:
|
|
ceph_mon_host: '{{ item.item }}'
|
|
when:
|
|
- item is success
|
|
# Use the first available monitor
|
|
- ceph_mon_host is not defined
|
|
with_items: "{{ ceph_mon_upcheck.results }}"
|
|
|
|
- name: Fail when no ceph_mon_host is reachable
|
|
fail:
|
|
msg: "No Ceph Monitor reachable"
|
|
when:
|
|
- ceph_mon_host is undefined
|