From 76da09f4dea888b247dde3852bd895bbf0e4aa20 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Fri, 22 Dec 2017 10:36:27 +0000 Subject: xci: Record distribution and NFVI information for scenarios A scenario may only support certain NFVIs or distributions so we need a mapping with all these things so we know what can be tested and where. Change-Id: Ibf1b640b762085f58627e05e1d2ca13edfc4d716 Signed-off-by: Markos Chandras --- xci/opnfv-scenario-requirements.yml | 41 ++++++++++++++++------- xci/playbooks/get-opnfv-scenario-requirements.yml | 34 +++++++++++++++---- 2 files changed, 57 insertions(+), 18 deletions(-) diff --git a/xci/opnfv-scenario-requirements.yml b/xci/opnfv-scenario-requirements.yml index 036a8a7c..a250974f 100644 --- a/xci/opnfv-scenario-requirements.yml +++ b/xci/opnfv-scenario-requirements.yml @@ -16,25 +16,42 @@ src: https://gerrit.opnfv.org/gerrit/sfc version: master role: scenarios/os-odl-sfc/role/os-odl-sfc - flavors: - - ha - - mini - - noha + nfvis: + - nfvi: osa + flavors: + - ha + - mini + - noha + distros: + - opensuse + - ubuntu + - scenario: os-nosdn-nofeature scm: git src: https://git.opnfv.org/releng-xci version: master role: xci/scenarios/os-nosdn-nofeature/role/os-nosdn-nofeature - flavors: - - ha - - mini - - noha + nfvis: + - nfvi: osa + flavors: + - ha + - mini + - noha + distros: + - opensuse + - ubuntu + - scenario: os-odl-nofeature scm: git src: https://git.opnfv.org/releng-xci version: master role: xci/scenarios/os-odl-nofeature/role/os-odl-nofeature - flavors: - - ha - - mini - - noha + nfvis: + - nfvi: osa + flavors: + - ha + - mini + - noha + distros: + - opensuse + - ubuntu diff --git a/xci/playbooks/get-opnfv-scenario-requirements.yml b/xci/playbooks/get-opnfv-scenario-requirements.yml index b44c50b4..f515c253 100644 --- a/xci/playbooks/get-opnfv-scenario-requirements.yml +++ b/xci/playbooks/get-opnfv-scenario-requirements.yml @@ -95,25 +95,47 @@ loop_control: label: "{{ item.item.scenario }}" - - name: Determine if selected {{ DEPLOY_SCENARIO }} scenario can be deployed + - name: Gather information about the selected {{ DEPLOY_SCENARIO }} scenario set_fact: - deploy_scenario_on_flavor: "{{ (XCI_FLAVOR in item.flavors) | ternary(True, False) }}" - when: DEPLOY_SCENARIO == item.scenario + deploy_scenario: "{{ item }}" with_items: "{{ scenarios }}" loop_control: label: "{{ item.scenario }}" + when: DEPLOY_SCENARIO | lower == item.scenario - - name: Fail if {{ XCI_FLAVOR }} is not supported in {{ DEPLOY_SCENARIO }} + - name: Determine if the selected {{ DEPLOY_SCENARIO }} scenario can be deployed + block: + - set_fact: + deploy_scenario_nfvi: "{{ item }}" + with_items: "{{ deploy_scenario.nfvis }}" + loop_control: + label: "{{ item.nfvi }}" + when: item.nfvi == XCI_NFVI + - set_fact: + deploy_scenario_flavor: "{{ (XCI_FLAVOR in deploy_scenario_nfvi.flavors) | bool }}" + when: + - deploy_scenario_nfvi + - set_fact: + deploy_scenario_distro: "{{ (XCI_DISTRO in deploy_scenario_nfvi.distros) | bool }}" + when: + - deploy_scenario_nfvi + - deploy_scenario_flavor + when: deploy_scenario is defined + + - name: Fail if {{ DEPLOY_SCENARIO }} is not supported fail: msg: - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - - ERROR! The {{ DEPLOY_SCENARIO }} scenario does not support the {{ XCI_FLAVOR }} + - ERROR! The {{ DEPLOY_SCENARIO }} scenario can't be deployed. This is because + - the {{ XCI_NFVI }} NFVI or the {{ XCI_FLAVOR }} flavor or the {{ XCI_DISTRO }} + - distribution is not supported by this scenario. It may also be possible that + - this scenario doesn't exist at all or it's not listed in {{ scenario_file }}. - '' - This is a great chance for you to contribute to XCI ;-) - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - '' when: - - not deploy_scenario_on_flavor + - deploy_scenario is not defined or not deploy_scenario_distro vars: ansible_python_interpreter: "/usr/bin/python" -- cgit 1.2.3-korg