src: https://gerrit.opnfv.org/gerrit/sfc
version: master
role: scenarios/os-odl-sfc/role/os-odl-sfc
-- scenario: os-nosdn-ovs
+- scenario: os-nosdn-nofeature
scm: git
src: https://git.opnfv.org/releng-xci
version: master
- role: xci/scenarios/os-nosdn-ovs/role/os-nosdn-ovs
+ role: xci/scenarios/os-nosdn-nofeature/role/os-nosdn-nofeature
- scenario: os-odl-nofeature
scm: git
src: https://git.opnfv.org/releng-xci
# name: "foobar"
# when: OPNFV_SCENARIO == "foobar"
-- name: Prepare everything to run the os-nosdn-ovs scenario
+- name: Prepare everything to run the os-nosdn-nofeature scenario
include_role:
- name: "os-nosdn-ovs"
- when: OPNFV_SCENARIO == 'os-nosdn-ovs'
+ name: "os-nosdn-nofeature"
+ when: OPNFV_SCENARIO == 'os-nosdn-nofeature'
- name: Prepare everything to run the os-odl-nofeature scenario
include_role:
name: "os-odl-nofeature"
vars_files:
- ../var/opnfv.yml
tasks:
- - name: Remove target directory
+ - name: Remove existing scenario directories
file:
- path: "{{ item.path | default(scenario_path_default) + '/' + item.scenario }}"
+ path: "{{ item[1] }} + '/' + {{ item[0].scenario }}"
state: absent
- when:
- - item.scm == "git" or item.scm is undefined
+ with_nested:
+ - "{{ scenarios }}"
+ - [ "{{ scenario_path_default }}", "{{ role_path_default }}" ]
+
+ - name: Create scenario directories
+ file:
+ path: "{{ role_path_default }} + '/' + item.scenario }}"
+ state: directory
with_items: "{{ scenarios }}"
- name: Clone git repos (with git)
git:
repo: "{{ item.src }}"
- dest: "{{ item.path | default(scenario_path_default) }}/{{ item.scenario | default(item.src | basename) }}"
+ dest: "{{ scenario_path_default }}/{{ item.scenario | default(item.src | basename) }}"
version: "{{ item.version | default('master') }}"
refspec: "{{ item.refspec | default(omit) }}"
update: true
retries: "{{ git_clone_retries }}"
delay: "{{ git_clone_retry_delay }}"
- - name: Plug in the roles to XCI
- shell: >-
- cp -a {{ item.path | default(scenario_path_default) }}/{{ item.scenario | default(item.src | basename) }}/{{ item.role }}
- {{ role_path_default }}/{{ item.scenario }}
+ - name: Check that scenarios exist
+ stat:
+ path: "{{ scenario_path_default }}/{{ item.scenario }}/{{ item.role }}"
+ register: scenarios_list_exists
with_items: "{{ scenarios }}"
+ - name: Plug in the scenario to XCI
+ shell: >-
+ cp -a {{ scenario_path_default }}/{{ item.item.scenario }}/{{ item.item.role }}
+ {{ role_path_default }}/{{ item.item.scenario }}
+ when: item.stat.exists
+ with_items: "{{ scenarios_list_exists.results }}"
+
+ - name: Plug in the scenario to XCI (fallback)
+ shell: >-
+ cp -a {{ XCI_PATH }}/{{ item.item.role }}
+ {{ role_path_default }}/{{ item.item.scenario }}
+ when: not item.stat.exists
+ with_items: "{{ scenarios_list_exists.results }}"
+
vars:
ansible_python_interpreter: "/usr/bin/python"
scenarios: "{{ lookup('file', scenario_file) | from_yaml }}"
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-- name: copy user_variables_os-nosdn-ovs.yml
+- name: copy user_variables_os-nosdn-nofeature.yml
copy:
- src: "user_variables_os-nosdn-ovs.yml"
- dest: "{{OPENSTACK_OSA_ETC_PATH}}/user_variables_os-nosdn-ovs.yml"
-- name: copy os-nosdn-ovs scenario specific openstack_user_config.yml
+ src: "user_variables_os-nosdn-nofeature.yml"
+ dest: "{{OPENSTACK_OSA_ETC_PATH}}/user_variables_os-nosdn-nofeature.yml"
+- name: copy os-nosdn-nofeature scenario specific openstack_user_config.yml
copy:
src: "{{XCI_FLAVOR}}/openstack_user_config.yml"
- dest: "{{OPENSTACK_OSA_ETC_PATH}}/openstack_user_config.yml"
\ No newline at end of file
+ dest: "{{OPENSTACK_OSA_ETC_PATH}}/openstack_user_config.yml"