summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Bielawa <tbielawa@redhat.com>2016-10-10 10:54:53 -0700
committerTim Bielawa <tbielawa@redhat.com>2016-10-20 07:52:10 -0700
commit314da6ffb37c88ca424b927979bae3219251ed5b (patch)
tree42e4f099139c0db413f8b7821baf56e7f5a92fec
parent62d9ece28e270a2088511b0d37fa85de3b81bcce (diff)
downloadopenshift-314da6ffb37c88ca424b927979bae3219251ed5b.tar.gz
openshift-314da6ffb37c88ca424b927979bae3219251ed5b.tar.bz2
openshift-314da6ffb37c88ca424b927979bae3219251ed5b.tar.xz
openshift-314da6ffb37c88ca424b927979bae3219251ed5b.zip
Add JSON result CLI parsing notes to the README
-rw-r--r--roles/openshift_certificate_expiry/README.md36
1 files changed, 32 insertions, 4 deletions
diff --git a/roles/openshift_certificate_expiry/README.md b/roles/openshift_certificate_expiry/README.md
index f296c905e..d44438332 100644
--- a/roles/openshift_certificate_expiry/README.md
+++ b/roles/openshift_certificate_expiry/README.md
@@ -50,7 +50,7 @@ Default behavior:
```yaml
---
- name: Check cert expirys
- hosts: all
+ hosts: nodes:masters:etcd
become: yes
gather_facts: no
roles:
@@ -62,7 +62,7 @@ Generate HTML and JSON artifacts in their default paths:
```yaml
---
- name: Check cert expirys
- hosts: all
+ hosts: nodes:masters:etcd
become: yes
gather_facts: no
vars:
@@ -78,7 +78,7 @@ the module out):
```yaml
---
- name: Check cert expirys
- hosts: all
+ hosts: nodes:masters:etcd
become: yes
gather_facts: no
vars:
@@ -93,7 +93,7 @@ the module out) and save the results as a JSON file:
```yaml
---
- name: Check cert expirys
- hosts: all
+ hosts: nodes:masters:etcd
become: yes
gather_facts: no
vars:
@@ -198,6 +198,34 @@ The example below is abbreviated to save space:
}
```
+The `summary` from the json data can be easily checked for
+warnings/expirations using a variety of command-line tools.
+
+For exampe, using `grep` we can look for the word `summary` and print
+out the 2 lines **after** the match (`-A2`):
+
+```
+$ grep -A2 summary /tmp/cert-expiry-report.json
+ "summary": {
+ "warning": 16,
+ "expired": 0
+```
+
+If available, the [jq](https://stedolan.github.io/jq/) tool can also
+be used to pick out specific values. Example 1 and 2 below show how to
+select just one value, either `warning` or `expired`. Example 3 shows
+how to select both values at once:
+
+```
+$ jq '.summary.warning' /tmp/cert-expiry-report.json
+16
+$ jq '.summary.expired' /tmp/cert-expiry-report.json
+0
+$ jq '.summary.warning,.summary.expired' /tmp/cert-expiry-report.json
+16
+0
+```
+
Requirements
------------