Add DPDK install to ansible 50/18850/1
authorPeter Mikus <pmikus@cisco.com>
Fri, 12 Apr 2019 20:22:05 +0000 (20:22 +0000)
committerPeter Mikus <pmikus@cisco.com>
Fri, 12 Apr 2019 20:22:05 +0000 (20:22 +0000)
Change-Id: If838c2a008ffd5bdf458c76d729f57b47e225b41
Signed-off-by: Peter Mikus <pmikus@cisco.com>
resources/tools/testbed-setup/ansible/inventories/lf_inventory/group_vars/all.yaml
resources/tools/testbed-setup/ansible/roles/sut/tasks/dpdk.yaml [new file with mode: 0644]
resources/tools/testbed-setup/ansible/roles/sut/tasks/main.yaml
resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_bionic.yaml

index 452a12c..cae851d 100644 (file)
@@ -41,6 +41,12 @@ kubernetes_version: '1.11.0-00'
 kubernetes_repository: 'deb http://apt.kubernetes.io/ kubernetes-xenial {{ kubernetes_channel }}'
 kubernetes_apt_package_name: '{{ kubernetes_version }}'
 
+# DPDK settings.
+dpdk:
+  target_dir: '/opt'
+  version: 'dpdk-19.02'
+  url: 'https://fast.dpdk.org/rel'
+
 # Calibration settings.
 jitter:
   directory: '/tmp/pma_tools'
diff --git a/resources/tools/testbed-setup/ansible/roles/sut/tasks/dpdk.yaml b/resources/tools/testbed-setup/ansible/roles/sut/tasks/dpdk.yaml
new file mode 100644 (file)
index 0000000..a4ae779
--- /dev/null
@@ -0,0 +1,23 @@
+---
+# file: roles/sut/tasks/dpdk.yaml
+
+- name: Download DPDK release archive
+  get_url:
+    url: '{{ dpdk.url }}/{{ dpdk.version }}.tar.xz'
+    dest: '{{ dpdk.target_dir }}/{{ dpdk.version }}.tar.xz'
+    mode: 0644
+  register: 'linux__dpdk_downloaded'
+  tags: install-dpdk
+
+- name: Extract DPDK release archive
+  become: yes
+  shell: 'cd {{ dpdk.target_dir }}; tar xf {{ dpdk.target_dir }}/{{ dpdk.version }}.tar.xz'
+  when: 'linux__dpdk_downloaded'
+  register: 'linux__dpdk_extracted'
+  tags: install-dpdk
+
+- name: Compile DPDK release
+  become: yes
+  command: 'make install T={{ ansible_machine }}-native-linuxapp-gcc DESTDIR={{ dpdk.target_dir }}/{{ dpdk.version }} chdir={{ dpdk.target_dir }}/{{ dpdk.version }}'
+  when: 'linux__dpdk_extracted'
+  tags: install-dpdk
index 53f1f9b..9384784 100644 (file)
   become: yes
   tags: copy-80-vpp
 
-- name: Get kernel-kvm version
-  shell: "apt-cache depends -i linux-image-kvm | grep Depends: | cut -d' ' -f4"
-  register: 'linux__image_kvm_read'
-  tags: install-kernelvm
-
-- name: Download kernel-kvm
-  shell: "apt-get -y download {{ linux__image_kvm_read.stdout }}"
-  args:
-    warn: false # Prevent warning as APT module does not support download.
-  register: 'linux__image_kvm_download'
-  when: 'linux__image_kvm_read'
-  tags: install-kernelvm
-
-- name: Unpack kernel-kvm
-  shell: "dpkg --extract {{ linux__image_kvm_read.stdout }}_*.deb /opt/"
-  when: 'linux__image_kvm_download'
-  tags: install-kernelvm
-
+- name: Install DPDK
+  include_tasks: 'dpdk.yaml'
+  tags: install-dpdk
index 8f0be43..506cb3a 100644 (file)
     state: 'present'
     install_recommends: False
   tags: install-csit-dependencies
+
+- name: Get kernel-kvm version
+  shell: "apt-cache depends -i linux-image-kvm | grep Depends: | cut -d' ' -f4"
+  register: 'linux__image_kvm_read'
+  tags: install-kernelvm
+
+- name: Download kernel-kvm
+  shell: "apt-get -y download {{ linux__image_kvm_read.stdout }}"
+  args:
+    warn: false # Prevent warning as APT module does not support download.
+  register: 'linux__image_kvm_download'
+  when: 'linux__image_kvm_read'
+  tags: install-kernelvm
+
+- name: Unpack kernel-kvm
+  shell: "dpkg --extract {{ linux__image_kvm_read.stdout }}_*.deb /opt/"
+  when: 'linux__image_kvm_download'
+  tags: install-kernelvm

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.