diff options
author | Zohar Galor <zgalor@redhat.com> | 2017-06-20 17:28:07 +0300 |
---|---|---|
committer | Zohar Galor <zgalor@redhat.com> | 2017-09-06 12:08:41 +0300 |
commit | ec75d0ac888f3fab87f8d335224596df045e260a (patch) | |
tree | cc685087a63d6388cb447e532d92564e9c2cc393 /filter_plugins | |
parent | b5cf769b97691d75e07d1e0e3b29ecbc31ba32ea (diff) | |
download | openshift-ec75d0ac888f3fab87f8d335224596df045e260a.tar.gz openshift-ec75d0ac888f3fab87f8d335224596df045e260a.tar.bz2 openshift-ec75d0ac888f3fab87f8d335224596df045e260a.tar.xz openshift-ec75d0ac888f3fab87f8d335224596df045e260a.zip |
Create ansible role for deploying prometheus on openshift
A new role for installing prometheus on openshift.
Depends on `openshift_hosted_prometheus_deploy` flag
role creates:
- prometheus namespace
- prometheus clusterrolebinding and service account
- pvs for prometheus, alertmanager and alertbuffer for internal nfs
- prometheus pod with prometheus behind oauth-proxy, alertmanager and alert-buffer behind oauth-proxy
- prometheus and alertmanager configmaps
- prometheus and alerts services and direct routes
- prometheus, alertmanager and alert-buffer pvcs
Diffstat (limited to 'filter_plugins')
-rw-r--r-- | filter_plugins/oo_filters.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py index 36a90a870..277695f78 100644 --- a/filter_plugins/oo_filters.py +++ b/filter_plugins/oo_filters.py @@ -1024,6 +1024,18 @@ def oo_contains_rule(source, apiGroups, resources, verbs): return False +def oo_selector_to_string_list(user_dict): + """Convert a dict of selectors to a key=value list of strings + +Given input of {'region': 'infra', 'zone': 'primary'} returns a list +of items as ['region=infra', 'zone=primary'] + """ + selectors = [] + for key in user_dict: + selectors.append("{}={}".format(key, user_dict[key])) + return selectors + + class FilterModule(object): """ Custom ansible filter mapping """ @@ -1065,5 +1077,6 @@ class FilterModule(object): "oo_openshift_loadbalancer_backends": oo_openshift_loadbalancer_backends, "to_padded_yaml": to_padded_yaml, "oo_random_word": oo_random_word, - "oo_contains_rule": oo_contains_rule + "oo_contains_rule": oo_contains_rule, + "oo_selector_to_string_list": oo_selector_to_string_list } |