diff options
author | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-06-12 11:46:48 +0200 |
---|---|---|
committer | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-08-24 14:55:09 +0200 |
commit | f98c978bd49f2473ce271d4fc69be7e4eea78125 (patch) | |
tree | 861ce43d69348244fef6201f099407fd2abc151f /playbooks/byo | |
parent | ebf6ed8d3d467a95fe62c22f131c82882a34c3ad (diff) | |
download | openshift-f98c978bd49f2473ce271d4fc69be7e4eea78125.tar.gz openshift-f98c978bd49f2473ce271d4fc69be7e4eea78125.tar.bz2 openshift-f98c978bd49f2473ce271d4fc69be7e4eea78125.tar.xz openshift-f98c978bd49f2473ce271d4fc69be7e4eea78125.zip |
Add playbook for running arbitrary health checks
This is useful on its own, and also aids in developing/testing new
checks that are not part of any playbook.
Since the intent when running this playbook is to execute checks, opt
for a less verbose explanation on the error summary.
Diffstat (limited to 'playbooks/byo')
-rw-r--r-- | playbooks/byo/openshift-checks/README.md | 31 | ||||
-rw-r--r-- | playbooks/byo/openshift-checks/adhoc.yml | 6 |
2 files changed, 37 insertions, 0 deletions
diff --git a/playbooks/byo/openshift-checks/README.md b/playbooks/byo/openshift-checks/README.md index 5bb1b2fbf..c17f5b6b7 100644 --- a/playbooks/byo/openshift-checks/README.md +++ b/playbooks/byo/openshift-checks/README.md @@ -26,6 +26,9 @@ callback plugin summarizes execution errors at the end of a playbook run. 3. Certificate expiry playbooks ([certificate_expiry](certificate_expiry)) - check that certificates in use are valid and not expiring soon. +4. Adhoc playbook ([adhoc.yml](adhoc.yml)) - use it to run adhoc checks. + See the [next section](#the-adhoc-playbook) for a usage example. + ## Running With a [recent installation of Ansible](../../../README.md#setup), run the playbook @@ -58,6 +61,34 @@ against your inventory file. Here is the step-by-step: $ ansible-playbook -i <inventory file> playbooks/byo/openshift-checks/certificate_expiry/default.yaml -v ``` +### The adhoc playbook + +The adhoc playbook gives flexibility to run any check or a custom group of +checks. What will be run is determined by the `openshift_checks` variable, +which, among other ways supported by Ansible, can be set on the command line +using the `-e` flag. + +For example, to run the `docker_storage` check: + +```console +$ ansible-playbook -i <inventory file> playbooks/byo/openshift-checks/adhoc.yml -e openshift_checks=docker_storage +``` + +To run more checks, use a comma-separated list of check names: + +```console +$ ansible-playbook -i <inventory file> playbooks/byo/openshift-checks/adhoc.yml -e openshift_checks=docker_storage,disk_availability +``` + +To run an entire class of checks, use the name of a check group tag, prefixed by `@`. This will run all checks tagged `preflight`: + +```console +$ ansible-playbook -i <inventory file> playbooks/byo/openshift-checks/adhoc.yml -e openshift_checks=@preflight +``` + +It is valid to specify multiple check tags and individual check names together +in a comma-separated list. + ## Running in a container This repository is built into a Docker image including Ansible so that it can diff --git a/playbooks/byo/openshift-checks/adhoc.yml b/playbooks/byo/openshift-checks/adhoc.yml new file mode 100644 index 000000000..2ece40e96 --- /dev/null +++ b/playbooks/byo/openshift-checks/adhoc.yml @@ -0,0 +1,6 @@ +--- +- include: ../openshift-cluster/initialize_groups.yml + +- include: ../../common/openshift-cluster/std_include.yml + +- include: ../../common/openshift-checks/adhoc.yml |