summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml
diff options
context:
space:
mode:
authorManuel Buil <mbuil@suse.com>2018-10-30 15:37:39 +0100
committerManuel Buil <mbuil@suse.com>2018-10-31 08:36:32 +0100
commit348bb6a8cea2b12ceca8941fa46e8290b18f0a55 (patch)
treefc29f0bd9569c9d57136243b6da07de4d44b42ac /xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml
parentc4e6a0fe956335ce3f7eaecdea0d2ecd09dc993a (diff)
Bug fix: Fetch vm names from idf
Currently we were taking the names of the nodes to be generated from the NODE_NAMES variable whereas ansible was fetching the names from the dynamic_inventory.py which uses idf. This resulted in problems: when doing ha, ansible was provisioning a compute as a controller and vicebersa. This patch forces create_nodes role to fetch the name from idf and thus align with the naming schema of ansible deploy-scenario:k8-calico-nofeature installer-type:kubespray Change-Id: Id1473727405701fd9ed0cb2f1394ee8676cec337 Signed-off-by: Manuel Buil <mbuil@suse.com>
Diffstat (limited to 'xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml')
-rw-r--r--xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml13
1 files changed, 8 insertions, 5 deletions
diff --git a/xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml b/xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml
index c067781f..8aeea321 100644
--- a/xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml
+++ b/xci/playbooks/roles/create-nodes/tasks/barematalhoststojson.yml
@@ -29,11 +29,14 @@
block:
- set_fact:
+ node_name: "{{ ('kubespray' in installer_type) | ternary(idf.kubespray.hostnames[item.name], idf.osa.hostnames[item.name]) }}"
+
+ - set_fact:
host_group: "{{ node_default_groups }}"
- set_fact:
- host_group: "{{ node_default_groups | union(node_groups[item.name]) }}"
- when: node_groups[item.name] is defined
+ host_group: "{{ node_default_groups | union(node_groups[node_name]) }}"
+ when: node_groups[node_name] is defined
- name: BAREMETAL - Fetch the ip
set_fact:
@@ -46,8 +49,8 @@
- name: BAREMETAL - set the json entry for baremetal nodes
set_fact:
node_data:
- name: "{{ item.name }}"
- uuid: "{{ item.name | to_uuid }}"
+ name: "{{ node_name }}"
+ uuid: "{{ node_name | to_uuid }}"
host_groups: "{{ host_group }}"
driver: "ipmi"
driver_info:
@@ -74,6 +77,6 @@
- name: BAREMETAL - add created node info
set_fact:
- nodes_json_data: "{{ nodes_json_data | combine({item.name: node_data}) }}"
+ nodes_json_data: "{{ nodes_json_data | combine({node_name: node_data}) }}"
when: (num_nodes | int) > (nodes_json_data | length | int) + 1