From b12d656ce20490d1a7079d6c1ff3c34844edd568 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Fri, 19 Jan 2018 09:38:13 +0000 Subject: xci: get-opnfv-scenario-requirements.yml: Check if facts are set When the user selects an invalid combination then some facts may not be set so the deployment may fail in a crypt way like in the following case fatal: [localhost]: FAILED! => {"failed": true, "msg": "The conditional check 'deploy_scenario_installer' failed. The error was: error while evaluating conditional (deploy_scenario_installer): 'deploy_scenario_installer' is undefined\n\nThe error appears to have been in '/home/opnfv/releng-xci/xci/playbooks/get-opnfv-scenario-requirements.yml': line 114, column 11, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n when: item.installer == XCI_INSTALLER\n - set_fact:\n ^ here\n"} Change-Id: I931376d99bb178b15c4a9a71d47b48b01b858e4e Signed-off-by: Markos Chandras --- xci/playbooks/get-opnfv-scenario-requirements.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'xci/playbooks') diff --git a/xci/playbooks/get-opnfv-scenario-requirements.yml b/xci/playbooks/get-opnfv-scenario-requirements.yml index 7eaa43de..c04348e3 100644 --- a/xci/playbooks/get-opnfv-scenario-requirements.yml +++ b/xci/playbooks/get-opnfv-scenario-requirements.yml @@ -114,11 +114,12 @@ - set_fact: deploy_scenario_flavor: "{{ (XCI_FLAVOR in deploy_scenario_installer.flavors) | bool }}" when: + - deploy_scenario_installer is defined - deploy_scenario_installer - set_fact: deploy_scenario_distro: "{{ (XCI_DISTRO in deploy_scenario_installer.distros) | bool }}" when: - - deploy_scenario_installer + - deploy_scenario_flavor is defined - deploy_scenario_flavor when: deploy_scenario is defined @@ -135,7 +136,9 @@ - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - '' when: - - deploy_scenario is not defined or not deploy_scenario_distro + - deploy_scenario is not defined or + deploy_scenario_distro is not defined or + (deploy_scenario_distro is defined and not deploy_scenario_distro) vars: ansible_python_interpreter: "/usr/bin/python" -- cgit 1.2.3-korg