summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjawed <jawed.khelil@amadeus.com>2016-07-20 11:53:57 +0200
committerjawed <jawed.khelil@amadeus.com>2016-08-09 12:03:23 +0200
commit75df5713bc1b1d3cf454a6975e2ed8eea528a8a3 (patch)
tree4df2f03759dcfccc4db40161aa2340f7e4e77914
parent9e0e8485638e36f1bacbd8e1c5df134a5a7595f0 (diff)
downloadopenshift-75df5713bc1b1d3cf454a6975e2ed8eea528a8a3.tar.gz
openshift-75df5713bc1b1d3cf454a6975e2ed8eea528a8a3.tar.bz2
openshift-75df5713bc1b1d3cf454a6975e2ed8eea528a8a3.tar.xz
openshift-75df5713bc1b1d3cf454a6975e2ed8eea528a8a3.zip
fixing openshift key error in case of node failure during run (ssh issue)
-rw-r--r--filter_plugins/oo_filters.py3
-rw-r--r--playbooks/common/openshift-node/config.yml2
-rw-r--r--roles/openshift_manage_node/tasks/main.yml3
3 files changed, 5 insertions, 3 deletions
diff --git a/filter_plugins/oo_filters.py b/filter_plugins/oo_filters.py
index 557a684dc..b57bc0afa 100644
--- a/filter_plugins/oo_filters.py
+++ b/filter_plugins/oo_filters.py
@@ -39,7 +39,6 @@ class FilterModule(object):
the value.
If the key isn't present, None is returned.
-
Ex: data = {'a': {'b': {'c': 5}}}
attribute = "a.b.c"
returns 5
@@ -57,6 +56,7 @@ class FilterModule(object):
return ptr
+
@staticmethod
def oo_flatten(data):
""" This filter plugin will flatten a list of lists
@@ -146,6 +146,7 @@ class FilterModule(object):
retval = [FilterModule.get_attr(d, attribute) for d in data]
retval = [val for val in retval if val != None]
+
return retval
@staticmethod
diff --git a/playbooks/common/openshift-node/config.yml b/playbooks/common/openshift-node/config.yml
index c56353430..e7c7ffb38 100644
--- a/playbooks/common/openshift-node/config.yml
+++ b/playbooks/common/openshift-node/config.yml
@@ -43,7 +43,7 @@
ansible_ssh_user: "{{ g_ssh_user | default(omit) }}"
ansible_become: "{{ g_sudo | default(omit) }}"
with_items: "{{ groups.oo_nodes_to_config | default([]) }}"
- when: hostvars[item].openshift.common.is_containerized | bool and (item in groups.oo_nodes_to_config and item in groups.oo_masters_to_config)
+ when: hostvars[item].openshift.common is defined and hostvars[item].openshift.common.is_containerized | bool and (item in groups.oo_nodes_to_config and item in groups.oo_masters_to_config)
- name: Configure node instances
hosts: oo_containerized_master_nodes
diff --git a/roles/openshift_manage_node/tasks/main.yml b/roles/openshift_manage_node/tasks/main.yml
index 291cdbbb5..5abac32cd 100644
--- a/roles/openshift_manage_node/tasks/main.yml
+++ b/roles/openshift_manage_node/tasks/main.yml
@@ -13,10 +13,11 @@
{{ openshift.common.admin_binary }} manage-node {{ item.openshift.common.hostname | lower }} --schedulable={{ 'true' if item.openshift.node.schedulable | bool else 'false' }}
with_items:
- "{{ openshift_node_vars }}"
+ when: item.openshift.common.hostname is defined
- name: Label nodes
command: >
{{ openshift.common.client_binary }} label --overwrite node {{ item.openshift.common.hostname | lower }} {{ item.openshift.node.labels | oo_combine_dict }}
with_items:
- "{{ openshift_node_vars }}"
- when: "'labels' in item.openshift.node and item.openshift.node.labels != {}"
+ when: item.openshift.common.hostname is defined and 'labels' in item.openshift.node and item.openshift.node.labels != {}