aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/roles
diff options
context:
space:
mode:
authorVolodymyr Mytnyk <volodymyrx.mytnyk@intel.com>2019-03-25 15:22:54 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-03-25 15:22:54 +0000
commit1c26b4a706acfde4c2f724f5e9a1ea639d1c3e66 (patch)
tree5c0e5ed5cbcc0a6174adce651ba613c6b7f9af30 /ansible/roles
parent76d7680da6e6effc1a95de3b317cc85495b07aea (diff)
parent91d4cfa839bb2633cba2f70443168c22f895a969 (diff)
Merge "Move VM image build to remote DUT"
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/build_yardstick_image/tasks/post_build.yml21
-rw-r--r--ansible/roles/build_yardstick_image/tasks/pre_build.yml12
-rw-r--r--ansible/roles/install_image_dependencies/defaults/main.yml2
3 files changed, 35 insertions, 0 deletions
diff --git a/ansible/roles/build_yardstick_image/tasks/post_build.yml b/ansible/roles/build_yardstick_image/tasks/post_build.yml
index c6888f8df..abbf57c03 100644
--- a/ansible/roles/build_yardstick_image/tasks/post_build.yml
+++ b/ansible/roles/build_yardstick_image/tasks/post_build.yml
@@ -35,6 +35,10 @@
state: unmounted
- mount:
+ name: "{{ mountdir }}/run"
+ state: unmounted
+
+- mount:
name: "{{ mountdir }}"
state: unmounted
@@ -44,3 +48,20 @@
- debug:
msg: "yardstick image = {{ imgfile }}"
+
+- set_fact:
+ imgdest: "/var/lib/libvirt/images/{{ imgfile | basename}}"
+ name: "{{ (imgfile | basename | splitext)[0] }}"
+ ext: "{{ (imgfile | basename | splitext)[1] }}"
+
+- name: Verify if imgfile exists in libvirt images
+ stat:
+ path: "{{ imgdest }}"
+ register: imgdest_stat
+
+- set_fact:
+ imgdest: "/var/lib/libvirt/images/{{ name }}_autogen{{ ext }}"
+ when: imgdest_stat.stat.exists
+
+- name: Copy image to libvirt images
+ shell: "cp {{ imgfile }} {{ imgdest }}"
diff --git a/ansible/roles/build_yardstick_image/tasks/pre_build.yml b/ansible/roles/build_yardstick_image/tasks/pre_build.yml
index 2dae38060..3ac8e90e9 100644
--- a/ansible/roles/build_yardstick_image/tasks/pre_build.yml
+++ b/ansible/roles/build_yardstick_image/tasks/pre_build.yml
@@ -45,6 +45,7 @@
with_items:
# order matters
- "{{ mountdir }}/proc"
+ - "{{ mountdir }}/run"
- "{{ mountdir }}"
- "/mnt/{{ release }}"
@@ -178,6 +179,17 @@
fstab: "{{ fake_fstab }}"
state: mounted
+- name: mount chroot /run
+ mount:
+ src: /run
+ name: "{{ mountdir }}/run"
+ fstype: tmpfs
+ opts: bind
+ # !!!!!!! this is required otherwise we add entries to /etc/fstab
+ # and prevent the system from booting
+ fstab: "{{ fake_fstab }}"
+ state: mounted
+
- name: if arm copy qemu-aarch64-static into chroot
copy:
src: /usr/bin/qemu-aarch64-static
diff --git a/ansible/roles/install_image_dependencies/defaults/main.yml b/ansible/roles/install_image_dependencies/defaults/main.yml
index 42951bf6d..558e68a9b 100644
--- a/ansible/roles/install_image_dependencies/defaults/main.yml
+++ b/ansible/roles/install_image_dependencies/defaults/main.yml
@@ -30,6 +30,7 @@ install_dependencies:
- libxss-dev
- expect
- libnuma-dev
+ - curl
RedHat:
- bc
- fio
@@ -50,3 +51,4 @@ install_dependencies:
- sysstat
- unzip
- python-devel
+ - curl