diff options
author | 2018-08-09 15:53:40 +0200 | |
---|---|---|
committer | 2018-09-28 17:47:00 +0200 | |
commit | 3fe75598de97c73c95d83739e6ed11277b619988 (patch) | |
tree | 5012ff76ed7ed9d00f02181d0de369cf5aa29b05 /xci/playbooks/roles/create-vm-nodes/tasks | |
parent | 013bfffe38ab9a6c86a4a6e3bc2d08a5b5aedcbd (diff) |
[baremetal] idf for opnfv_vm and update the pdf
Physical hardware PODs provide a pdf and a idf to describe hardware and other
information (e.g. what is the purpose for each interface). To reuse the
same code for opnfv vm and also become consistent, we should also describe
the opnfv vm with an idf and a pdf. This patch simplifies what needs to
be done for baremetal, especially for this (future) patch:
https://gerrit.opnfv.org/gerrit/#/c/60797/11
As we add an idf, we should update dynamic_inventory and how we create
the opnfv vm. Obviously, he opnfv_vm.yml gets removed.
Change-Id: I930728474631fc214e4a9adc8581e0c16d230176
Signed-off-by: Manuel Buil <mbuil@suse.com>
Diffstat (limited to 'xci/playbooks/roles/create-vm-nodes/tasks')
-rw-r--r-- | xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml | 6 | ||||
-rw-r--r-- | xci/playbooks/roles/create-vm-nodes/tasks/main.yml | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml b/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml index 700c6c72..df019c88 100644 --- a/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml +++ b/xci/playbooks/roles/create-vm-nodes/tasks/create_vm.yml @@ -128,9 +128,13 @@ command: get_xml register: vm_xml + - name: Fetch the index for admin network + set_fact: + admin_index: "{{ (vm_name == 'opnfv') | ternary(opnfv_vm_idf.net_config.admin.interface, idf.net_config.admin.interface) | int }}" + - name: Fetch the ip set_fact: - vm_ip: "{%- for interface in item.1.interfaces %}{%- if 'native' in (interface.vlan | string) %}{{ interface.address }}{%- endif %}{%- endfor %}" + vm_ip: "{{ item.1.interfaces[admin_index | int].address }}" # Assumes there is only a single NIC per VM - name: get MAC from vm XML diff --git a/xci/playbooks/roles/create-vm-nodes/tasks/main.yml b/xci/playbooks/roles/create-vm-nodes/tasks/main.yml index c1cee6dc..64857d80 100644 --- a/xci/playbooks/roles/create-vm-nodes/tasks/main.yml +++ b/xci/playbooks/roles/create-vm-nodes/tasks/main.yml @@ -18,7 +18,7 @@ # First we create the opnfv_vm - include_tasks: create_vm.yml - with_indexed_items: "{{ [opnfv_vm] + nodes }}" + with_indexed_items: "{{ [opnfv_vm_pdf] + nodes }}" - name: Start the opnfv vm virt: |