diff options
author | Brenton Leanhardt <bleanhar@redhat.com> | 2015-10-26 16:50:32 -0400 |
---|---|---|
committer | Brenton Leanhardt <bleanhar@redhat.com> | 2015-10-26 16:50:32 -0400 |
commit | 4836ed6801b3f841ac3b3bab589c550c35179591 (patch) | |
tree | b0a697175754e678f1a1971d5dd4bbf6efb79b89 /roles/openshift_facts/library | |
parent | 6e1a53d82f925a3a070eae5342604d8b0f026f38 (diff) | |
parent | e87883d2be647edbcd564cefbf09a40120f1832d (diff) | |
download | openshift-4836ed6801b3f841ac3b3bab589c550c35179591.tar.gz openshift-4836ed6801b3f841ac3b3bab589c550c35179591.tar.bz2 openshift-4836ed6801b3f841ac3b3bab589c550c35179591.tar.xz openshift-4836ed6801b3f841ac3b3bab589c550c35179591.zip |
Merge pull request #458 from spinolacastro/project_config
Custom Project Config
Diffstat (limited to 'roles/openshift_facts/library')
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py index 3570de693..4880e0bcb 100755 --- a/roles/openshift_facts/library/openshift_facts.py +++ b/roles/openshift_facts/library/openshift_facts.py @@ -362,6 +362,33 @@ def set_metrics_facts_if_unset(facts): facts['common']['use_cluster_metrics'] = use_cluster_metrics return facts +def set_project_config_facts_if_unset(facts): + """ Set Project Configuration facts if not already present in facts dict + dict: + Args: + facts (dict): existing facts + Returns: + dict: the facts dict updated with the generated Project Configuration + facts if they were not already present + + """ + + config={ + 'default_node_selector': '', + 'project_request_message': '', + 'project_request_template': '', + 'mcs_allocator_range': 's0:/2', + 'mcs_labels_per_project': 5, + 'uid_allocator_range': '1000000000-1999999999/10000' + } + + if 'master' in facts: + for key,value in config.items(): + if key not in facts['master']: + facts['master'][key] = value + + return facts + def set_identity_providers_if_unset(facts): """ Set identity_providers fact if not already present in facts dict @@ -807,6 +834,7 @@ class OpenShiftFacts(object): facts = merge_facts(facts, local_facts) facts['current_config'] = get_current_config(facts) facts = set_url_facts_if_unset(facts) + facts = set_project_config_facts_if_unset(facts) facts = set_fluentd_facts_if_unset(facts) facts = set_node_schedulability(facts) facts = set_master_selectors(facts) |