Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions playbooks/common/openshift-cluster/upgrades/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- import_playbook: ../../../init/basic_facts.yml
- import_playbook: ../../../init/base_packages.yml
- import_playbook: ../../../init/cluster_facts.yml
vars:
l_check_nodename: True

- name: Ensure essential node configmaps are present
hosts: oo_first_master
Expand Down
25 changes: 25 additions & 0 deletions playbooks/init/cluster_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,31 @@
sdn_mtu: "{{ openshift_node_sdn_mtu | default(None) }}"
bootstrapped: "{{ openshift_is_bootstrapped }}"

- when:
# l_check_nodename is passed in during upgrades.
- l_check_nodename | default(False)
- inventory_hostname in groups['oo_nodes_to_config']
block:
- name: Read node config
slurp:
src: "{{ openshift.common.config_base }}/node/node-config.yaml"
register: node_config_slurp

# if using openshift_kubelet_name_override, l_kubelet_node_name will be
# set to that value.
- name: Fail when nodeName is wrong
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fails during upgrade:

The conditional check 'l_nodeconfig_nodename != l_kubelet_node_name' failed. The error was: error while evaluating conditional (l_nodeconfig_nodename != l_kubelet_node_name): 'l_kubelet_node_name' is undefined

fail:
msg: >
nodeName mismatch from node's config; existing name in config: {{ l_nodeconfig_name }};
discovered nodename from openshift_facts: {{ l_kubelet_node_name }}
vars:
l_nodeconfig_yaml: "{{ node_config_slurp.content | b64decode| from_yaml }}"
# existing 3.10+ configs might not have nodeName defined.
l_nodeconfig_nodename: "{{ l_nodeconfig_yaml['nodeName'] | default('') }}"
when:
- l_nodeconfig_nodename != ''
- l_nodeconfig_nodename != l_kubelet_node_name

- name: Initialize etcd host variables
hosts: oo_masters_to_config
roles:
Expand Down