summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRex Lee <limingjiang@huawei.com>2018-01-08 08:11:32 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-01-08 08:11:32 +0000
commit0182d472d35a78c460610f5e35018416f857059b (patch)
treea5f8805ca847b7ae39142df741a2e7349ff514ab
parent5852f3bc0cc792ace83ea1eb69141586670051ea (diff)
parentff4ceec2efd42fb1573e4faf4fe1840121e99715 (diff)
Merge "ansible image build improvement"
-rw-r--r--ansible/build_yardstick_image.yml16
-rw-r--r--ansible/group_vars/all.yml7
-rwxr-xr-xtests/ci/load_images.sh5
3 files changed, 19 insertions, 9 deletions
diff --git a/ansible/build_yardstick_image.yml b/ansible/build_yardstick_image.yml
index 45ef94e98..7f709873e 100644
--- a/ansible/build_yardstick_image.yml
+++ b/ansible/build_yardstick_image.yml
@@ -41,7 +41,12 @@
- package: name=parted state=present
- set_fact:
- imgfile: "{{ workspace }}/yardstick-image.img"
+ imgfile: "{{ normal_image_file }}"
+ when: img_property == "normal"
+
+ - set_fact:
+ imgfile: "{{ nsb_image_file }}"
+ when: img_property == "nsb"
- set_fact:
mountdir: "{{ lookup('env', 'mountdir')|default('/mnt/yardstick', true) }}"
@@ -197,8 +202,13 @@
nameserver_ip: "{{ ansible_dns.nameservers[0] }}"
image_type: vm
-- name: include {{ img_modify_playbook }}
- include: "{{ img_modify_playbook }}"
+- name: include ubuntu_server_cloudimg_modify.yml
+ include: ubuntu_server_cloudimg_modify.yml
+ when: img_property == "normal"
+
+- name: include ubuntu_server_cloudimg_modify_samplevnfs.yml
+ include: ubuntu_server_cloudimg_modify_samplevnfs.yml
+ when: img_property == "nsb"
- hosts: localhost
tasks:
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index edd6564d0..359968277 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -1,6 +1,9 @@
---
+target_os: "Ubuntu"
+YARD_IMG_ARCH: "amd64"
clone_dest: /opt/tempT
release: xenial
-target_os: Ubuntu
+normal_image_file: "{{ workspace }}/yardstick-image.img"
+nsb_image_file: "{{ workspace }}/yardstick-nsb-image.img"
ubuntu_image_file: /tmp/workspace/yardstick/yardstick-trusty-server.raw
-proxy_env: {} \ No newline at end of file
+proxy_env: {}
diff --git a/tests/ci/load_images.sh b/tests/ci/load_images.sh
index 666a78b40..80caf07ae 100755
--- a/tests/ci/load_images.sh
+++ b/tests/ci/load_images.sh
@@ -66,10 +66,7 @@ build_yardstick_image()
ANSIBLE_SCRIPTS="${0%/*}/../../ansible"
cd ${ANSIBLE_SCRIPTS} &&\
ansible-playbook \
- -e img_modify_playbook='ubuntu_server_cloudimg_modify.yml' \
- -e target_os='Ubuntu' \
- -e YARD_IMG_ARCH='amd64' \
- -e ubuntu_img_file="${QCOW_IMAGE}" \
+ -e img_property="normal" \
-vvv -i inventory.ini build_yardstick_image.yml
if [ ! -f "${QCOW_IMAGE}" ]; then