From c380a85cb660d07da714ad3adf43439ad7938270 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Thu, 9 Aug 2018 16:52:46 +0200 Subject: [Baremetal] Add baremetal support to create-nodes Information about baremetal servers is collected for ironic to do the provisioning. Two main things are done: 1 - baremetalhoststojson.yml fills the json config file fed to ironic so that it knows how to boot the blades. In the baremetal case, the create_vm.yml playbook will only create opnfv vm. The variable vms_to_create holds that information. The variable baremetal_nodes specifies the physical nodes (empty when non baremetal deployments) 2 - For PXE to work, we create a file called baremetalstaticips that has the mapping between mac address from servers and its ip. That file is moved into the dnsmasq config directory Change-Id: I0e788db1deb50769c183b71524a68ac0b925f8aa Signed-off-by: Manuel Buil --- xci/playbooks/roles/create-nodes/defaults/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'xci/playbooks/roles/create-nodes/defaults/main.yml') diff --git a/xci/playbooks/roles/create-nodes/defaults/main.yml b/xci/playbooks/roles/create-nodes/defaults/main.yml index b03f1386..02a429cf 100644 --- a/xci/playbooks/roles/create-nodes/defaults/main.yml +++ b/xci/playbooks/roles/create-nodes/defaults/main.yml @@ -4,10 +4,10 @@ baremetal_json_file: '/tmp/baremetal.json' # We collect these parameters from the pdf vm_nic: "virtio" -vm_groups: {} -vm_default_groups: "{{ lookup('env', 'DEFAULT_HOST_GROUPS').split() | default(['baremetal'], true) }}" vm_disk_cache: unsafe node_names: "{{ lookup('env', 'NODE_NAMES').split() }}" +node_groups: {} +node_default_groups: "{{ lookup('env', 'DEFAULT_HOST_GROUPS').split() | default(['baremetal'], true) }}" network_bridge_admin: 'br-admin' network_bridge_mgmt: 'br-mgmt' @@ -27,4 +27,6 @@ vm_libvirt_uri: "{{ lookup('env', 'LIBVIRT_CONNECT_URI') | default('qemu:///syst opnfv_image_path: "/var/lib/libvirt/images" +vms_to_create: "{{ (baremetal | bool) | ternary([opnfv_vm_pdf], [opnfv_vm_pdf] + nodes) }}" +baremetal_nodes: "{{ (baremetal | bool) | ternary(nodes, omit) }}" libvirt_networks: "{{ (baremetal | bool) | ternary([vm_network_admin,vm_network_mgmt],[vm_network_admin]) }}" -- cgit 1.2.3-korg