Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions inventory/byo/hosts.example
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,17 @@ openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true',
# Setting this variable to true will override that check.
#openshift_override_hostname_check=true

# openshift-ansible will fail when it detects that a host
# could not resove all of the cluster members' hostnames. This mis-configuration might
# be problematic for the cluster setup and for pods using host networking.
# Setting this variable to true will override that check.
#openshift_override_resolve_check=true

# openshift-ansible will fail when it detects that a host
# could not ping all of the cluster members'. This mis-configuration is probably
# not problematic at all. Setting this variable to true will override that check.
#openshift_override_icmp_check=true

# openshift_use_dnsmasq is deprecated. This must be true, or installs will fail
# in versions >= 3.6
#openshift_use_dnsmasq=False
Expand Down
3 changes: 2 additions & 1 deletion playbooks/byo/openshift-checks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ callback plugin summarizes execution errors at the end of a playbook run.

1. Pre-install playbook ([pre-install.yml](pre-install.yml)) - verifies system
requirements and look for common problems that can prevent a successful
installation of a production cluster.
installation of a production cluster. Includes simple hosts level checks
for DNS resolve and ICMP ping.

2. Diagnostic playbook ([health.yml](health.yml)) - check an existing cluster
for known signs of problems.
Expand Down
6 changes: 6 additions & 0 deletions playbooks/byo/openshift-checks/connectivity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- include: ../openshift-cluster/initialize_groups.yml

- include: ../../common/openshift-cluster/std_include.yml

- include: ../../common/openshift-checks/connectivity.yml
5 changes: 5 additions & 0 deletions playbooks/common/openshift-checks/adhoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@
action: openshift_health_check
args:
checks: '{{ openshift_checks | default([]) }}'

# TODO(bogdando) trigger from the connectivity.py check
- include: connectivity.yml
when: ('@connectivity' in openshift_checks | default([]) or
'connectivity' in openshift_checks | default([]))
23 changes: 23 additions & 0 deletions playbooks/common/openshift-checks/connectivity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
- name: OpenShift hosts level DNS/connectivity checks
hosts: oo_all_hosts
tasks:
- name: Check DNS resolve for cluster hosts
command: getent ahostsv4 {{ item }}
register: lookuphost
changed_when: false
check_mode: false
with_items: "{{ groups.oo_all_hosts }}"
when:
- item not in [ openshift.common.hostname, ansible_nodename ]
- not openshift_override_resolve_check | default(false) | bool

- name: Check ICMP ping for cluster hosts
command: ping -c3 -W1 -w2 {{ item }}
register: pinghost
changed_when: false
check_mode: false
with_items: "{{ groups.oo_all_hosts }}"
when:
- item not in [ openshift.common.hostname, ansible_nodename ]
- not openshift_override_icmp_check | default(false) | bool
3 changes: 3 additions & 0 deletions playbooks/common/openshift-checks/pre-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@
action: openshift_health_check
args:
checks: ['@preflight']

# TODO(bogdando) trigger from the connectivity.py check
- include: connectivity.yml
22 changes: 22 additions & 0 deletions roles/openshift_health_checker/openshift_checks/connectivity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""Check auto-discovery entry for an external connectivity check."""

from openshift_checks import OpenShiftCheck


class ConnectivityExternal(OpenShiftCheck):
"""Check is not managed here. It is an ansible playbook."""

name = "connectivity"
tags = ["pre-flight", "connectivity"]

def is_active(self):
"""It is always active as externally managed."""
return super(ConnectivityExternal, self).is_active()

def run(self):
# TODO(bogdando) implement an ansible playbook call
# for the external playbook. For now, it is included
# elsewhere
self.register_log("Not implemented",
"Use ansible to invoke this connectivity check")
return {}