From 73e0a2ec71afd607bfb9e3b246238879fcde2408 Mon Sep 17 00:00:00 2001 From: juanvallejo Date: Tue, 6 Jun 2017 12:41:49 -0400 Subject: [PATCH] add pre-flight checks to ugrade path --- .../common/openshift-cluster/upgrades/init.yml | 2 ++ .../upgrades/pre/verify_health_checks.yml | 13 +++++++++++++ .../callback_plugins/zz_failure_summary.py | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 playbooks/common/openshift-cluster/upgrades/pre/verify_health_checks.yml diff --git a/playbooks/common/openshift-cluster/upgrades/init.yml b/playbooks/common/openshift-cluster/upgrades/init.yml index 0f421928bc9..54bdf1b9290 100644 --- a/playbooks/common/openshift-cluster/upgrades/init.yml +++ b/playbooks/common/openshift-cluster/upgrades/init.yml @@ -23,3 +23,5 @@ set_fact: os_firewall_use_firewalld: false when: "'Active: active' in service_iptables_status.stdout" + +- include: ./pre/verify_memory_and_diskspace.yml diff --git a/playbooks/common/openshift-cluster/upgrades/pre/verify_health_checks.yml b/playbooks/common/openshift-cluster/upgrades/pre/verify_health_checks.yml new file mode 100644 index 00000000000..651d7b34f84 --- /dev/null +++ b/playbooks/common/openshift-cluster/upgrades/pre/verify_health_checks.yml @@ -0,0 +1,13 @@ +--- +- name: Verify Host Requirements + hosts: oo_all_hosts + roles: + - openshift_health_checker + vars: + - r_openshift_health_checker_playbook_context: "upgrade" + post_tasks: + - action: openshift_health_check + args: + checks: + - disk_availability + - memory_availability diff --git a/roles/openshift_health_checker/callback_plugins/zz_failure_summary.py b/roles/openshift_health_checker/callback_plugins/zz_failure_summary.py index 64c29a8d970..7c813085ea9 100644 --- a/roles/openshift_health_checker/callback_plugins/zz_failure_summary.py +++ b/roles/openshift_health_checker/callback_plugins/zz_failure_summary.py @@ -95,7 +95,7 @@ def _print_check_failure_summary(self, failed_checks, context): 'Variables can be set in the inventory or passed on the\n' 'command line using the -e flag to ansible-playbook.\n' ).format(playbook=self._playbook_file, checks=checks) - if context in ['pre-install', 'health']: + if context in ['pre-install', 'upgrade', 'health']: summary = ( '\n' 'You may choose to configure or disable failing checks by\n'