aboutsummaryrefslogtreecommitdiffstats
path: root/ansible/roles/install_dpdk
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-08-25 20:00:13 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-25 20:00:13 +0000
commitafd31c1c34ef66f23e17bbdb2316e7f4bc1bf7ec (patch)
treed7d1da145d0c0b39fec04b1a06a173a8573c3920 /ansible/roles/install_dpdk
parent15f6586bf0d2ed6b3f03dc3574a4dff5d9a3c64e (diff)
parent1d91850970f89ff6b383c26a1cf9fbc5e9ac78eb (diff)
Merge "ansible: update dpdk, trex and samplevnf install"
Diffstat (limited to 'ansible/roles/install_dpdk')
-rw-r--r--ansible/roles/install_dpdk/defaults/main.yml2
-rwxr-xr-xansible/roles/install_dpdk/tasks/Debian.yml3
-rw-r--r--ansible/roles/install_dpdk/tasks/RedHat.yml2
-rw-r--r--ansible/roles/install_dpdk/tasks/main.yml21
-rw-r--r--ansible/roles/install_dpdk/vars/main.yml2
5 files changed, 28 insertions, 2 deletions
diff --git a/ansible/roles/install_dpdk/defaults/main.yml b/ansible/roles/install_dpdk/defaults/main.yml
new file mode 100644
index 000000000..fe2172401
--- /dev/null
+++ b/ansible/roles/install_dpdk/defaults/main.yml
@@ -0,0 +1,2 @@
+---
+INSTALL_BIN_PATH: "/opt/nsb_bin" \ No newline at end of file
diff --git a/ansible/roles/install_dpdk/tasks/Debian.yml b/ansible/roles/install_dpdk/tasks/Debian.yml
index 486d40e11..c77e4f96a 100755
--- a/ansible/roles/install_dpdk/tasks/Debian.yml
+++ b/ansible/roles/install_dpdk/tasks/Debian.yml
@@ -17,3 +17,6 @@
with_items:
- libpcap-dev
+- name: Install kernel headers
+ action: "{{ ansible_pkg_mgr }} name=linux-headers-{{ dpdk_kernel }} state=present"
+
diff --git a/ansible/roles/install_dpdk/tasks/RedHat.yml b/ansible/roles/install_dpdk/tasks/RedHat.yml
index af35c9b3e..2fb249eae 100644
--- a/ansible/roles/install_dpdk/tasks/RedHat.yml
+++ b/ansible/roles/install_dpdk/tasks/RedHat.yml
@@ -17,3 +17,5 @@
with_items:
- libpcap-devel
+- name: Install kernel headers
+ action: "{{ ansible_pkg_mgr }} name=kernel-headers-{{ dpdk_kernel }} state=present"
diff --git a/ansible/roles/install_dpdk/tasks/main.yml b/ansible/roles/install_dpdk/tasks/main.yml
index fca0e33af..cab093ad5 100644
--- a/ansible/roles/install_dpdk/tasks/main.yml
+++ b/ansible/roles/install_dpdk/tasks/main.yml
@@ -20,8 +20,22 @@
# with_fileglob:
# - "{{ local_nsb_path }}/patches/dpdk_custom_patch/0*.patch"
+- name: find kernel for image, (including chroot)
+ find_kernel:
+ kernel: "{{ ansible_kernel }}"
+ register: found_kernel
+
+# Do this before installing kernel headers
+- name: Set dpdk_kernel to be the kernel we found
+ set_fact:
+ dpdk_kernel: "{{ found_kernel.kernel }}"
+
- include: "{{ ansible_os_family }}.yml"
+- name: set RTE_KERNELDIR to point to found kernel
+ set_fact:
+ RTE_KERNELDIR: "/lib/modules/{{ dpdk_kernel }}/build"
+
- my_make:
chdir: "{{ dpdk_path }}"
target: config
@@ -29,6 +43,8 @@
T: "{{ dpdk_make_arch }}"
O: "{{ dpdk_make_arch }}"
extra_args: "-j {{ ansible_processor_vcpus }}"
+ environment:
+ RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
- name: enable RTE_PORT_STATS_COLLECT
lineinfile:
@@ -57,6 +73,8 @@
- my_make:
chdir: "{{ dpdk_path }}/{{ dpdk_make_arch}}"
extra_args: "-j {{ ansible_processor_vcpus }}"
+ environment:
+ RTE_KERNELDIR: "{{ RTE_KERNELDIR }}"
- file:
path: "{{ dpdk_module_dir}}"
@@ -67,7 +85,8 @@
dest: "{{ dpdk_module_dir }}/igb_uio.ko"
remote_src: yes
-- command: depmod -a
+- name: run depmod for dpdk_kernel
+ command: depmod "{{ dpdk_kernel }}"
- file:
path: "{{ INSTALL_BIN_PATH }}"
diff --git a/ansible/roles/install_dpdk/vars/main.yml b/ansible/roles/install_dpdk/vars/main.yml
index 730215c90..1cc4f1583 100644
--- a/ansible/roles/install_dpdk/vars/main.yml
+++ b/ansible/roles/install_dpdk/vars/main.yml
@@ -1,6 +1,6 @@
---
dpdk_make_arch: x86_64-native-linuxapp-gcc
-dpdk_module_dir: "/lib/modules/{{ ansible_kernel }}/extra"
+dpdk_module_dir: "/lib/modules/{{ dpdk_kernel }}/extra"
hugetable_mount: /mnt/huge
dpdk_devbind:
"16.07": "{{ dpdk_path }}/tools/dpdk-devbind.py"