aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/common
diff options
context:
space:
mode:
authorjuraj.linkes <juraj.linkes@pantheon.tech>2019-07-10 11:10:34 +0200
committerjuraj.linkes <juraj.linkes@pantheon.tech>2019-07-10 13:50:39 +0200
commite45404bf7b8cbdb10adf85815c2e005134e463ad (patch)
treedd1b3d44cfc31beee9c0f31734595a32bf1ec30f /resources/tools/testbed-setup/ansible/roles/common
parentd5a0c7319ac12bbf56cfae8d9c6778bb2834f7dd (diff)
Modify kernel VM download to custom build
Instead of downloading linux-image-kvm, build custom initrd from currently used kernel on perf sut or vpp device host. Change-Id: I836f9c5264695c44566b7d52f3ec03e26a474524 Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/common')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/common/files/initramfs_modules4
-rw-r--r--resources/tools/testbed-setup/ansible/roles/common/tasks/kernel_install.yaml45
2 files changed, 49 insertions, 0 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/common/files/initramfs_modules b/resources/tools/testbed-setup/ansible/roles/common/files/initramfs_modules
new file mode 100644
index 0000000000..00ae8e03e7
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/common/files/initramfs_modules
@@ -0,0 +1,4 @@
+9p
+9pnet
+9pnet_virtio
+vfio-pci \ No newline at end of file
diff --git a/resources/tools/testbed-setup/ansible/roles/common/tasks/kernel_install.yaml b/resources/tools/testbed-setup/ansible/roles/common/tasks/kernel_install.yaml
new file mode 100644
index 0000000000..c215085d69
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/common/tasks/kernel_install.yaml
@@ -0,0 +1,45 @@
+---
+# file: roles/common/tasks/kernel_install.yaml
+
+- name: Backup remote initramfs modules
+ copy:
+ src: '/etc/initramfs-tools/modules'
+ dest: '/etc/initramfs-tools/modules.bkp'
+ remote_src: yes
+ tags: install-kernel-image
+
+- name: Update initramfs modules
+ copy:
+ src: '../files/initramfs_modules'
+ dest: '/etc/initramfs-tools/modules'
+ tags: install-kernel-image
+
+- name: Create target kernel dir
+ file:
+ path: '/opt/boot'
+ state: 'directory'
+ tags: install-kernel-image
+
+- name: Build initrd image
+ shell: 'update-initramfs -k {{ ansible_kernel }} -c -b /opt/boot'
+ tags: install-kernel-image
+
+- name: Copy corresponding kernel img
+ copy:
+ src: '/boot/vmlinuz-{{ ansible_kernel }}'
+ dest: '/opt/boot/vmlinuz-{{ ansible_kernel }}'
+ remote_src: yes
+ tags: install-kernel-image
+
+- name: Restore remote initramfs modules
+ copy:
+ src: '/etc/initramfs-tools/modules.bkp'
+ dest: '/etc/initramfs-tools/modules'
+ remote_src: yes
+ tags: install-kernel-image
+
+- name: Remove backup initramfs modules
+ file:
+ path: '/etc/initramfs-tools/modules.bkp'
+ state: 'absent'
+ tags: install-kernel-image