From 2a0afda0940b63d71f05c0d11834e3b4582f4e90 Mon Sep 17 00:00:00 2001 From: Tlacenka Date: Wed, 23 Aug 2017 16:39:17 +0200 Subject: Fix node label customisation (#679) * node labels: add checks for custom labels - README: add more info about customising labels - pre_tasks: add checks for label values, set to empty dict if undefined - group_vars: move labels customisation from OSEv3 to all * pre_tasks: tried a new approach to updating variables * pre_tasks: variable update fixed * pre_tasks: rollback upscaling changes (to be added in upscaling PR) * pre_tasks: blank line removed * pre_tasks: add check for undefined variable (should not happen though) * pre_tasks: be sure to have regions defined --- playbooks/provisioning/openstack/pre_tasks.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'playbooks/provisioning/openstack/pre_tasks.yml') diff --git a/playbooks/provisioning/openstack/pre_tasks.yml b/playbooks/provisioning/openstack/pre_tasks.yml index d73945644..be29dad16 100644 --- a/playbooks/provisioning/openstack/pre_tasks.yml +++ b/playbooks/provisioning/openstack/pre_tasks.yml @@ -31,3 +31,19 @@ delegate_to: localhost when: - openshift_master_default_subdomain is undefined + +# Check that openshift_cluster_node_labels has regions defined for all groups +# NOTE(kpilatov): if node labels are to be enabled for more groups, +# this check needs to be modified as well +- name: Set openshift_cluster_node_labels if undefined (should not happen) + set_fact: + openshift_cluster_node_labels: {'app': {'region': 'primary'}, 'infra': {'region': 'infra'}} + when: openshift_cluster_node_labels is not defined + +- name: Set openshift_cluster_node_labels for the infra group + set_fact: + openshift_cluster_node_labels: "{{ openshift_cluster_node_labels | combine({'infra': {'region': 'infra'}}, recursive=True) }}" + +- name: Set openshift_cluster_node_labels for the app group + set_fact: + openshift_cluster_node_labels: "{{ openshift_cluster_node_labels | combine({'app': {'region': 'primary'}}, recursive=True) }}" -- cgit v1.2.3