diff options
author | Markos Chandras <mchandras@suse.de> | 2017-12-12 16:26:25 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-12-12 16:26:25 +0000 |
commit | 7d4a6198c273aa42f94f6510ca7728f8ff047f1d (patch) | |
tree | 55b1a4c76f07900ff081939c1ff52a44eb890fad /xci/playbooks | |
parent | e1125e83e84604b09a2328c6f0778e1e600a4609 (diff) | |
parent | ab3c9ad0f9a40a57044c75c014404953b3941eb3 (diff) |
Merge "Move contents of os-nosdn-ovs into os-nosdn-nofeature"
Diffstat (limited to 'xci/playbooks')
-rw-r--r-- | xci/playbooks/bootstrap-scenarios.yml | 6 | ||||
-rw-r--r-- | xci/playbooks/get-opnfv-scenario-requirements.yml | 38 |
2 files changed, 32 insertions, 12 deletions
diff --git a/xci/playbooks/bootstrap-scenarios.yml b/xci/playbooks/bootstrap-scenarios.yml index c7646e0d..50f7b246 100644 --- a/xci/playbooks/bootstrap-scenarios.yml +++ b/xci/playbooks/bootstrap-scenarios.yml @@ -9,10 +9,10 @@ # 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" diff --git a/xci/playbooks/get-opnfv-scenario-requirements.yml b/xci/playbooks/get-opnfv-scenario-requirements.yml index c59c18f1..fbe60f67 100644 --- a/xci/playbooks/get-opnfv-scenario-requirements.yml +++ b/xci/playbooks/get-opnfv-scenario-requirements.yml @@ -21,18 +21,24 @@ 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 @@ -45,12 +51,26 @@ 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 }}" |