ansible image build improvement 09/48309/4
authorAce Lee <liyin11@huawei.com>
Mon, 4 Dec 2017 09:07:14 +0000 (09:07 +0000)
committerAce Lee <liyin11@huawei.com>
Thu, 28 Dec 2017 02:42:12 +0000 (02:42 +0000)
JIRA: YARDSTICK-879

Add some image build vars
Add automatic image build of nsb
yardstick_image: ansible-playbook -e img_property="normal" -vvv -i inventory.ini build_yardstick_image.yml

nsb_image_build: ansible-playbook -e img_property="nsb" -vvv -i inventory.ini build_yardstick_image.yml

prepare for yardstick image uploading

Change-Id: I9fdf30084511ca9a008df3b53887b06273bbd549
Signed-off-by: Ace Lee <liyin11@huawei.com>
ansible/build_yardstick_image.yml
ansible/group_vars/all.yml
tests/ci/load_images.sh

index 45ef94e..7f70987 100644 (file)
     - 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) }}"
         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:
index edd6564..3599682 100644 (file)
@@ -1,6 +1,9 @@
 ---\r
+target_os: "Ubuntu"\r
+YARD_IMG_ARCH: "amd64"\r
 clone_dest: /opt/tempT\r
 release: xenial\r
-target_os: Ubuntu\r
+normal_image_file: "{{ workspace }}/yardstick-image.img"\r
+nsb_image_file: "{{ workspace }}/yardstick-nsb-image.img"\r
 ubuntu_image_file: /tmp/workspace/yardstick/yardstick-trusty-server.raw\r
-proxy_env: {}
\ No newline at end of file
+proxy_env: {}\r
index 666a78b..80caf07 100755 (executable)
@@ -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