summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorRodolfo Carvalho <rhcarvalho@gmail.com>2017-01-31 18:27:11 +0100
committerRodolfo Carvalho <rhcarvalho@gmail.com>2017-02-10 14:46:40 +0100
commitd6cebd0f5c43762469b1218e1e4e4bdb608cda19 (patch)
treef1bfa8621c6898a5276587549366a48f94e0af0a /roles
parentc838e0f0b79b1471c47addf50c46fdb12281812c (diff)
downloadopenshift-d6cebd0f5c43762469b1218e1e4e4bdb608cda19.tar.gz
openshift-d6cebd0f5c43762469b1218e1e4e4bdb608cda19.tar.bz2
openshift-d6cebd0f5c43762469b1218e1e4e4bdb608cda19.tar.xz
openshift-d6cebd0f5c43762469b1218e1e4e4bdb608cda19.zip
Document how to create new checks
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_health_checker/HOWTO_CHECKS.md34
-rw-r--r--roles/openshift_health_checker/README.md2
2 files changed, 36 insertions, 0 deletions
diff --git a/roles/openshift_health_checker/HOWTO_CHECKS.md b/roles/openshift_health_checker/HOWTO_CHECKS.md
new file mode 100644
index 000000000..1573c14da
--- /dev/null
+++ b/roles/openshift_health_checker/HOWTO_CHECKS.md
@@ -0,0 +1,34 @@
+# OpenShift health checks
+
+This Ansible role contains health checks to diagnose problems in OpenShift
+environments.
+
+Checks are typically implemented as two parts:
+
+1. a Python module in [openshift_checks/](openshift_checks), with a class that
+ inherits from `OpenShiftCheck`.
+2. a custom Ansible module in [library/](library), for cases when the modules
+ shipped with Ansible do not provide the required functionality.
+
+The checks are called from an Ansible playbooks via the `openshift_health_check`
+action plugin. See
+[playbooks/byo/openshift-preflight/check.yml](../../playbooks/byo/openshift-preflight/check.yml)
+for an example.
+
+The action plugin dynamically discovers all checks and executes only those
+selected in the play.
+
+Checks can determine when they are active by implementing the method
+`is_active`. Inactive checks are skipped. This is similar to the `when`
+instruction in Ansible plays.
+
+Checks may have tags, which are a way to group related checks together. For
+instance, to run all preflight checks, pass in the group `'@preflight'` to
+`openshift_health_check`.
+
+Groups are automatically computed from tags.
+
+Groups and individual check names can be used together in the argument list to
+`openshift_health_check`.
+
+Look at existing checks for the implementation details.
diff --git a/roles/openshift_health_checker/README.md b/roles/openshift_health_checker/README.md
index 745e45b50..4ab5f1f7b 100644
--- a/roles/openshift_health_checker/README.md
+++ b/roles/openshift_health_checker/README.md
@@ -4,6 +4,8 @@ OpenShift Health Checker
This role detects common problems with OpenShift installations or with
environments prior to install.
+For more information about creating new checks, see [HOWTO_CHECKS.md](HOWTO_CHECKS.md).
+
Requirements
------------