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/library/openshift_cert_expiry.py | |
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/library/openshift_cert_expiry.py')
-rw-r--r-- | roles/openshift_certificate_expiry/library/openshift_cert_expiry.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py b/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py index 6e27a7ebd..1d0507537 100644 --- a/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py +++ b/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py @@ -36,7 +36,7 @@ description: - C(days_remaining) - The number of days until the certificate expires. - C(expiry) - The date the certificate expires on. - C(path) - The full path to the certificate on the examined host. -version_added: "0.0" +version_added: "1.0" options: config_base: description: @@ -127,13 +127,6 @@ A 3-tuple of the form: (certificate_common_name, certificate_expiry_date, certif OpenSSL.crypto.FILETYPE_PEM, _cert_string) ###################################################################### - # Read just the first name from the cert - DISABLED while testing - # out the 'get all possible names' function (below) - # - # Strip the subject down to just the value of the first name - # cert_subject = cert_loaded.get_subject().get_components()[0][1] - - ###################################################################### # Read all possible names from the cert cert_subjects = [] for name, value in cert_loaded.get_subject().get_components(): @@ -227,7 +220,7 @@ Return: def tabulate_summary(certificates, kubeconfigs, etcd_certs, router_certs, registry_certs): """Calculate the summary text for when the module finishes -running. This includes counds of each classification and what have +running. This includes counts of each classification and what have you. Params: @@ -236,6 +229,7 @@ Params: dicts with filled in `health` keys for system certificates. - `kubeconfigs` - as above for kubeconfigs - `etcd_certs` - as above for etcd certs + Return: - `summary_results` (dict) - Counts of each cert type classification @@ -290,7 +284,7 @@ an OpenShift Container Platform cluster supports_check_mode=True, ) - # Basic scaffolding for OpenShift spcific certs + # Basic scaffolding for OpenShift specific certs openshift_base_config_path = module.params['config_base'] openshift_master_config_path = os.path.normpath( os.path.join(openshift_base_config_path, "master/master-config.yaml") @@ -317,6 +311,10 @@ an OpenShift Container Platform cluster ) ) + # Validate some paths we have the ability to do ahead of time + openshift_cert_check_paths = filter_paths(openshift_cert_check_paths) + kubeconfig_paths = filter_paths(kubeconfig_paths) + # etcd, where do you hide your certs? Used when parsing etcd.conf etcd_cert_params = [ "ETCD_CA_FILE", |