summaryrefslogtreecommitdiffstats
path: root/filter_plugins
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@redhat.com>2016-02-26 11:44:26 -0500
committerAndrew Butcher <abutcher@redhat.com>2016-02-26 11:50:20 -0500
commit61b55d0cb1a9d5cc7ab282fc9f76f4fe6035d3c8 (patch)
tree677c90e53aefd3eed5ddb79ed38552fc443c600a /filter_plugins
parentb9a364c1025e1c3075ac2bc8e26f3ceb4d42cb2b (diff)
downloadopenshift-61b55d0cb1a9d5cc7ab282fc9f76f4fe6035d3c8.tar.gz
openshift-61b55d0cb1a9d5cc7ab282fc9f76f4fe6035d3c8.tar.bz2
openshift-61b55d0cb1a9d5cc7ab282fc9f76f4fe6035d3c8.tar.xz
openshift-61b55d0cb1a9d5cc7ab282fc9f76f4fe6035d3c8.zip
Synchronize master kube configs
Diffstat (limited to 'filter_plugins')
-rw-r--r--filter_plugins/openshift_master.py31
1 files changed, 30 insertions, 1 deletions
diff --git a/filter_plugins/openshift_master.py b/filter_plugins/openshift_master.py
index c41367f05..3a1d77f53 100644
--- a/filter_plugins/openshift_master.py
+++ b/filter_plugins/openshift_master.py
@@ -501,7 +501,36 @@ class FilterModule(object):
valid = False
return valid
+ @staticmethod
+ def certificates_to_synchronize(hostvars):
+ ''' Return certificates to synchronize based on facts. '''
+ if not issubclass(type(hostvars), dict):
+ raise errors.AnsibleFilterError("|failed expects hostvars is a dict")
+ certs = ['admin.crt',
+ 'admin.key',
+ 'admin.kubeconfig',
+ 'master.kubelet-client.crt',
+ 'master.kubelet-client.key',
+ 'openshift-registry.crt',
+ 'openshift-registry.key',
+ 'openshift-registry.kubeconfig',
+ 'openshift-router.crt',
+ 'openshift-router.key',
+ 'openshift-router.kubeconfig',
+ 'serviceaccounts.private.key',
+ 'serviceaccounts.public.key']
+ if bool(hostvars['openshift']['common']['version_gte_3_1_or_1_1']):
+ certs += ['master.proxy-client.crt',
+ 'master.proxy-client.key']
+ if not bool(hostvars['openshift']['common']['version_gte_3_2_or_1_2']):
+ certs += ['openshift-master.crt',
+ 'openshift-master.key',
+ 'openshift-master.kubeconfig']
+ return certs
+
+
def filters(self):
''' returns a mapping of filters to methods '''
return {"translate_idps": self.translate_idps,
- "validate_pcs_cluster": self.validate_pcs_cluster}
+ "validate_pcs_cluster": self.validate_pcs_cluster,
+ "certificates_to_synchronize": self.certificates_to_synchronize}