diff options
author | Tim Bielawa <tbielawa@redhat.com> | 2016-10-13 13:51:49 -0700 |
---|---|---|
committer | Tim Bielawa <tbielawa@redhat.com> | 2016-10-20 07:52:10 -0700 |
commit | 9075e50ca05037039fc0bfb0742aaf5f5f4ecafb (patch) | |
tree | 679b78411e299b2cb37efe1f0460fc33832ed482 /roles/openshift_certificate_expiry/templates | |
parent | 314da6ffb37c88ca424b927979bae3219251ed5b (diff) | |
download | openshift-9075e50ca05037039fc0bfb0742aaf5f5f4ecafb.tar.gz openshift-9075e50ca05037039fc0bfb0742aaf5f5f4ecafb.tar.bz2 openshift-9075e50ca05037039fc0bfb0742aaf5f5f4ecafb.tar.xz openshift-9075e50ca05037039fc0bfb0742aaf5f5f4ecafb.zip |
Make the json template filter-driven.
Diffstat (limited to 'roles/openshift_certificate_expiry/templates')
-rw-r--r-- | roles/openshift_certificate_expiry/templates/cert-expiry-table.html.j2 | 2 | ||||
-rw-r--r-- | roles/openshift_certificate_expiry/templates/save_json_results.j2 | 21 |
2 files changed, 2 insertions, 21 deletions
diff --git a/roles/openshift_certificate_expiry/templates/cert-expiry-table.html.j2 b/roles/openshift_certificate_expiry/templates/cert-expiry-table.html.j2 index f74d7f1ce..b05110336 100644 --- a/roles/openshift_certificate_expiry/templates/cert-expiry-table.html.j2 +++ b/roles/openshift_certificate_expiry/templates/cert-expiry-table.html.j2 @@ -64,7 +64,7 @@ </p> <ul> <li><b>Expirations checked at:</b> {{ hostvars[host].check_results.check_results.meta.checked_at_time }}</li> - <li><b>Warn after date:</b> {{ hostvars[host].check_results.check_results.meta.warn_after_date }}</li> + <li><b>Warn after date:</b> {{ hostvars[host].check_results.check_results.meta.warn_before_date }}</li> </ul> <table border="1" width="100%"> diff --git a/roles/openshift_certificate_expiry/templates/save_json_results.j2 b/roles/openshift_certificate_expiry/templates/save_json_results.j2 index 9b165f26c..c1173d9ea 100644 --- a/roles/openshift_certificate_expiry/templates/save_json_results.j2 +++ b/roles/openshift_certificate_expiry/templates/save_json_results.j2 @@ -1,20 +1 @@ -{ - "data": { -{% for host in play_hosts %} -{# Pretty print the check results for each host #} - "{{host}}": {{ hostvars[host].check_results.check_results | to_nice_json(indent=6) }}{% if not loop.last %}, -{% else %} - -{% endif %} -{% endfor %} - }, -{# extract the nested warning/expired value from the hostvars object -using items in the playhosts list as a map. Wrap those results up into -a list and then add them all together #} -{%- set warned = play_hosts|map('extract', hostvars, ['check_results', 'summary', 'warning'])|list|sum %} -{%- set expired = play_hosts|map('extract', hostvars, ['check_results', 'summary', 'expired'])|list|sum %} - "summary": { - "warning": {{ warned }}, - "expired": {{ expired }} - } -} +{{ json_result_string | to_nice_json(indent=2)}} |