diff options
author | vagrant <pmikus@cisco.com> | 2020-02-04 14:16:01 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2020-02-07 20:08:43 +0000 |
commit | 8605f3f406468f57bb9b2eac12a4421f65965300 (patch) | |
tree | 5eef32ff0298ab1c3ac593adced4a502d7c8ea17 /resources/tools/testbed-setup/ansible/roles | |
parent | d7e14a0a93e7e06047daeaf6a5575f227aeb925a (diff) |
CSIT Azure integration
+ Terraform
+ Ansible
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: I353511c5ef39d8c8d43fedc61c8dbb30b4821e1b
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles')
58 files changed, 1627 insertions, 906 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/azure/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/azure/defaults/main.yaml new file mode 100644 index 0000000000..8c48c307bc --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/azure/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +# file: roles/azure/defaults/main.yaml + diff --git a/resources/tools/testbed-setup/ansible/roles/azure/handlers/main.yaml b/resources/tools/testbed-setup/ansible/roles/azure/handlers/main.yaml new file mode 100644 index 0000000000..c0b3ea970f --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/azure/handlers/main.yaml @@ -0,0 +1,8 @@ +--- +# file: roles/azure/handlers/main.yaml + +- name: Reboot server + reboot: + reboot_timeout: 3600 + tags: + - reboot-server diff --git a/resources/tools/testbed-setup/ansible/roles/azure/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/azure/tasks/main.yaml new file mode 100644 index 0000000000..38c0b7c7f8 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/azure/tasks/main.yaml @@ -0,0 +1,15 @@ +--- +# file: roles/azure/tasks/main.yaml + +- name: Azure - Load Kernel Modules By Default + lineinfile: + path: "/etc/modules" + state: "present" + line: "{{ item }}" + with_items: + - "vfio-pci" + - "ib_uverbs" + - "mlx4_ib" + - "mlx5_ib" + tags: + - load-kernel-modules diff --git a/resources/tools/testbed-setup/ansible/roles/calibration/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/calibration/defaults/main.yaml new file mode 100644 index 0000000000..43628ff146 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/calibration/defaults/main.yaml @@ -0,0 +1,21 @@ +--- +# file: roles/calibration/defaults/main.yaml + +packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}" + +packages_base: + - [] + +packages_by_distro: + ubuntu: + - "build-essential" + +packages_by_arch: + aarch64: + - [] + x86_64: + - [] + +pma_directory: "/tmp/pma_tools" +jitter_core: 7 +jitter_iterations: 30 diff --git a/resources/tools/testbed-setup/ansible/roles/calibration/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/calibration/tasks/main.yaml index c3c96ac499..462f72788c 100644 --- a/resources/tools/testbed-setup/ansible/roles/calibration/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/calibration/tasks/main.yaml @@ -1,14 +1,26 @@ --- # file: roles/calibration/tasks/main.yaml -- name: Run Spectre Meltdown checker - raw: 'wget -qO - https://meltdown.ovh | sudo bash -s - --no-color || true' +- name: Calibration - Install Distribution - Release - Machine Prerequisites + package: + name: "{{ packages | flatten(levels=1) }}" + state: latest + update_cache: true + tags: + - install-dependencies + +- name: Calibration - Run Spectre Meltdown Checker + raw: "wget -qO - https://meltdown.ovh | sudo bash -s - --no-color || true" register: spectre_meltdown_output - tags: run-spectre-meltdown-checker + tags: + - run-spectre-meltdown-checker - debug: var=spectre_meltdown_output.stdout_lines - tags: run-spectre-meltdown-checker + tags: + - run-spectre-meltdown-checker -- name: Machine specifics - include_tasks: '{{ ansible_machine }}.yaml' - tags: run-jitter-tool +- name: Calibration - {{ ansible_machine }} Specific + include_tasks: "{{ ansible_machine }}.yaml" + when: ansible_machine == "x86_64" + tags: + - run-jitter-tool diff --git a/resources/tools/testbed-setup/ansible/roles/calibration/tasks/x86_64.yaml b/resources/tools/testbed-setup/ansible/roles/calibration/tasks/x86_64.yaml index a6132841a0..1d9ed5ea08 100644 --- a/resources/tools/testbed-setup/ansible/roles/calibration/tasks/x86_64.yaml +++ b/resources/tools/testbed-setup/ansible/roles/calibration/tasks/x86_64.yaml @@ -1,21 +1,25 @@ --- # file: roles/calibration/tasks/x86_64.yaml -- name: Clone Jitter tool +- name: Calibration - Clone PMA Tool git: - repo: 'https://gerrit.fd.io/r/pma_tools' - dest: '{{ jitter.directory }}' - tags: run-jitter-tool + repo: "https://gerrit.fd.io/r/pma_tools" + dest: "{{ pma_directory }}" + tags: + - run-jitter-tool -- name: Compile Jitter tool - raw: 'cd {{ jitter.directory }}/jitter && make' - tags: run-jitter-tool +- name: Calibration - Compile PMA Tool + raw: "cd {{ pma_directory }}/jitter && make" + tags: + - run-jitter-tool -- name: Run Jitter tool - raw: '{{ jitter.directory }}/jitter/jitter -c {{ jitter.core }} -i {{ jitter.iterations }} -f' +- name: Calibration - Run Jitter Tool + raw: "{{ pma_directory }}/jitter/jitter -c {{ jitter_core }} -i {{ jitter_iterations }} -f" become: yes register: jitter_output - tags: run-jitter-tool + tags: + - run-jitter-tool - debug: var=jitter_output.stdout_lines - tags: run-jitter-tool + tags: + - run-jitter-tool diff --git a/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/main.yaml index f48a976ea1..c03a69e112 100644 --- a/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/main.yaml @@ -1,45 +1,51 @@ --- # file: roles/cobbler/tasks/main.yaml -- name: Sync the cobbler docker directory +- name: Cobbler - Sync the cobbler docker directory synchronize: - src: 'files' - dest: '/home/{{ ansible_user }}/cobbler_docker' + src: "files" + dest: "/home/{{ ansible_user }}/cobbler_docker" register: __cobbler_image_built - tags: cobbler-build-image + tags: + - cobbler-build-image -- name: Build the cobbler docker image +- name: Cobbler - Build the cobbler docker image docker_image: - path: '/home/{{ ansible_user }}/cobbler_docker/files' - name: 'csit/cobbler' + path: "/home/{{ ansible_user }}/cobbler_docker/files" + name: "csit/cobbler" buildargs: - cobbler_pass: '{{ cobbler_pass }}' - cobbler_web_pass: '{{ cobbler_password }}' - cobbler_ip_addr: '{{ inventory_hostname }}' + cobbler_pass: "{{ cobbler_pass }}" + cobbler_web_pass: "{{ cobbler_password }}" + cobbler_ip_addr: "{{ inventory_hostname }}" when: __cobbler_image_built - tags: cobbler-build-image + tags: + - cobbler-build-image -- name: Run Cobbler image +- name: Cobbler - Run Cobbler image docker_container: - name: 'cobbler' - image: 'csit/cobbler' - network_mode: 'host' + name: "cobbler" + image: "csit/cobbler" + network_mode: "host" volumes: - - '/mnt:/mnt:ro' + - "/mnt:/mnt:ro" register: __cobbler_image_running - tags: cobbler-run-image + tags: + - cobbler-run-image -- name: Run cobbler setup get-loaders - command: 'docker exec -i cobbler cobbler get-loaders' +- name: Cobbler - Run cobbler setup get-loaders + command: "docker exec -i cobbler cobbler get-loaders" when: __cobbler_image_running - tags: cobbler-run-image + tags: + - cobbler-run-image -- name: Run cobbler setup sync - command: 'docker exec -i cobbler cobbler sync' +- name: Cobbler - Run cobbler setup sync + command: "docker exec -i cobbler cobbler sync" when: __cobbler_image_running - tags: cobbler-run-image + tags: + - cobbler-run-image -- name: Add Ubuntu 18.04.2 Server x86_64 to cobbler - include_tasks: 'ubuntu-18.04.2-server-x86_64.yaml' +- name: Cobbler - Add Ubuntu 18.04.2 Server x86_64 to cobbler + include_tasks: "ubuntu-18.04.2-server-x86_64.yaml" when: __cobbler_image_running - tags: cobbler-run-image + tags: + - cobbler-run-image diff --git a/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/ubuntu-18.04.2-server-x86_64.yaml b/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/ubuntu-18.04.2-server-x86_64.yaml index 2c89234de2..f6f1ac0f7a 100644 --- a/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/ubuntu-18.04.2-server-x86_64.yaml +++ b/resources/tools/testbed-setup/ansible/roles/cobbler/tasks/ubuntu-18.04.2-server-x86_64.yaml @@ -7,14 +7,16 @@ dest: '/mnt/ubuntu-18.04.2-server-amd64.iso' checksum: 'sha256:a2cb36dc010d98ad9253ea5ad5a07fd6b409e3412c48f1860536970b073c98f5' register: __iso_downloaded - tags: cobbler-import-image + tags: + - cobbler-import-image - name: Create directory for Ubuntu 18.04.2 Server x86_64 mount file: path: '/mnt/ubuntu-18.04.2-server-x86_64' state: 'directory' register: __mount_directory_created - tags: cobbler-import-image + tags: + - cobbler-import-image - name: Mount Ubuntu 18.04.2 Server x86_64 iso mount: @@ -24,7 +26,8 @@ opts: 'ro,loop' state: mounted when: __iso_downloaded and __mount_directory_created - tags: cobbler-import-image + tags: + - cobbler-import-image - name: Run cobbler distro import for Ubuntu 18.04.2 Server x86_64 command: | @@ -32,4 +35,5 @@ --path=/mnt/ubuntu-18.04.2-server-x86_64 --name=ubuntu-18.04.2-server-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ubuntu-18.04.2-server-x86_64.seed - tags: cobbler-import-image + tags: + - cobbler-import-image diff --git a/resources/tools/testbed-setup/ansible/roles/common/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/common/defaults/main.yaml new file mode 100644 index 0000000000..15a241d1ca --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/common/defaults/main.yaml @@ -0,0 +1,55 @@ +--- +# file: roles/common/defaults/main.yaml + +packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}" + +packages_base: + - "autoconf" + - "cgroup-tools" + - "dkms" + - "iperf3" + - "linux-tools-common" + - "qemu-system" + - "socat" + - "unzip" + - "virtualenv" + +packages_by_distro: + ubuntu: + - "build-essential" + - "libpcap-dev" + - "python-all" + - "python-apt" + - "python-cffi" + - "python-cffi-backend" + - "python-dev" + - "python-pip" + - "python-setuptools" + - "python3-all" + - "python3-apt" + - "python3-cffi" + - "python3-cffi-backend" + - "python3-dev" + - "python3-pip" + - "python3-setuptools" + +packages_by_arch: + aarch64: + - "gfortran" + - "libblas-dev" + - "liblapack-dev" + x86_64: + - [] + +# Proxy settings: Uncomment and fill the proper values. These variables will be +# set globally by writing into /etc/environment file on target machine. +#proxy_env: +# http_proxy: http://proxy.com:80 +# HTTP_PROXY: http://proxy.com:80 +# https_proxy: http://proxy.com:80 +# HTTPS_PROXY: http://proxy.com:80 +# ftp_proxy: http://proxy.com:80 +# FTP_PROXY: http://proxy.com:80 +# no_proxy: localhost,127.0.0.1,{{ ansible_default_ipv4.address }} +# NO_PROXY: localhost,127.0.0.1,{{ ansible_default_ipv4.address }} + diff --git a/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_aarch64.list b/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_aarch64.list deleted file mode 100644 index 08da1ecf96..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_aarch64.list +++ /dev/null @@ -1,47 +0,0 @@ -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic main restricted -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic main restricted - -## Major bug fix updates produced after the final release of the -## distribution. -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team. Also, please note that software in universe WILL NOT receive any -## review or updates from the Ubuntu security team. -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic universe -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic universe -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates universe -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates universe - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team, and may not be under a free licence. Please satisfy yourself as to -## your rights to use the software. Also, please note that software in -## multiverse WILL NOT receive any review or updates from the Ubuntu -## security team. -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic multiverse -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic multiverse -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse - -## N.B. software from this repository may not have been tested as -## extensively as that contained in the main release, although it includes -## newer versions of some applications which may provide useful features. -## Also, please note that software in backports WILL NOT receive any review -## or updates from the Ubuntu security team. -deb http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse -deb-src http://ca.ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted universe multiverse - -deb http://ports.ubuntu.com/ubuntu-ports bionic-security main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security main restricted -deb http://ports.ubuntu.com/ubuntu-ports bionic-security universe -deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security universe -deb http://ports.ubuntu.com/ubuntu-ports bionic-security multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security multiverse - -## Uncomment the following two lines to add software from Canonical's -## 'partner' repository. -## This software is not part of Ubuntu, but is offered by Canonical and the -## respective vendors as a service to Ubuntu users. -# deb http://archive.canonical.com/ubuntu bionic partner -# deb-src http://archive.canonical.com/ubuntu bionic partner diff --git a/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_x86_64.list b/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_x86_64.list deleted file mode 100644 index e8ccadfc64..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/common/files/apt-sources_bionic_x86_64.list +++ /dev/null @@ -1,61 +0,0 @@ -# deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted - -# deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted -# deb http://security.ubuntu.com/ubuntu bionic-security main restricted - -# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to -# newer versions of the distribution. -deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted - -## Major bug fix updates produced after the final release of the -## distribution. -deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team. Also, please note that software in universe WILL NOT receive any -## review or updates from the Ubuntu security team. -deb http://us.archive.ubuntu.com/ubuntu/ bionic universe -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic universe -deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe - -## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu -## team, and may not be under a free licence. Please satisfy yourself as to -## your rights to use the software. Also, please note that software in -## multiverse WILL NOT receive any review or updates from the Ubuntu -## security team. -deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse -deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse - -## N.B. software from this repository may not have been tested as -## extensively as that contained in the main release, although it includes -## newer versions of some applications which may provide useful features. -## Also, please note that software in backports WILL NOT receive any review -## or updates from the Ubuntu security team. -deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse -deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse - -deb http://security.ubuntu.com/ubuntu bionic-security main restricted -deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted -deb http://security.ubuntu.com/ubuntu bionic-security universe -deb-src http://security.ubuntu.com/ubuntu bionic-security universe -deb http://security.ubuntu.com/ubuntu bionic-security multiverse -deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse - -## Uncomment the following two lines to add software from Canonical's -## 'partner' repository. -## This software is not part of Ubuntu, but is offered by Canonical and the -## respective vendors as a service to Ubuntu users. -# deb http://archive.canonical.com/ubuntu bionic partner -# deb-src http://archive.canonical.com/ubuntu bionic partner - -## Uncomment the following two lines to add software from Ubuntu's -## 'extras' repository. -## This software is not part of Ubuntu, but is offered by third-party -## developers who want to ship their latest software. -# deb http://extras.ubuntu.com/ubuntu bionic main -# deb-src http://extras.ubuntu.com/ubuntu bionic main diff --git a/resources/tools/testbed-setup/ansible/roles/common/files/netplan_config b/resources/tools/testbed-setup/ansible/roles/common/files/netplan_config deleted file mode 100644 index 694bff1f4f..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/common/files/netplan_config +++ /dev/null @@ -1,12 +0,0 @@ -# This file describes the network interfaces available on your system -# For more information, see netplan(5). -network: - version: 2 - renderer: networkd - ethernets: - {{ ansible_default_ipv4["interface"] }}: - addresses: [ {{ (ansible_default_ipv4.address + '/' + ansible_default_ipv4.netmask) | ipaddr('host/prefix') }} ] - dhcp4: false - gateway4: {{ ansible_default_ipv4["gateway"] }} - nameservers: - addresses: [ {{ name_servers }} ] diff --git a/resources/tools/testbed-setup/ansible/roles/common/handlers/ipmi.yaml b/resources/tools/testbed-setup/ansible/roles/common/handlers/ipmi.yaml deleted file mode 100644 index 6252cc04fd..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/common/handlers/ipmi.yaml +++ /dev/null @@ -1,47 +0,0 @@ ---- -# file: roles/common/handlers/ipmi.yaml - -- name: Boot from network - ipmi_boot: - name: '{{ inventory_ipmi_hostname }}' - user: '{{ inventory_ipmi_username }}' - password: '{{ inventory_ipmi_password }}' - bootdev: network - delegate_to: localhost - tags: boot-network - -- name: Boot from storage - ipmi_boot: - name: '{{ inventory_ipmi_hostname }}' - user: '{{ inventory_ipmi_username }}' - password: '{{ inventory_ipmi_password }}' - bootdev: hd - delegate_to: localhost - tags: boot-storage - -- name: Power up server - ipmi_power: - name: '{{ inventory_ipmi_hostname }}' - user: '{{ inventory_ipmi_username }}' - password: '{{ inventory_ipmi_password }}' - state: on - delegate_to: localhost - tags: power-up - -- name: Power down server - ipmi_power: - name: '{{ inventory_ipmi_hostname }}' - user: '{{ inventory_ipmi_username }}' - password: '{{ inventory_ipmi_password }}' - state: off - delegate_to: localhost - tags: power-down - -- name: Power cycle server - ipmi_power: - name: '{{ inventory_ipmi_hostname }}' - user: '{{ inventory_ipmi_username }}' - password: '{{ inventory_ipmi_password }}' - state: boot - delegate_to: localhost - tags: power-cycle diff --git a/resources/tools/testbed-setup/ansible/roles/common/handlers/main.yaml b/resources/tools/testbed-setup/ansible/roles/common/handlers/main.yaml index f994afdc60..e7327d3944 100644 --- a/resources/tools/testbed-setup/ansible/roles/common/handlers/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/common/handlers/main.yaml @@ -1,30 +1,8 @@ --- # file: roles/common/handlers/main.yaml -- name: IPMI specific - import_tasks: ipmi.yaml - when: inventory_ipmi_hostname is defined - tags: ipmi-handlers - -- name: CIMC specific - import_tasks: cimc.yaml - when: inventory_cimc_hostname is defined - tags: cimc-handlers - -- name: Update GRUB - command: update-grub - tags: update-grub - - name: Reboot server reboot: reboot_timeout: 3600 - tags: reboot-server - -- name: Wait for server to restart - wait_for: - host: '{{ inventory_hostname }}' - search_regex: OpenSSH - port: 22 - delay: 60 - timeout: 3600 - tags: reboot-server + tags: + - reboot-server 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 deleted file mode 100644 index 4f7800b249..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/common/tasks/kernel_install.yaml +++ /dev/null @@ -1,81 +0,0 @@ ---- -# file: roles/common/tasks/kernel_install.yaml - -- name: Kernel VM - Backup remote initramfs modules - copy: - src: '/etc/initramfs-tools/modules' - dest: '/tmp/initramfs_modules.bkp' - remote_src: yes - ignore_errors: yes - register: __initramfs_modules_backuped - tags: install-kernel-image - -- name: Kernel VM - Backup remote initramfs resume config - copy: - src: '/etc/initramfs-tools/conf.d/resume' - dest: '/tmp/initramfs-resume.bkp' - remote_src: yes - ignore_errors: yes - register: __initramfs_resume_backuped - tags: install-kernel-image - -- name: Kernel VM - Update remote initramfs modules - copy: - src: '../files/initramfs_modules' - dest: '/etc/initramfs-tools/modules' - tags: install-kernel-image - -- name: Kernel VM - Update remote initramfs resume config - copy: - src: '../files/initramfs_resume' - dest: '/etc/initramfs-tools/conf.d/resume' - tags: install-kernel-image - -- name: Kernel VM - Create target kernel dir - file: - path: '/opt/boot' - state: 'directory' - tags: install-kernel-image - -- name: Kernel VM - Build initrd image - shell: 'update-initramfs -k {{ ansible_kernel }} -c -b /opt/boot' - tags: install-kernel-image - -- name: Kernel VM - Copy corresponding kernel img - copy: - src: '/boot/vmlinuz-{{ ansible_kernel }}' - dest: '/opt/boot/vmlinuz-{{ ansible_kernel }}' - remote_src: yes - tags: install-kernel-image - -- name: Kernel VM - Restore remote initramfs modules - copy: - src: '/tmp/initramfs_modules.bkp' - dest: '/etc/initramfs-tools/modules' - remote_src: yes - ignore_errors: yes - when: __initramfs_modules_backuped - tags: install-kernel-image - -- name: Kernel VM - Remove remote backup initramfs modules - file: - path: '/tmp/initramfs_modules.bkp' - state: 'absent' - when: __initramfs_modules_backuped - tags: install-kernel-image - -- name: Kernel VM - Restore remote initramfs resume config - copy: - src: '/tmp/initramfs-resume.bkp' - dest: '/etc/initramfs-tools/conf.d/resume' - remote_src: yes - ignore_errors: yes - when: __initramfs_resume_backuped - tags: install-kernel-image - -- name: Kernel VM - Remove remote backup initramfs resume config - file: - path: '/tmp/initramfs-resume.bkp' - state: 'absent' - when: __initramfs_resume_backuped - tags: install-kernel-image diff --git a/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml index 84358bf863..e60eec9fb0 100644 --- a/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/common/tasks/main.yaml @@ -1,166 +1,106 @@ --- # file: roles/common/tasks/main.yaml -- name: Ensure the system exists in Cobbler - cobbler_system: - host: '{{ cobbler_hostname }}' - port: 60080 - interfaces: - br1: - ipaddress: '{{ ansible_default_ipv4.address }}' - macaddress: '{{ ansible_default_ipv4.macaddress }}' - name: '{{ hostname }}' - password: '{{ cobbler_password }}' - properties: - hostname: '{{ hostname }}' - gateway: '{{ ansible_default_ipv4.gateway }}' - profile: '{{ cobbler_profile }}' - name_servers: '{{ name_servers }}' - name_servers_search: '{{ name_servers_search }}' - kickstart: '/var/lib/cobbler/kickstarts/{{ cobbler_profile }}.seed' - kernel_options: '"interface={{ ansible_default_ipv4.interface }}"' - netboot_enabled: yes - username: '{{ cobbler_username }}' - use_ssl: no - validate_certs: no - when: provision_enabled - delegate_to: localhost - tags: cobbler-include - -- name: Commit Cobbler changes - cobbler_sync: - host: '{{ cobbler_hostname }}' - port: 60080 - password: '{{ cobbler_password }}' - username: '{{ cobbler_username }}' - use_ssl: no - validate_certs: no - run_once: yes - when: provision_enabled - delegate_to: localhost - register: __included_in_cobbler - notify: - - 'Boot from network' - - 'Reboot server' - tags: cobbler-include - -- meta: flush_handlers - -- name: Copy netplan network config file - template: - src: 'files/netplan_config' - dest: '/etc/netplan/01-netcfg.yaml' - owner: 'root' - group: 'root' - mode: '0644' - tags: copy-interface-file - - name: Add permanent proxy settings lineinfile: - path: '/etc/environment' - state: 'present' - line: '{{ item.key }}={{ item.value }}' - with_dict: '{{ proxy_env }}' + path: "/etc/environment" + state: "present" + line: "{{ item.key }}={{ item.value }}" + with_dict: "{{ proxy_env }}" when: proxy_env is defined + tags: + - set-proxy -- name: Install distribution - release - machine prerequisites - include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml' - tags: [ install-csit-dependencies, copy-apt-sources ] +- name: Install Distribution - Release - Machine Prerequisites + package: + name: "{{ packages | flatten(levels=1) }}" + state: latest + update_cache: true + tags: + - install-dependencies - name: Install CSIT PIP requirements pip: name: - - 'ecdsa==0.13.3' - - 'paramiko==2.6.0' - - 'pycrypto==2.6.1' - - 'pypcap==1.2.3' - - 'PyYAML==5.1.1' - - 'requests==2.22.0' - - 'robotframework==3.1.2' - - 'scapy==2.4.3' - - 'scp==0.13.2' - - 'ansible==2.7.8' - - 'dill==0.2.8.2' - - 'numpy==1.17.3' - - 'hdrhistogram==0.6.1' - - 'pandas==0.25.3' - - 'plotly==4.1.1' - - 'PTable==0.9.2' - - 'Sphinx==2.2.1' - - 'sphinx-rtd-theme==0.4.0' - - 'sphinxcontrib-programoutput==0.15' - - 'sphinxcontrib-robotdoc==0.11.0' - - 'alabaster==0.7.12' - - 'Babel==2.7.0' - - 'bcrypt==3.1.7' - - 'certifi==2019.9.11' - - 'cffi==1.13.2' - - 'chardet==3.0.4' - - 'cryptography==2.8' - - 'docutils==0.15.2' - - 'future==0.18.2' - - 'idna==2.8' - - 'imagesize==1.1.0' - - 'Jinja2==2.10.3' - - 'MarkupSafe==1.1.1' - - 'packaging==19.2' - - 'pbr==5.4.3' - - 'pycparser==2.19' - - 'Pygments==2.4.2' - - 'PyNaCl==1.3.0' - - 'pyparsing==2.4.4' - - 'python-dateutil==2.8.1' - - 'pytz==2019.3' - - 'retrying==1.3.3' - - 'six==1.13.0' - - 'snowballstemmer==2.0.0' - - 'sphinxcontrib-applehelp==1.0.1' - - 'sphinxcontrib-devhelp==1.0.1' - - 'sphinxcontrib-htmlhelp==1.0.2' - - 'sphinxcontrib-jsmath==1.0.1' - - 'sphinxcontrib-qthelp==1.0.2' - - 'sphinxcontrib-serializinghtml==1.1.3' - - 'urllib3==1.25.6' - tags: install-pip + - "ecdsa==0.13.3" + - "paramiko==2.6.0" + - "pycrypto==2.6.1" + - "pypcap==1.2.3" + - "PyYAML==5.1.1" + - "requests==2.22.0" + - "robotframework==3.1.2" + - "scapy==2.4.3" + - "scp==0.13.2" + - "ansible==2.7.8" + - "dill==0.2.8.2" + - "numpy==1.17.3" + - "hdrhistogram==0.6.1" + - "pandas==0.25.3" + - "plotly==4.1.1" + - "PTable==0.9.2" + - "Sphinx==2.2.1" + - "sphinx-rtd-theme==0.4.0" + - "sphinxcontrib-programoutput==0.15" + - "sphinxcontrib-robotdoc==0.11.0" + - "alabaster==0.7.12" + - "Babel==2.7.0" + - "bcrypt==3.1.7" + - "certifi==2019.9.11" + - "cffi==1.13.2" + - "chardet==3.0.4" + - "cryptography==2.8" + - "docutils==0.15.2" + - "future==0.18.2" + - "idna==2.8" + - "imagesize==1.1.0" + - "Jinja2==2.10.3" + - "MarkupSafe==1.1.1" + - "packaging==19.2" + - "pbr==5.4.3" + - "pycparser==2.19" + - "Pygments==2.4.2" + - "PyNaCl==1.3.0" + - "pyparsing==2.4.4" + - "python-dateutil==2.8.1" + - "pytz==2019.3" + - "retrying==1.3.3" + - "six==1.13.0" + - "snowballstemmer==2.0.0" + - "sphinxcontrib-applehelp==1.0.1" + - "sphinxcontrib-devhelp==1.0.1" + - "sphinxcontrib-htmlhelp==1.0.2" + - "sphinxcontrib-jsmath==1.0.1" + - "sphinxcontrib-qthelp==1.0.2" + - "sphinxcontrib-serializinghtml==1.1.3" + - "urllib3==1.25.6" + tags: + - install-pip - name: Install CSIT PIP requirements - SciPy workaround pip: name: - - 'scipy==1.1.0' - tags: install-pip + - "scipy==1.1.0" + tags: + - install-pip - name: Set sudoers admin lineinfile: - path: '/etc/sudoers' - state: 'present' - regexp: '^%admin ALL=' - line: '%admin ALL=(ALL) ALL' - validate: '/usr/sbin/visudo -cf %s' - tags: set-sudoers + path: "/etc/sudoers" + state: "present" + regexp: "^%admin ALL=" + line: "%admin ALL=(ALL) ALL" + validate: "/usr/sbin/visudo -cf %s" + tags: + - set-sudoers - name: Set sudoers sudo lineinfile: - path: '/etc/sudoers' - state: 'present' - regexp: '^%sudo' - line: '%sudo ALL=(ALL:ALL) NOPASSWD: ALL' - validate: '/usr/sbin/visudo -cf %s' - tags: set-sudoers - -- name: Copy grub file - template: - src: 'files/grub_{{ ansible_machine }}' - dest: '/etc/default/grub' - owner: 'root' - group: 'root' - mode: '644' - notify: - - 'Update GRUB' - - 'Reboot server' - tags: copy-grub - -- name: Mellanox Install - Driver - import_tasks: mellanox.yaml - tags: mellanox-install + path: "/etc/sudoers" + state: "present" + regexp: "^%sudo" + line: "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" + validate: "/usr/sbin/visudo -cf %s" + tags: + - set-sudoers - meta: flush_handlers diff --git a/resources/tools/testbed-setup/ansible/roles/common/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/common/tasks/ubuntu_bionic.yaml deleted file mode 100644 index 480358b0a3..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/common/tasks/ubuntu_bionic.yaml +++ /dev/null @@ -1,54 +0,0 @@ ---- -# file: roles/common/tasks/ubuntu_bionic.yaml - -- name: Copy apt sources file - template: - src: 'files/apt-sources_{{ ansible_distribution_release }}_{{ ansible_machine }}.list' - dest: '/etc/apt/sources.list' - tags: copy-apt-sources - -- name: Install CSIT dependencies - apt: - name: - - 'autoconf' - - 'build-essential' - - 'cgroup-bin' - - 'dkms' - - 'iperf3' - - 'libpcap-dev' - - 'python-all' - - 'python-apt' - - 'python-cffi' - - 'python-cffi-backend' - - 'python-dev' - - 'python-pip' - - 'python-setuptools' - - 'python3-all' - - 'python3-apt' - - 'python3-cffi' - - 'python3-cffi-backend' - - 'python3-dev' - - 'python3-pip' - - 'python3-setuptools' - - 'qemu-system' - - 'socat' - - 'virtualenv' - - 'unzip' - - 'zlib1g-dev' - state: 'present' - cache_valid_time: 3600 - install_recommends: False - tags: install-csit-dependencies - -- name: Install CSIT dependencies - aarch64 SciPy - apt: - name: - - 'gfortran' - - 'libblas-dev' - - 'liblapack-dev' - state: 'present' - cache_valid_time: 3600 - install_recommends: False - when: > - ansible_machine == 'aarch64' - tags: install-csit-dependencies diff --git a/resources/tools/testbed-setup/ansible/roles/docker/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/docker/defaults/main.yaml index 30958c9fa4..4f2cae9b75 100644 --- a/resources/tools/testbed-setup/ansible/roles/docker/defaults/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/docker/defaults/main.yaml @@ -1,3 +1,6 @@ +--- +# file: roles/docker/defaults/main.yaml + # Version options. docker_edition: 'ce' docker_version: '19.03.3' diff --git a/resources/tools/testbed-setup/ansible/roles/dpdk/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/dpdk/defaults/main.yaml new file mode 100644 index 0000000000..27907f7d0e --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/dpdk/defaults/main.yaml @@ -0,0 +1,25 @@ +--- +# file: roles/dpdk/defaults/main.yaml + +packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}" + +packages_base: + - [] + +packages_by_distro: + ubuntu: + - "build-essential" + - "libnuma-dev" + +packages_by_arch: + aarch64: + - [] + x86_64: + - [] + +dpdk_target_dir: "/opt" +dpdk_version: "dpdk-19.02" +dpdk_url: "https://fast.dpdk.org/rel" +dpdk_build_targets: + aarch64: "arm64-armv8a" + x86_64: "x86_64-native" diff --git a/resources/tools/testbed-setup/ansible/roles/dpdk/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/dpdk/tasks/main.yaml new file mode 100644 index 0000000000..3c4f69b5a0 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/dpdk/tasks/main.yaml @@ -0,0 +1,34 @@ +--- +# file: roles/dpdk/tasks/main.yaml + +- name: DPDK - Install Distribution - Release - Machine Prerequisites + package: + name: "{{ packages | flatten(levels=1) }}" + state: latest + update_cache: true + tags: + - install-dependencies + +- name: DPDK - Download 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={{ dpdk_build_targets[ansible_machine] }}-linuxapp-gcc DESTDIR={{ dpdk_target_dir }}/{{ dpdk_version }} chdir={{ dpdk_target_dir }}/{{ dpdk_version }}" + when: "linux__dpdk_extracted" + tags: + - install-dpdk diff --git a/resources/tools/testbed-setup/ansible/roles/iperf/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/iperf/defaults/main.yaml new file mode 100644 index 0000000000..9639c93a4d --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/iperf/defaults/main.yaml @@ -0,0 +1,21 @@ +--- +# file: roles/iperf/defaults/main.yaml + +packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}" + +packages_base: + - [] + +packages_by_distro: + ubuntu: + - "build-essential" + - "lib32z1" + +packages_by_arch: + aarch64: + - [] + x86_64: + - [] + +iperf_target_dir: "/opt" +iperf_version: "3.7" diff --git a/resources/tools/testbed-setup/ansible/roles/iperf/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/iperf/tasks/main.yaml new file mode 100644 index 0000000000..e43206bf8d --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/iperf/tasks/main.yaml @@ -0,0 +1,40 @@ +--- +# file: roles/iperf/tasks/main.yaml + +- name: iPerf Install - Install Distribution - Release - Machine Prerequisites + package: + name: "{{ packages | flatten(levels=1) }}" + state: latest + update_cache: true + tags: + - install-dependencies + +- name: iPerf Install - Get Release Archive + get_url: + url: "https://downloads.es.net/pub/iperf/iperf-{{ iperf_version }}.tar.gz" + dest: "{{ iperf_target_dir }}/iperf-{{ iperf_version }}.tar.gz" + mode: 0644 + tags: + - install-iperf + +- name: iPerf Install - Ensure Directory Exists + file: + path: "{{ iperf_target_dir }}/iperf-{{ iperf_version }}" + state: "directory" + tags: + - install-iperf + +- name: iPerf Install - Extract Release Archive + unarchive: + remote_src: true + src: "{{ iperf_target_dir }}/iperf-{{ iperf_version }}.tar.gz" + dest: "{{ iperf_target_dir }}/" + creates: "{{ iperf_target_dir }}/iperf-{{ iperf_version }}/" + tags: + - install-iperf + +- name: iPerf Install - Compile Release I + shell: | + cd "{{ iperf_target_dir }}/iperf-{{ iperf_version }}/" && ./configure && make && make install + tags: + - install-iperf diff --git a/resources/tools/testbed-setup/ansible/roles/common/files/initramfs_modules b/resources/tools/testbed-setup/ansible/roles/kernel_vm/files/initramfs_modules index 00ae8e03e7..00ae8e03e7 100644 --- a/resources/tools/testbed-setup/ansible/roles/common/files/initramfs_modules +++ b/resources/tools/testbed-setup/ansible/roles/kernel_vm/files/initramfs_modules diff --git a/resources/tools/testbed-setup/ansible/roles/common/files/initramfs_resume b/resources/tools/testbed-setup/ansible/roles/kernel_vm/files/initramfs_resume index 820819823b..820819823b 100644 --- a/resources/tools/testbed-setup/ansible/roles/common/files/initramfs_resume +++ b/resources/tools/testbed-setup/ansible/roles/kernel_vm/files/initramfs_resume diff --git a/resources/tools/testbed-setup/ansible/roles/kernel_vm/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/kernel_vm/tasks/main.yaml new file mode 100644 index 0000000000..ba9426a55f --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/kernel_vm/tasks/main.yaml @@ -0,0 +1,92 @@ +--- +# file: roles/kernel_vm/tasks/main.yaml + +- name: Kernel VM - Backup remote initramfs modules + copy: + src: "/etc/initramfs-tools/modules" + dest: "/tmp/initramfs_modules.bkp" + remote_src: yes + ignore_errors: yes + register: __initramfs_modules_backuped + tags: + - install-kernel-image + +- name: Kernel VM - Backup remote initramfs resume config + copy: + src: "/etc/initramfs-tools/conf.d/resume" + dest: "/tmp/initramfs-resume.bkp" + remote_src: yes + ignore_errors: yes + register: __initramfs_resume_backuped + tags: + - install-kernel-image + +- name: Kernel VM - Update remote initramfs modules + copy: + src: "../files/initramfs_modules" + dest: "/etc/initramfs-tools/modules" + tags: + - install-kernel-image + +- name: Kernel VM - Update remote initramfs resume config + copy: + src: "../files/initramfs_resume" + dest: "/etc/initramfs-tools/conf.d/resume" + tags: + - install-kernel-image + +- name: Kernel VM - Create target kernel dir + file: + path: "/opt/boot" + state: "directory" + tags: + - install-kernel-image + +- name: Kernel VM - Build initrd image + shell: "update-initramfs -k {{ ansible_kernel }} -c -b /opt/boot" + tags: + - install-kernel-image + +- name: Kernel VM - Copy corresponding kernel img + copy: + src: "/boot/vmlinuz-{{ ansible_kernel }}" + dest: "/opt/boot/vmlinuz-{{ ansible_kernel }}" + remote_src: yes + tags: + - install-kernel-image + +- name: Kernel VM - Restore remote initramfs modules + copy: + src: "/tmp/initramfs_modules.bkp" + dest: "/etc/initramfs-tools/modules" + remote_src: yes + ignore_errors: yes + when: __initramfs_modules_backuped + tags: + - install-kernel-image + +- name: Kernel VM - Remove remote backup initramfs modules + file: + path: "/tmp/initramfs_modules.bkp" + state: "absent" + when: __initramfs_modules_backuped + tags: + - install-kernel-image + +- name: Kernel VM - Restore remote initramfs resume config + copy: + src: "/tmp/initramfs-resume.bkp" + dest: "/etc/initramfs-tools/conf.d/resume" + remote_src: yes + ignore_errors: yes + when: __initramfs_resume_backuped + tags: + - install-kernel-image + +- name: Kernel VM - Remove remote backup initramfs resume config + file: + path: "/tmp/initramfs-resume.bkp" + state: "absent" + when: __initramfs_resume_backuped + tags: + - install-kernel-image diff --git a/resources/tools/testbed-setup/ansible/roles/kubernetes/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/kubernetes/defaults/main.yaml index ed936e5da5..1a2f773950 100644 --- a/resources/tools/testbed-setup/ansible/roles/kubernetes/defaults/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/kubernetes/defaults/main.yaml @@ -1,5 +1,8 @@ +--- +# file: roles/kubernetes/defaults/main.yaml + # Version options. -kubernetes_version: '1.11.0-00' +kubernetes_version: "1.11.0-00" kubernetes_apt_package_state: present # Service options. @@ -8,5 +11,5 @@ kubernetes_service_enabled: true kubernetes_restart_handler_state: restarted # APT options. -kubernetes_apt_repository: 'deb http://apt.kubernetes.io/ kubernetes-xenial main' +kubernetes_apt_repository: "deb http://apt.kubernetes.io/ kubernetes-xenial main" kubernetes_apt_repository_state: present diff --git a/resources/tools/testbed-setup/ansible/roles/mellanox/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/mellanox/defaults/main.yaml new file mode 100644 index 0000000000..2b6d3a366e --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/mellanox/defaults/main.yaml @@ -0,0 +1,19 @@ +--- +# file: roles/mellanox/defaults/main.yaml + +packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}" + +packages_base: + - [] + +packages_by_distro: + ubuntu: + - "build-essential" + +packages_by_arch: + aarch64: + - [] + x86_64: + - [] + +mellanox_version: "4.6-1.0.1.1" diff --git a/resources/tools/testbed-setup/ansible/roles/common/tasks/mellanox.yaml b/resources/tools/testbed-setup/ansible/roles/mellanox/tasks/main.yaml index b8d14ad67c..0971a1a192 100644 --- a/resources/tools/testbed-setup/ansible/roles/common/tasks/mellanox.yaml +++ b/resources/tools/testbed-setup/ansible/roles/mellanox/tasks/main.yaml @@ -1,39 +1,45 @@ --- -# file: roles/common/tasks/mellanox.yaml +# file: roles/mellanox/tasks/main.yaml - name: Mellanox Install - Check Presence of Mellanox Hardware shell: "lspci | grep Mellanox | awk '{print $1}'" register: mellanox_pcis failed_when: no changed_when: no - tags: install-mellanox + tags: + - install-mellanox - name: Mellanox Install - Get OFED get_url: - url: 'http://content.mellanox.com/ofed/MLNX_OFED-{{ mellanox.version }}/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz' - dest: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz' + url: "http://content.mellanox.com/ofed/MLNX_OFED-{{ mellanox.version }}/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz" + dest: "/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz" mode: 0644 when: mellanox_pcis.stdout_lines | length > 0 - tags: install-mellanox + tags: + - install-mellanox - name: Mellanox Install - Extract OFED unarchive: remote_src: true - src: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz' - dest: '/opt/' - creates: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}' + src: "/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}.tgz" + dest: "/opt/" + creates: "/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}" register: mellanox_firmware_extracted when: mellanox_pcis.stdout_lines | length > 0 - tags: install-mellanox + tags: + - install-mellanox - name: Mellanox Install - Install OFED - command: './mlnxofedinstall --with-mft --dpdk --force --upstream-libs' + command: "./mlnxofedinstall --with-mft --dpdk --force --upstream-libs" args: - chdir: '/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}' + chdir: "/opt/MLNX_OFED_LINUX-{{ mellanox.version }}-{{ ansible_distribution|lower }}{{ ansible_distribution_version }}-{{ ansible_machine }}" when: mellanox_pcis.stdout_lines | length > 0 and mellanox_firmware_extracted - tags: install-mellanox + tags: + - install-mellanox - name: Mellanox Install - Switch Infiniband to Ethernet - command: 'mlxconfig --yes --dev {{ item }} set LINK_TYPE_P1=2 LINK_TYPE_P2=2' + command: "mlxconfig --yes --dev {{ item }} set LINK_TYPE_P1=2 LINK_TYPE_P2=2" with_items: "{{ mellanox_pcis.stdout_lines }}" - tags: install-mellanox + tags: + - install-mellanox + diff --git a/resources/tools/testbed-setup/ansible/roles/performance_tuning/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/performance_tuning/defaults/main.yaml new file mode 100644 index 0000000000..60c16a9915 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/performance_tuning/defaults/main.yaml @@ -0,0 +1,23 @@ +--- +# file: roles/performance_tuning/defaults/main.yaml + +packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}" + +packages_base: + - "cpufrequtils" + +packages_by_distro: + ubuntu: + - [] + +packages_by_arch: + aarch64: + - [] + x86_64: + - [] + +grub_cmdline_linux: + aarch64: + - 'GRUB_CMDLINE_LINUX="isolcpus={{ grub.isolcpus }} nohz_full={{ grub.nohz_full }} rcu_nocbs={{ grub.rcu_nocbs }} intel_iommu=on nmi_watchdog=0 audit=0 nosoftlockup processor.max_cstate=1"' + x86_64: + - 'GRUB_CMDLINE_LINUX="isolcpus={{ grub.isolcpus }} nohz_full={{ grub.nohz_full }} rcu_nocbs={{ grub.rcu_nocbs }} numa_balancing=disable intel_pstate=disable intel_iommu=on iommu=pt nmi_watchdog=0 audit=0 nosoftlockup processor.max_cstate=1 intel_idle.max_cstate=1 hpet=disable tsc=reliable mce=off"' diff --git a/resources/tools/testbed-setup/ansible/roles/performance_tuning/files/irqbalance b/resources/tools/testbed-setup/ansible/roles/performance_tuning/files/irqbalance deleted file mode 100644 index 84fb5f17e2..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/performance_tuning/files/irqbalance +++ /dev/null @@ -1,6 +0,0 @@ -#Configuration for the irqbalance daemon - -#Should irqbalance be enabled? -ENABLED="0" -#Balance the IRQs only once? -ONESHOT="0" diff --git a/resources/tools/testbed-setup/ansible/roles/performance_tuning/handlers/main.yaml b/resources/tools/testbed-setup/ansible/roles/performance_tuning/handlers/main.yaml index ed758d8dfc..917856b7a0 100644 --- a/resources/tools/testbed-setup/ansible/roles/performance_tuning/handlers/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/performance_tuning/handlers/main.yaml @@ -4,13 +4,10 @@ - name: Reboot server reboot: reboot_timeout: 3600 - tags: reboot-server + tags: + - reboot-server -- name: Wait for server to restart - wait_for: - host: '{{ inventory_hostname }}' - search_regex: OpenSSH - port: 22 - delay: 60 - timeout: 3600 - tags: reboot-server +- name: Update GRUB + command: update-grub + tags: + - update-grub diff --git a/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/aarch64.yaml b/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/aarch64.yaml deleted file mode 100644 index b5ff02a9ca..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/aarch64.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -# file: roles/performance_tuning/tasks/aarch64.yaml - -- name: Configure {{ ansible_machine }} kernel parameters - lineinfile: - path: '/etc/default/grub' - state: 'present' - regexp: '^GRUB_CMDLINE_LINUX=' - line: 'GRUB_CMDLINE_LINUX="isolcpus={{ grub.isolcpus }} nohz_full={{ grub.nohz_full }} rcu_nocbs={{ grub.rcu_nocbs }} intel_iommu=on nmi_watchdog=0 audit=0 nosoftlockup processor.max_cstate=1"' - notify: - - 'Update GRUB' - tags: set-grub diff --git a/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/main.yaml index 348bccbb33..77b2683124 100644 --- a/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/main.yaml @@ -1,57 +1,69 @@ --- # file: roles/performance_tuning/tasks/main.yaml -- name: Install distribution - release - machine prerequisites - include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml' - tags: install-csit-dependencies +- name: Performance Tuning - Install Distribution - Release - Machine Prerequisites + package: + name: "{{ packages | flatten(levels=1) }}" + state: latest + update_cache: true + tags: + - install-dependencies -- name: Machine specifics - include_tasks: '{{ ansible_machine }}.yaml' - tags: set-grub +- name: Performance Tuning - Configure {{ ansible_machine }} kernel parameters + lineinfile: + path: "/etc/default/grub" + state: "present" + regexp: "^GRUB_CMDLINE_LINUX=" + line: {{ grub_cmdline_linux[ansible_machine] }} + notify: + - "Update GRUB" + - "Reboot server" + tags: + - set-grub -- name: Turbo boost +- name: Performance Tuning - Turbo boost import_tasks: turbo_boost.yaml when: > cpu_microarchitecture == "skylake" or cpu_microarchitecture == "cascadelake" - tags: turbo-boost + tags: + - turbo-boost -- name: Copy CSIT sysctl file +- name: Performance Tuning - Copy CSIT sysctl file template: - src: 'files/90-csit' - dest: '/etc/sysctl.d/90-csit.conf' - owner: 'root' - group: 'root' - mode: '0644' - tags: copy-90-csit - -- name: Copy IRQ load balancing file - copy: - src: 'files/irqbalance' - dest: '/etc/default/irqbalance' - owner: 'root' - group: 'root' - mode: '0644' - tags: copy-irq - -- name: Copy cpufrequtils file + src: "files/90-csit" + dest: "/etc/sysctl.d/90-csit.conf" + owner: "root" + group: "root" + mode: "0644" + tags: + - copy-90-csit + +- name: Performance Tuning - Copy cpufrequtils file copy: - src: 'files/cpufrequtils' - dest: '/etc/default/cpufrequtils' - owner: 'root' - group: 'root' - mode: '0644' - tags: copy-cpufrequtils - -- name: Set ondemand service to disable + src: "files/cpufrequtils" + dest: "/etc/default/cpufrequtils" + owner: "root" + group: "root" + mode: "0644" + tags: + - copy-cpufrequtils + +- name: Performance Tuning - Set ondemand service to disable service: - name: 'ondemand' - enabled: 'no' - tags: set-ondemand + name: "ondemand" + enabled: "no" + tags: + - set-ondemand -- name: Load vfio-pci by default +- name: Performance Tuning - Load kernel modules by default lineinfile: - path: '/etc/modules' - state: 'present' - line: 'vfio-pci' - tags: load-vfio-pci + path: "/etc/modules" + state: "present" + line: "{{ item }}" + with_items: + - "vfio-pci" + tags: + - load-kernel-modules + +- meta: flush_handlers diff --git a/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/turbo_boost.yaml b/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/turbo_boost.yaml index a4872091a5..f6633f5e82 100644 --- a/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/turbo_boost.yaml +++ b/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/turbo_boost.yaml @@ -2,32 +2,35 @@ # file: roles/performance_tuning/tasks/turbo_boost.yaml - name: Turbo boost - Install msr-tools - apt: + package: name: - - 'msr-tools' - state: 'present' - cache_valid_time: 3600 - install_recommends: False - tags: turbo-boost + - "msr-tools" + state: latest + update_cache: true + tags: + - turbo-boost - name: Turbo boost - Load msr by default lineinfile: - path: '/etc/modules' - state: 'present' - line: 'msr' - tags: turbo-boost + path: "/etc/modules" + state: "present" + line: "msr" + tags: + - turbo-boost - name: Turbo boost - Custom startup service hook copy: - src: 'files/disable-turbo-boost.service' - dest: '/etc/systemd/system/disable-turbo-boost.service' - owner: 'root' - group: 'root' - mode: '0644' - tags: turbo-boost + src: "files/disable-turbo-boost.service" + dest: "/etc/systemd/system/disable-turbo-boost.service" + owner: "root" + group: "root" + mode: "0644" + tags: + - turbo-boost - name: Turbo boost - Custom startup service hook enable service: - name: 'disable-turbo-boost' + name: "disable-turbo-boost" enabled: yes - tags: turbo-boost + tags: + - turbo-boost diff --git a/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/ubuntu_bionic.yaml deleted file mode 100644 index 62b64be469..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/ubuntu_bionic.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# file: roles/performance_tuning/tasks/ubuntu_bionic.yaml - -- name: Install CSIT dependencies - apt: - name: - - 'cpufrequtils' - state: 'present' - cache_valid_time: 3600 - install_recommends: False - tags: install-csit-dependencies diff --git a/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/x86_64.yaml b/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/x86_64.yaml deleted file mode 100644 index 7b66300bc4..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/performance_tuning/tasks/x86_64.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# file: roles/performance_tuning/tasks/x86_64.yaml - -- name: Configure {{ ansible_machine }} kernel parameters - lineinfile: - path: '/etc/default/grub' - state: 'present' - regexp: '^GRUB_CMDLINE_LINUX=' - line: 'GRUB_CMDLINE_LINUX="isolcpus={{ grub.isolcpus }} nohz_full={{ grub.nohz_full }} rcu_nocbs={{ grub.rcu_nocbs }} numa_balancing=disable intel_pstate=disable intel_iommu=on iommu=pt nmi_watchdog=0 audit=0 nosoftlockup processor.max_cstate=1 intel_idle.max_cstate=1 hpet=disable tsc=reliable mce=off"' - notify: - - 'Update GRUB' - - 'Reboot server' - tags: set-grub diff --git a/resources/tools/testbed-setup/ansible/roles/sut/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/sut/defaults/main.yaml new file mode 100644 index 0000000000..327d8b7456 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/sut/defaults/main.yaml @@ -0,0 +1,27 @@ +--- +# file: roles/sut/defaults/main.yaml + +packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}" + +packages_base: + - "gdb" + - "libtool" + - "lxc" + - "pkg-config" + - "screen" + +packages_by_distro: + ubuntu: + - "build-essential" + - "libglib2.0-dev" + - "libmbedcrypto1" + - "libmbedtls10" + - "libmbedx509-0" + - "libnuma-dev" + - "libpixman-1-dev" + +packages_by_arch: + aarch64: + - [] + x86_64: + - [] diff --git a/resources/tools/testbed-setup/ansible/roles/sut/tasks/dpdk.yaml b/resources/tools/testbed-setup/ansible/roles/sut/tasks/dpdk.yaml deleted file mode 100644 index f2fc83edae..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/sut/tasks/dpdk.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -# 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={{ dpdk.build_targets[ansible_machine] }}-linuxapp-gcc DESTDIR={{ dpdk.target_dir }}/{{ dpdk.version }} chdir={{ dpdk.target_dir }}/{{ dpdk.version }}' - when: 'linux__dpdk_extracted' - tags: install-dpdk diff --git a/resources/tools/testbed-setup/ansible/roles/sut/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/sut/tasks/main.yaml index a882001868..5d02225abc 100644 --- a/resources/tools/testbed-setup/ansible/roles/sut/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/sut/tasks/main.yaml @@ -1,18 +1,19 @@ --- # file: roles/sut/tasks/main.yaml -- name: Install distribution - release - machine prerequisites - include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml' - tags: [ install-csit-dependencies, install-kernel-image ] +- name: SUT - Install Distribution - Release - Machine Prerequisites + package: + name: "{{ packages | flatten(levels=1) }}" + state: latest + update_cache: true + tags: + - install-dependencies -- name: Copy 80-vpp.conf +- name: SUT - Copy 80-vpp.conf file: - src: '/dev/null' - dest: '/etc/sysctl.d/80-vpp.conf' - state: 'link' + src: "/dev/null" + dest: "/etc/sysctl.d/80-vpp.conf" + state: "link" become: yes - tags: copy-80-vpp - -- name: Install DPDK - include_tasks: 'dpdk.yaml' - tags: install-dpdk + tags: + - copy-80-vpp diff --git a/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_bionic.yaml deleted file mode 100644 index ec2e6fcdd1..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_bionic.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -# file: roles/sut/tasks/ubuntu_bionic.yaml - -- name: Install CSIT dependencies - apt: - name: - - 'gdb' - - 'libglib2.0-dev' - - 'libmbedcrypto1' - - 'libmbedtls10' - - 'libmbedx509-0' - - 'libnuma-dev' - - 'libpixman-1-dev' - - 'libtool' - - 'lxc' - - 'openjdk-8-jdk' - - 'pkg-config' - - 'screen' - state: 'present' - cache_valid_time: 3600 - install_recommends: False - tags: install-csit-dependencies - -- name: Kernel VM install - include_tasks: '../../common/tasks/kernel_install.yaml' - tags: install-kernel-image diff --git a/resources/tools/testbed-setup/ansible/roles/tg/files/csit-initialize-docker-tg.sh b/resources/tools/testbed-setup/ansible/roles/tg/files/csit-initialize-docker-tg.sh index 2d307b1c38..7b90d20bda 100755 --- a/resources/tools/testbed-setup/ansible/roles/tg/files/csit-initialize-docker-tg.sh +++ b/resources/tools/testbed-setup/ansible/roles/tg/files/csit-initialize-docker-tg.sh @@ -21,7 +21,7 @@ case "${1:-start}" in "start" ) # Run TG for cnt in $(seq 1 ${2:-1}); do - docker network create --driver bridge csit-nw-tg${cnt} + docker network create --driver bridge csit-nw-tg${cnt} || true # If the IMAGE is not already loaded then docker run will pull the # IMAGE, and all image dependencies, before it starts the container. dcr_image="snergster/csit-sut:latest" @@ -55,4 +55,4 @@ case "${1:-start}" in docker rm --force $(docker ps --all --quiet --filter name=csit) docker network rm $(docker network ls --filter name=csit --quiet) ;; -esac
\ No newline at end of file +esac diff --git a/resources/tools/testbed-setup/ansible/roles/tg/handlers/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg/handlers/main.yaml index 53cbb48e0a..e13e67b2c1 100644 --- a/resources/tools/testbed-setup/ansible/roles/tg/handlers/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/tg/handlers/main.yaml @@ -4,6 +4,7 @@ - name: Start csit-initialize-docker-tg.service systemd: enabled: yes - state: 'started' - name: 'csit-initialize-docker-tg.service' - tags: docker-tg + state: "started" + name: "csit-initialize-docker-tg.service" + tags: + - docker-tg diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml index a7ab90d34a..d7a9ed882d 100644 --- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/tg/tasks/main.yaml @@ -1,38 +1,28 @@ --- # file: roles/tg/tasks/main.yaml -- name: Install distribution - release - machine prerequisites - include_tasks: '{{ ansible_distribution|lower }}_{{ ansible_distribution_release }}.yaml' - tags: install-csit-dependencies - -- name: Install WRK - include_tasks: 'wrk.yaml' - tags: install-wrk - -- name: Install TRex - include_tasks: 'trex.yaml' - tags: install-trex - -- name: Copy csit-initialize-docker-tg.sh +- name: TG - Copy csit-initialize-docker-tg.sh copy: - src: 'files/csit-initialize-docker-tg.sh' - dest: '/usr/local/bin/csit-initialize-docker-tg.sh' - owner: 'root' - group: 'root' - mode: '744' + src: "files/csit-initialize-docker-tg.sh" + dest: "/usr/local/bin/csit-initialize-docker-tg.sh" + owner: "root" + group: "root" + mode: "744" when: docker_tg is defined - tags: docker-tg + tags: + - docker-tg -- name: Start csit-initialize-docker-tg.service +- name: TG - Start csit-initialize-docker-tg.service copy: - src: 'files/csit-initialize-docker-tg.service' - dest: '/etc/systemd/system/' - owner: 'root' - group: 'root' - mode: '644' + src: "files/csit-initialize-docker-tg.service" + dest: "/etc/systemd/system/" + owner: "root" + group: "root" + mode: "644" notify: - - 'Start csit-initialize-docker-tg.service' + - "Start csit-initialize-docker-tg.service" when: docker_tg is defined - tags: docker-tg + tags: + - docker-tg - meta: flush_handlers diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml deleted file mode 100644 index dc86ec3e5b..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/trex.yaml +++ /dev/null @@ -1,37 +0,0 @@ ---- -# file: roles/tg/tasks/trex.yaml - -- name: T-Rex Install - Get Release Archive - get_url: - url: 'https://github.com/cisco-system-traffic-generator/trex-core/archive/v{{ trex.version }}.tar.gz' - dest: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz' - mode: 0644 - register: trex_downloaded - tags: install-trex - -- name: T-Rex Install - Ensure Directory Exists - file: - path: '{{ trex.target_dir }}/trex-core-{{ trex.version }}' - state: 'directory' - register: trex_dir_created - tags: install-trex - -- name: T-Rex Install - Extract Release Archive - unarchive: - remote_src: true - src: '{{ trex.target_dir }}/trex-core-{{ trex.version }}.tar.gz' - dest: '{{ trex.target_dir }}/' - creates: '{{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk/' - when: trex_dir_created - register: trex_extracted - tags: install-trex - -- name: T-Rex Install - Compile Release I - raw: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/linux_dpdk/; ./b configure; ./b build' - when: trex_extracted - tags: install-trex - -- name: T-Rex Install - Compile Release II - raw: 'cd {{ trex.target_dir }}/trex-core-{{ trex.version }}/scripts/ko/src; make; make install' - when: trex_extracted - tags: install-trex diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml deleted file mode 100644 index d119f9c462..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/ubuntu_bionic.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# file: roles/tg/tasks/ubuntu_bionic.yaml - -- name: Install CSIT dependencies - apt: - name: - - 'libmnl-dev' - - 'libnuma-dev' - - 'libpcap-dev' - - 'libssl-dev' - state: 'present' - cache_valid_time: 3600 - install_recommends: False - tags: install-csit-dependencies diff --git a/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml b/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml deleted file mode 100644 index aee3761476..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/tg/tasks/wrk.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -# file: roles/tg/tasks/wrk.yaml - -- name: WRK Install - Get Release Archive - get_url: - url: 'https://github.com/wg/wrk/archive/{{ wrk.version }}.tar.gz' - dest: '{{ wrk.target_dir }}/{{ wrk.version }}.tar.gz' - mode: 0644 - register: wrk_downloaded - tags: install-wrk - -- name: WRK Install - Ensure Directory Exists - file: - path: '{{ wrk.target_dir }}/wrk-{{ wrk.version }}' - state: 'directory' - register: wrk_dir_created - tags: install-wrk - -- name: WRK Install - Extract Release Archive - unarchive: - remote_src: true - src: '{{ wrk.target_dir }}/{{ wrk.version }}.tar.gz' - dest: '{{ wrk.target_dir }}/' - creates: '{{ wrk.target_dir }}/wrk-{{ wrk.version }}/src' - when: wrk_dir_created - register: wrk_extracted - tags: install-wrk - -- name: WRK Install - Compile Release - command: 'make' - args: - chdir: '{{ wrk.target_dir }}/wrk-{{ wrk.version }}' - when: wrk_extracted - register: wrk_compiled - tags: install-wrk - -- name: WRK Install - Move Binary - command: 'mv {{ wrk.target_dir }}/wrk-{{ wrk.version }}/wrk /usr/local/bin/' - when: wrk_compiled - tags: install-wrk diff --git a/resources/tools/testbed-setup/ansible/roles/trex/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/trex/defaults/main.yaml new file mode 100644 index 0000000000..1e4b79496f --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/trex/defaults/main.yaml @@ -0,0 +1,28 @@ +--- +# file: roles/trex/defaults/main.yaml + +packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}" + +packages_base: + - [] + +packages_by_distro: + ubuntu: + - "build-essential" + - "libmnl-dev" + - "libnuma-dev" + - "libpcap-dev" + - "librdmacm-dev" + - "librdmacm1" + - "libssl-dev" + - "python3-pip" + - "zlib1g-dev" + +packages_by_arch: + aarch64: + - [] + x86_64: + - [] + +trex_target_dir: "/opt" +trex_version: "2.73" diff --git a/resources/tools/testbed-setup/ansible/roles/trex/files/t-rex.patch b/resources/tools/testbed-setup/ansible/roles/trex/files/t-rex.patch new file mode 100644 index 0000000000..65b437588d --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/trex/files/t-rex.patch @@ -0,0 +1,536 @@ +diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py +index e8d0cd51..a0c01adb 100755 +--- a/linux_dpdk/ws_main.py ++++ b/linux_dpdk/ws_main.py +@@ -209,7 +209,7 @@ def check_ofed(ctx): + + ofed_ver= 42 + ofed_ver_show= '4.2' +- ++ return True + if not os.path.isfile(ofed_info): + ctx.end_msg('not found', 'YELLOW') + return False +@@ -1552,8 +1552,6 @@ class build_option: + flags += ['-DNDEBUG']; + else: + flags += ['-UNDEBUG']; +- if bld.env.OFED_OK: +- flags += ['-DHAVE_IBV_MLX4_WQE_LSO_SEG=1'] + return (flags) + + def get_bnxt_flags(self): +diff --git a/src/dpdk/drivers/net/mlx4/mlx4_autoconf.h b/src/dpdk/drivers/net/mlx4/mlx4_autoconf.h +index b3d68683..35474409 100644 +--- a/src/dpdk/drivers/net/mlx4/mlx4_autoconf.h ++++ b/src/dpdk/drivers/net/mlx4/mlx4_autoconf.h +@@ -1,3 +1,6 @@ +-#ifndef HAVE_IBV_MLX4_WQE_LSO_SEG +-#define HAVE_IBV_MLX4_WQE_LSO_SEG +-#endif ++/* HAVE_IBV_MLX4_BUF_ALLOCATORS is not defined. */ ++ ++/* HAVE_IBV_MLX4_UAR_MMAP_OFFSET is not defined. */ ++ ++/* HAVE_IBV_MLX4_WQE_LSO_SEG is not defined. */ ++ +diff --git a/src/dpdk/drivers/net/mlx5/mlx5_autoconf.h b/src/dpdk/drivers/net/mlx5/mlx5_autoconf.h +index 8770fdde..75db5ae8 100644 +--- a/src/dpdk/drivers/net/mlx5/mlx5_autoconf.h ++++ b/src/dpdk/drivers/net/mlx5/mlx5_autoconf.h +@@ -1,54 +1,362 @@ +-#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +-#define HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT +-#endif ++/* HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT is not defined. */ + +-#ifndef HAVE_IBV_FLOW_DV_SUPPORT +-#define HAVE_IBV_FLOW_DV_SUPPORT +-#endif ++#ifndef HAVE_IBV_DEVICE_TUNNEL_SUPPORT ++#define HAVE_IBV_DEVICE_TUNNEL_SUPPORT 1 ++#endif /* HAVE_IBV_DEVICE_TUNNEL_SUPPORT */ + +-#ifndef HAVE_IBV_DEVICE_COUNTERS_SET_V45 +-#define HAVE_IBV_DEVICE_COUNTERS_SET_V45 +-#endif ++/* HAVE_IBV_DEVICE_MPLS_SUPPORT is not defined. */ + +-#ifndef HAVE_IBV_FLOW_DEVX_COUNTERS +-#define HAVE_IBV_FLOW_DEVX_COUNTERS +-#endif ++#ifndef HAVE_IBV_WQ_FLAGS_PCI_WRITE_END_PADDING ++#define HAVE_IBV_WQ_FLAGS_PCI_WRITE_END_PADDING 1 ++#endif /* HAVE_IBV_WQ_FLAGS_PCI_WRITE_END_PADDING */ + +-#ifndef HAVE_IBV_MLX4_WQE_LSO_SEG +-#define HAVE_IBV_MLX4_WQE_LSO_SEG +-#endif ++/* HAVE_IBV_WQ_FLAG_RX_END_PADDING is not defined. */ + ++#ifndef HAVE_IBV_MLX5_MOD_SWP ++#define HAVE_IBV_MLX5_MOD_SWP 1 ++#endif /* HAVE_IBV_MLX5_MOD_SWP */ + +-#ifdef SUPPORTED_40000baseKR4_Full ++#ifndef HAVE_IBV_MLX5_MOD_MPW ++#define HAVE_IBV_MLX5_MOD_MPW 1 ++#endif /* HAVE_IBV_MLX5_MOD_MPW */ ++ ++#ifndef HAVE_IBV_MLX5_MOD_CQE_128B_COMP ++#define HAVE_IBV_MLX5_MOD_CQE_128B_COMP 1 ++#endif /* HAVE_IBV_MLX5_MOD_CQE_128B_COMP */ ++ ++#ifndef HAVE_IBV_MLX5_MOD_CQE_128B_PAD ++#define HAVE_IBV_MLX5_MOD_CQE_128B_PAD 1 ++#endif /* HAVE_IBV_MLX5_MOD_CQE_128B_PAD */ ++ ++/* HAVE_IBV_FLOW_DV_SUPPORT is not defined. */ ++ ++/* HAVE_MLX5DV_DR is not defined. */ ++ ++/* HAVE_MLX5DV_DR_ESWITCH is not defined. */ ++ ++/* HAVE_IBV_DEVX_OBJ is not defined. */ ++ ++/* HAVE_IBV_FLOW_DEVX_COUNTERS is not defined. */ ++ ++#ifndef HAVE_ETHTOOL_LINK_MODE_25G ++#define HAVE_ETHTOOL_LINK_MODE_25G 1 ++#endif /* HAVE_ETHTOOL_LINK_MODE_25G */ ++ ++#ifndef HAVE_ETHTOOL_LINK_MODE_50G ++#define HAVE_ETHTOOL_LINK_MODE_50G 1 ++#endif /* HAVE_ETHTOOL_LINK_MODE_50G */ ++ ++#ifndef HAVE_ETHTOOL_LINK_MODE_100G ++#define HAVE_ETHTOOL_LINK_MODE_100G 1 ++#endif /* HAVE_ETHTOOL_LINK_MODE_100G */ ++ ++/* HAVE_IBV_DEVICE_COUNTERS_SET_V42 is not defined. */ ++ ++/* HAVE_IBV_DEVICE_COUNTERS_SET_V45 is not defined. */ ++ ++#ifndef HAVE_RDMA_NL_NLDEV ++#define HAVE_RDMA_NL_NLDEV 1 ++#endif /* HAVE_RDMA_NL_NLDEV */ ++ ++#ifndef HAVE_RDMA_NLDEV_CMD_GET ++#define HAVE_RDMA_NLDEV_CMD_GET 1 ++#endif /* HAVE_RDMA_NLDEV_CMD_GET */ ++ ++#ifndef HAVE_RDMA_NLDEV_CMD_PORT_GET ++#define HAVE_RDMA_NLDEV_CMD_PORT_GET 1 ++#endif /* HAVE_RDMA_NLDEV_CMD_PORT_GET */ ++ ++#ifndef HAVE_RDMA_NLDEV_ATTR_DEV_INDEX ++#define HAVE_RDMA_NLDEV_ATTR_DEV_INDEX 1 ++#endif /* HAVE_RDMA_NLDEV_ATTR_DEV_INDEX */ ++ ++#ifndef HAVE_RDMA_NLDEV_ATTR_DEV_NAME ++#define HAVE_RDMA_NLDEV_ATTR_DEV_NAME 1 ++#endif /* HAVE_RDMA_NLDEV_ATTR_DEV_NAME */ ++ ++#ifndef HAVE_RDMA_NLDEV_ATTR_PORT_INDEX ++#define HAVE_RDMA_NLDEV_ATTR_PORT_INDEX 1 ++#endif /* HAVE_RDMA_NLDEV_ATTR_PORT_INDEX */ ++ ++/* HAVE_RDMA_NLDEV_ATTR_NDEV_INDEX is not defined. */ ++ ++#ifndef HAVE_IFLA_NUM_VF ++#define HAVE_IFLA_NUM_VF 1 ++#endif /* HAVE_IFLA_NUM_VF */ ++ ++#ifndef HAVE_IFLA_EXT_MASK ++#define HAVE_IFLA_EXT_MASK 1 ++#endif /* HAVE_IFLA_EXT_MASK */ ++ ++#ifndef HAVE_IFLA_PHYS_SWITCH_ID ++#define HAVE_IFLA_PHYS_SWITCH_ID 1 ++#endif /* HAVE_IFLA_PHYS_SWITCH_ID */ ++ ++#ifndef HAVE_IFLA_PHYS_PORT_NAME ++#define HAVE_IFLA_PHYS_PORT_NAME 1 ++#endif /* HAVE_IFLA_PHYS_PORT_NAME */ ++ ++#ifndef HAVE_IFLA_VXLAN_COLLECT_METADATA ++#define HAVE_IFLA_VXLAN_COLLECT_METADATA 1 ++#endif /* HAVE_IFLA_VXLAN_COLLECT_METADATA */ ++ ++#ifndef HAVE_TCA_CHAIN ++#define HAVE_TCA_CHAIN 1 ++#endif /* HAVE_TCA_CHAIN */ ++ ++#ifndef HAVE_TCA_FLOWER_ACT ++#define HAVE_TCA_FLOWER_ACT 1 ++#endif /* HAVE_TCA_FLOWER_ACT */ ++ ++#ifndef HAVE_TCA_FLOWER_FLAGS ++#define HAVE_TCA_FLOWER_FLAGS 1 ++#endif /* HAVE_TCA_FLOWER_FLAGS */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ETH_TYPE ++#define HAVE_TCA_FLOWER_KEY_ETH_TYPE 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ETH_TYPE */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ETH_DST ++#define HAVE_TCA_FLOWER_KEY_ETH_DST 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ETH_DST */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ETH_DST_MASK ++#define HAVE_TCA_FLOWER_KEY_ETH_DST_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ETH_DST_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ETH_SRC ++#define HAVE_TCA_FLOWER_KEY_ETH_SRC 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ETH_SRC */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ETH_SRC_MASK ++#define HAVE_TCA_FLOWER_KEY_ETH_SRC_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ETH_SRC_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IP_PROTO ++#define HAVE_TCA_FLOWER_KEY_IP_PROTO 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IP_PROTO */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IPV4_SRC ++#define HAVE_TCA_FLOWER_KEY_IPV4_SRC 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IPV4_SRC */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IPV4_SRC_MASK ++#define HAVE_TCA_FLOWER_KEY_IPV4_SRC_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IPV4_SRC_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IPV4_DST ++#define HAVE_TCA_FLOWER_KEY_IPV4_DST 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IPV4_DST */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IPV4_DST_MASK ++#define HAVE_TCA_FLOWER_KEY_IPV4_DST_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IPV4_DST_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IPV6_SRC ++#define HAVE_TCA_FLOWER_KEY_IPV6_SRC 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IPV6_SRC */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IPV6_SRC_MASK ++#define HAVE_TCA_FLOWER_KEY_IPV6_SRC_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IPV6_SRC_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IPV6_DST ++#define HAVE_TCA_FLOWER_KEY_IPV6_DST 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IPV6_DST */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IPV6_DST_MASK ++#define HAVE_TCA_FLOWER_KEY_IPV6_DST_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IPV6_DST_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_TCP_SRC ++#define HAVE_TCA_FLOWER_KEY_TCP_SRC 1 ++#endif /* HAVE_TCA_FLOWER_KEY_TCP_SRC */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_TCP_SRC_MASK ++#define HAVE_TCA_FLOWER_KEY_TCP_SRC_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_TCP_SRC_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_TCP_DST ++#define HAVE_TCA_FLOWER_KEY_TCP_DST 1 ++#endif /* HAVE_TCA_FLOWER_KEY_TCP_DST */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_TCP_DST_MASK ++#define HAVE_TCA_FLOWER_KEY_TCP_DST_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_TCP_DST_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_UDP_SRC ++#define HAVE_TCA_FLOWER_KEY_UDP_SRC 1 ++#endif /* HAVE_TCA_FLOWER_KEY_UDP_SRC */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_UDP_SRC_MASK ++#define HAVE_TCA_FLOWER_KEY_UDP_SRC_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_UDP_SRC_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_UDP_DST ++#define HAVE_TCA_FLOWER_KEY_UDP_DST 1 ++#endif /* HAVE_TCA_FLOWER_KEY_UDP_DST */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_UDP_DST_MASK ++#define HAVE_TCA_FLOWER_KEY_UDP_DST_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_UDP_DST_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_VLAN_ID ++#define HAVE_TCA_FLOWER_KEY_VLAN_ID 1 ++#endif /* HAVE_TCA_FLOWER_KEY_VLAN_ID */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_VLAN_PRIO ++#define HAVE_TCA_FLOWER_KEY_VLAN_PRIO 1 ++#endif /* HAVE_TCA_FLOWER_KEY_VLAN_PRIO */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_VLAN_ETH_TYPE ++#define HAVE_TCA_FLOWER_KEY_VLAN_ETH_TYPE 1 ++#endif /* HAVE_TCA_FLOWER_KEY_VLAN_ETH_TYPE */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_TCP_FLAGS ++#define HAVE_TCA_FLOWER_KEY_TCP_FLAGS 1 ++#endif /* HAVE_TCA_FLOWER_KEY_TCP_FLAGS */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_TCP_FLAGS_MASK ++#define HAVE_TCA_FLOWER_KEY_TCP_FLAGS_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_TCP_FLAGS_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IP_TOS ++#define HAVE_TCA_FLOWER_KEY_IP_TOS 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IP_TOS */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IP_TOS_MASK ++#define HAVE_TCA_FLOWER_KEY_IP_TOS_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IP_TOS_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IP_TTL ++#define HAVE_TCA_FLOWER_KEY_IP_TTL 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IP_TTL */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_IP_TTL_MASK ++#define HAVE_TCA_FLOWER_KEY_IP_TTL_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_IP_TTL_MASK */ ++ ++#ifndef HAVE_TC_ACT_GOTO_CHAIN ++#define HAVE_TC_ACT_GOTO_CHAIN 1 ++#endif /* HAVE_TC_ACT_GOTO_CHAIN */ ++ ++#ifndef HAVE_TC_ACT_VLAN ++#define HAVE_TC_ACT_VLAN 1 ++#endif /* HAVE_TC_ACT_VLAN */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_KEY_ID ++#define HAVE_TCA_FLOWER_KEY_ENC_KEY_ID 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_KEY_ID */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC ++#define HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK ++#define HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST ++#define HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST_MASK ++#define HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_IPV4_DST_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC ++#define HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK ++#define HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST ++#define HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST_MASK ++#define HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_IPV6_DST_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT ++#define HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK ++#define HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT ++#define HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT */ ++ ++#ifndef HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK ++#define HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK 1 ++#endif /* HAVE_TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK */ ++ ++/* HAVE_TCA_FLOWER_KEY_ENC_IP_TOS is not defined. */ ++ ++/* HAVE_TCA_FLOWER_KEY_ENC_IP_TOS_MASK is not defined. */ ++ ++/* HAVE_TCA_FLOWER_KEY_ENC_IP_TTL is not defined. */ ++ ++/* HAVE_TCA_FLOWER_KEY_ENC_IP_TTL_MASK is not defined. */ ++ ++#ifndef HAVE_TC_ACT_TUNNEL_KEY ++#define HAVE_TC_ACT_TUNNEL_KEY 1 ++#endif /* HAVE_TC_ACT_TUNNEL_KEY */ ++ ++#ifndef HAVE_TCA_TUNNEL_KEY_ENC_DST_PORT ++#define HAVE_TCA_TUNNEL_KEY_ENC_DST_PORT 1 ++#endif /* HAVE_TCA_TUNNEL_KEY_ENC_DST_PORT */ ++ ++/* HAVE_TCA_TUNNEL_KEY_ENC_TOS is not defined. */ ++ ++/* HAVE_TCA_TUNNEL_KEY_ENC_TTL is not defined. */ ++ ++#ifndef HAVE_TCA_TUNNEL_KEY_NO_CSUM ++#define HAVE_TCA_TUNNEL_KEY_NO_CSUM 1 ++#endif /* HAVE_TCA_TUNNEL_KEY_NO_CSUM */ ++ ++#ifndef HAVE_TC_ACT_PEDIT ++#define HAVE_TC_ACT_PEDIT 1 ++#endif /* HAVE_TC_ACT_PEDIT */ ++ ++#ifndef HAVE_SUPPORTED_40000baseKR4_Full + #define HAVE_SUPPORTED_40000baseKR4_Full 1 +-#endif ++#endif /* HAVE_SUPPORTED_40000baseKR4_Full */ + +-#ifdef SUPPORTED_40000baseCR4_Full ++#ifndef HAVE_SUPPORTED_40000baseCR4_Full + #define HAVE_SUPPORTED_40000baseCR4_Full 1 +-#endif ++#endif /* HAVE_SUPPORTED_40000baseCR4_Full */ + +-#ifdef SUPPORTED_40000baseSR4_Full ++#ifndef HAVE_SUPPORTED_40000baseSR4_Full + #define HAVE_SUPPORTED_40000baseSR4_Full 1 +-#endif ++#endif /* HAVE_SUPPORTED_40000baseSR4_Full */ + +-#ifdef SUPPORTED_40000baseLR4_Full ++#ifndef HAVE_SUPPORTED_40000baseLR4_Full + #define HAVE_SUPPORTED_40000baseLR4_Full 1 +-#endif ++#endif /* HAVE_SUPPORTED_40000baseLR4_Full */ + +-#ifdef SUPPORTED_56000baseKR4_Full ++#ifndef HAVE_SUPPORTED_56000baseKR4_Full + #define HAVE_SUPPORTED_56000baseKR4_Full 1 +-#endif ++#endif /* HAVE_SUPPORTED_56000baseKR4_Full */ + +-#ifdef SUPPORTED_56000baseCR4_Full ++#ifndef HAVE_SUPPORTED_56000baseCR4_Full + #define HAVE_SUPPORTED_56000baseCR4_Full 1 +-#endif ++#endif /* HAVE_SUPPORTED_56000baseCR4_Full */ + +-#ifdef SUPPORTED_56000baseSR4_Full ++#ifndef HAVE_SUPPORTED_56000baseSR4_Full + #define HAVE_SUPPORTED_56000baseSR4_Full 1 +-#endif ++#endif /* HAVE_SUPPORTED_56000baseSR4_Full */ + +-#ifdef SUPPORTED_56000baseLR4_Full ++#ifndef HAVE_SUPPORTED_56000baseLR4_Full + #define HAVE_SUPPORTED_56000baseLR4_Full 1 +-#endif ++#endif /* HAVE_SUPPORTED_56000baseLR4_Full */ + ++#ifndef HAVE_STATIC_ASSERT ++#define HAVE_STATIC_ASSERT 1 ++#endif /* HAVE_STATIC_ASSERT */ + +diff --git a/src/dpdk/drivers/net/tap/rte_eth_tap.c b/src/dpdk/drivers/net/tap/rte_eth_tap.c +index bc889c19..47a2b68f 100644 +--- a/src/dpdk/drivers/net/tap/rte_eth_tap.c ++++ b/src/dpdk/drivers/net/tap/rte_eth_tap.c +@@ -34,8 +34,8 @@ + #include <unistd.h> + #include <arpa/inet.h> + #include <net/if.h> +-#include <linux_tap/if_tun.h> +-#include <linux_tap/if_ether.h> ++#include <linux/if_tun.h> ++#include <linux/if_ether.h> + #include <fcntl.h> + #include <ctype.h> + +diff --git a/src/dpdk/drivers/net/tap/rte_eth_tap.h b/src/dpdk/drivers/net/tap/rte_eth_tap.h +index 66cd3441..dc3579ac 100644 +--- a/src/dpdk/drivers/net/tap/rte_eth_tap.h ++++ b/src/dpdk/drivers/net/tap/rte_eth_tap.h +@@ -11,7 +11,7 @@ + #include <inttypes.h> + #include <net/if.h> + +-#include <linux_tap/if_tun.h> ++#include <linux/if_tun.h> + + #include <rte_ethdev_driver.h> + #include <rte_ether.h> +diff --git a/src/dpdk/drivers/net/tap/tap_autoconf.h b/src/dpdk/drivers/net/tap/tap_autoconf.h +index dddd4ae6..d5880608 100644 +--- a/src/dpdk/drivers/net/tap/tap_autoconf.h ++++ b/src/dpdk/drivers/net/tap/tap_autoconf.h +@@ -1,14 +1,24 @@ + #ifndef HAVE_TC_FLOWER + #define HAVE_TC_FLOWER 1 +-#endif ++#endif /* HAVE_TC_FLOWER */ + ++#ifndef HAVE_TC_VLAN_ID ++#define HAVE_TC_VLAN_ID 1 ++#endif /* HAVE_TC_VLAN_ID */ + + #ifndef HAVE_TC_BPF + #define HAVE_TC_BPF 1 +-#endif ++#endif /* HAVE_TC_BPF */ + +-#ifndef HAVE_TC_VLAN_ID +-#define HAVE_TC_VLAN_ID 1 +-#endif ++#ifndef HAVE_TC_BPF_FD ++#define HAVE_TC_BPF_FD 1 ++#endif /* HAVE_TC_BPF_FD */ ++ ++#ifndef HAVE_TC_ACT_BPF ++#define HAVE_TC_ACT_BPF 1 ++#endif /* HAVE_TC_ACT_BPF */ + ++#ifndef HAVE_TC_ACT_BPF_FD ++#define HAVE_TC_ACT_BPF_FD 1 ++#endif /* HAVE_TC_ACT_BPF_FD */ + +diff --git a/src/dpdk/drivers/net/tap/tap_netlink.h b/src/dpdk/drivers/net/tap/tap_netlink.h +index 900ce375..faa73ba1 100644 +--- a/src/dpdk/drivers/net/tap/tap_netlink.h ++++ b/src/dpdk/drivers/net/tap/tap_netlink.h +@@ -8,8 +8,8 @@ + + #include <ctype.h> + #include <inttypes.h> +-#include <linux_tap/rtnetlink.h> +-#include <linux_tap/netlink.h> ++#include <linux/rtnetlink.h> ++#include <linux/netlink.h> + #include <stdio.h> + + #include <rte_log.h> +diff --git a/src/dpdk/drivers/net/tap/tap_tcmsgs.h b/src/dpdk/drivers/net/tap/tap_tcmsgs.h +index 782de540..8cedea84 100644 +--- a/src/dpdk/drivers/net/tap/tap_tcmsgs.h ++++ b/src/dpdk/drivers/net/tap/tap_tcmsgs.h +@@ -7,13 +7,13 @@ + #define _TAP_TCMSGS_H_ + + #include <tap_autoconf.h> +-#include <linux_tap/if_ether.h> +-#include <linux_tap/rtnetlink.h> +-#include <linux_tap/pkt_sched.h> +-#include <linux_tap/pkt_cls.h> +-#include <linux_tap/tc_act/tc_mirred.h> +-#include <linux_tap/tc_act/tc_gact.h> +-#include <linux_tap/tc_act/tc_skbedit.h> ++#include <linux/if_ether.h> ++#include <linux/rtnetlink.h> ++#include <linux/pkt_sched.h> ++#include <linux/pkt_cls.h> ++#include <linux/tc_act/tc_mirred.h> ++#include <linux/tc_act/tc_gact.h> ++#include <linux/tc_act/tc_skbedit.h> + #ifdef HAVE_TC_ACT_BPF + #include <linux/tc_act/tc_bpf.h> + #endif diff --git a/resources/tools/testbed-setup/ansible/roles/trex/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/trex/tasks/main.yaml new file mode 100644 index 0000000000..11f51ddeac --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/trex/tasks/main.yaml @@ -0,0 +1,60 @@ +--- +# file: roles/trex/tasks/main.yaml + +- name: T-Rex Install - Install Distribution - Release - Machine Prerequisites + package: + name: "{{ packages | flatten(levels=1) }}" + state: latest + update_cache: true + tags: + - install-dependencies + +- name: T-Rex Install - Get Release Archive + get_url: + url: "https://github.com/cisco-system-traffic-generator/trex-core/archive/v{{ trex_version }}.tar.gz" + dest: "{{ trex_target_dir }}/trex-core-{{ trex_version }}.tar.gz" + mode: 0644 + register: trex_downloaded + tags: + - install-trex + +- name: T-Rex Install - Ensure Directory Exists + file: + path: "{{ trex_target_dir }}/trex-core-{{ trex_version }}" + state: "directory" + register: trex_dir_created + tags: + - install-trex + +- name: T-Rex Install - Extract Release Archive + unarchive: + remote_src: true + src: "{{ trex_target_dir }}/trex-core-{{ trex_version }}.tar.gz" + dest: "{{ trex_target_dir }}/" + creates: "{{ trex_target_dir }}/trex-core-{{ trex_version }}/linux_dpdk/" + when: trex_dir_created + register: trex_extracted + tags: + - install-trex + +- name: T-Rex Install - Azure patch I + patch: + src: "files/t-rex.patch" + basedir: "{{ trex_target_dir }}/trex-core-{{ trex_version }}" + strip: 1 + when: + - azure is defined + tags: + - install-trex + +- name: T-Rex Install - Compile Release I + raw: "cd {{ trex_target_dir }}/trex-core-{{ trex_version }}/linux_dpdk/; ./b configure; ./b build" + when: trex_extracted + tags: + - install-trex + +- name: T-Rex Install - Compile Release II + raw: "cd {{ trex_target_dir }}/trex-core-{{ trex_version }}/scripts/ko/src; make; make install" + when: trex_extracted + tags: + - install-trex diff --git a/resources/tools/testbed-setup/ansible/roles/vexx_hosts/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/vexx_hosts/defaults/main.yaml new file mode 100644 index 0000000000..37b48f81c2 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/vexx_hosts/defaults/main.yaml @@ -0,0 +1,19 @@ +--- +# file: roles/vexx_hosts/defaults/main.yaml + +# provision via cobbler +provision_enabled: False +# name_servers is used in /etc/netplan/01-netcfg.yaml +name_servers: "1.1.1.1, 8.8.8.8" + +# Proxy settings: Uncomment and fill the proper values. These variables will be +# set globally by writing into /etc/environment file on target machine. +#proxy_env: +# http_proxy: http://proxy.com:80 +# HTTP_PROXY: http://proxy.com:80 +# https_proxy: http://proxy.com:80 +# HTTPS_PROXY: http://proxy.com:80 +# ftp_proxy: http://proxy.com:80 +# FTP_PROXY: http://proxy.com:80 +# no_proxy: localhost,127.0.0.1,{{ ansible_default_ipv4.address }} +# NO_PROXY: localhost,127.0.0.1,{{ ansible_default_ipv4.address }} diff --git a/resources/tools/testbed-setup/ansible/roles/common/handlers/cimc.yaml b/resources/tools/testbed-setup/ansible/roles/vexx_hosts/handlers/cimc.yaml index e31d712d4d..65f0c83f87 100644 --- a/resources/tools/testbed-setup/ansible/roles/common/handlers/cimc.yaml +++ b/resources/tools/testbed-setup/ansible/roles/vexx_hosts/handlers/cimc.yaml @@ -1,11 +1,11 @@ --- -# file: roles/common/handlers/cimc.yaml +# file: roles/vexx_hosts/handlers/cimc.yaml - name: Boot from network imc_rest: - hostname: '{{ inventory_cimc_hostname }}' - username: '{{ inventory_cimc_username }}' - password: '{{ inventory_cimc_password }}' + hostname: "{{ inventory_cimc_hostname }}" + username: "{{ inventory_cimc_username }}" + password: "{{ inventory_cimc_password }}" validate_certs: no content: | <!-- Configure PXE boot --> @@ -13,52 +13,56 @@ <lsbootLan dn="sys/rack-unit-1/boot-policy/lan-read-only" access="read-only" order="1" prot="pxe" type="lan"/> </inConfig></configConfMo> delegate_to: localhost - tags: boot-network + tags: + - boot-network - name: Boot from storage imc_rest: - hostname: '{{ inventory_cimc_hostname }}' - username: '{{ inventory_cimc_username }}' - password: '{{ inventory_cimc_password }}' + hostname: "{{ inventory_cimc_hostname }}" + username: "{{ inventory_cimc_username }}" + password: "{{ inventory_cimc_password }}" validate_certs: no content: | <configConfMo><inConfig> <lsbootStorage dn="sys/rack-unit-1/boot-policy/storage-read-write" access="read-write" order="1" type="storage"/> </inConfig></configConfMo> delegate_to: localhost - tags: boot-storage + tags: + - boot-storage - name: Power up server imc_rest: - hostname: '{{ inventory_cimc_hostname }}' - username: '{{ inventory_cimc_username }}' - password: '{{ inventory_cimc_password }}' + hostname: "{{ inventory_cimc_hostname }}" + username: "{{ inventory_cimc_username }}" + password: "{{ inventory_cimc_password }}" validate_certs: no content: | <configConfMo><inConfig> <computeRackUnit dn="sys/rack-unit-1" adminPower="up"/> </inConfig></configConfMo> delegate_to: localhost - tags: power-up + tags: + - power-up - name: Power down server imc_rest: - hostname: '{{ inventory_cimc_hostname }}' - username: '{{ inventory_cimc_username }}' - password: '{{ inventory_cimc_password }}' + hostname: "{{ inventory_cimc_hostname }}" + username: "{{ inventory_cimc_username }}" + password: "{{ inventory_cimc_password }}" validate_certs: no content: | <configConfMo><inConfig> <computeRackUnit dn="sys/rack-unit-1" adminPower="down"/> </inConfig></configConfMo> delegate_to: localhost - tags: power-down + tags: + - power-down - name: Power cycle server imc_rest: - hostname: '{{ inventory_cimc_hostname }}' - username: '{{ inventory_cimc_username }}' - password: '{{ inventory_cimc_password }}' + hostname: "{{ inventory_cimc_hostname }}" + username: "{{ inventory_cimc_username }}" + password: "{{ inventory_cimc_password }}" validate_certs: no content: | <!-- Power cycle server --> @@ -66,4 +70,5 @@ <computeRackUnit dn="sys/rack-unit-1" adminPower="cycle-immediate"/> </inConfig></configConfMo> delegate_to: localhost - tags: power-cycle + tags: + - power-cycle diff --git a/resources/tools/testbed-setup/ansible/roles/vexx_hosts/handlers/ipmi.yaml b/resources/tools/testbed-setup/ansible/roles/vexx_hosts/handlers/ipmi.yaml new file mode 100644 index 0000000000..549454a1a2 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/vexx_hosts/handlers/ipmi.yaml @@ -0,0 +1,52 @@ +--- +# file: roles/vexx_hosts/handlers/ipmi.yaml + +- name: Boot from network + ipmi_boot: + name: "{{ inventory_ipmi_hostname }}" + user: "{{ inventory_ipmi_username }}" + password: "{{ inventory_ipmi_password }}" + bootdev: network + delegate_to: localhost + tags: + - boot-network + +- name: Boot from storage + ipmi_boot: + name: "{{ inventory_ipmi_hostname }}" + user: "{{ inventory_ipmi_username }}" + password: "{{ inventory_ipmi_password }}" + bootdev: hd + delegate_to: localhost + tags: + - boot-storage + +- name: Power up server + ipmi_power: + name: "{{ inventory_ipmi_hostname }}" + user: "{{ inventory_ipmi_username }}" + password: "{{ inventory_ipmi_password }}" + state: on + delegate_to: localhost + tags: + - power-up + +- name: Power down server + ipmi_power: + name: "{{ inventory_ipmi_hostname }}" + user: "{{ inventory_ipmi_username }}" + password: "{{ inventory_ipmi_password }}" + state: off + delegate_to: localhost + tags: + - power-down + +- name: Power cycle server + ipmi_power: + name: "{{ inventory_ipmi_hostname }}" + user: "{{ inventory_ipmi_username }}" + password: "{{ inventory_ipmi_password }}" + state: boot + delegate_to: localhost + tags: + - power-cycle diff --git a/resources/tools/testbed-setup/ansible/roles/vexx_hosts/handlers/main.yaml b/resources/tools/testbed-setup/ansible/roles/vexx_hosts/handlers/main.yaml new file mode 100644 index 0000000000..bd52fdc9a9 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/vexx_hosts/handlers/main.yaml @@ -0,0 +1,30 @@ +--- +# file: roles/vexx_hosts/handlers/main.yaml + +- name: IPMI specific + import_tasks: ipmi.yaml + when: inventory_ipmi_hostname is defined + tags: + - ipmi-handlers + +- name: CIMC specific + import_tasks: cimc.yaml + when: inventory_cimc_hostname is defined + tags: + - cimc-handlers + +- name: Reboot server + reboot: + reboot_timeout: 3600 + tags: + - reboot-server + +- name: Wait for server to restart + wait_for: + host: "{{ inventory_hostname }}" + search_regex: OpenSSH + port: 22 + delay: 60 + timeout: 3600 + tags: + - reboot-server diff --git a/resources/tools/testbed-setup/ansible/roles/vexx_hosts/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/vexx_hosts/tasks/main.yaml new file mode 100644 index 0000000000..a8aa57323b --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/vexx_hosts/tasks/main.yaml @@ -0,0 +1,61 @@ +--- +# file: roles/vexx_hosts/tasks/main.yaml + +- name: Ensure the system exists in Cobbler + cobbler_system: + host: "{{ cobbler_hostname }}" + port: 60080 + interfaces: + br1: + ipaddress: "{{ ansible_default_ipv4.address }}" + macaddress: "{{ ansible_default_ipv4.macaddress }}" + name: "{{ hostname }}" + password: "{{ cobbler_password }}" + properties: + hostname: "{{ hostname }}" + gateway: "{{ ansible_default_ipv4.gateway }}" + profile: "{{ cobbler_profile }}" + name_servers: "{{ name_servers }}" + name_servers_search: "{{ name_servers_search }}" + kickstart: "/var/lib/cobbler/kickstarts/{{ cobbler_profile }}.seed" + kernel_options: '"interface={{ ansible_default_ipv4.interface }}"' + netboot_enabled: yes + username: "{{ cobbler_username }}" + use_ssl: no + validate_certs: no + when: provision_enabled + delegate_to: localhost + tags: + - cobbler-include + +- name: Commit Cobbler changes + cobbler_sync: + host: "{{ cobbler_hostname }}" + port: 60080 + password: "{{ cobbler_password }}" + username: "{{ cobbler_username }}" + use_ssl: no + validate_certs: no + run_once: yes + when: provision_enabled + delegate_to: localhost + register: __included_in_cobbler + notify: + - "Boot from network" + - "Reboot server" + tags: + - cobbler-include + +- meta: flush_handlers + +- name: Copy netplan network config file + template: + src: "files/netplan_config" + dest: "/etc/netplan/01-netcfg.yaml" + owner: "root" + group: "root" + mode: "0644" + tags: + - copy-interface-file + +- meta: flush_handlers diff --git a/resources/tools/testbed-setup/ansible/roles/vpp_device/handlers/main.yaml b/resources/tools/testbed-setup/ansible/roles/vpp_device/handlers/main.yaml index 7b53dda7ab..ee9d368638 100644 --- a/resources/tools/testbed-setup/ansible/roles/vpp_device/handlers/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/vpp_device/handlers/main.yaml @@ -6,22 +6,16 @@ enabled: yes state: started name: csit-initialize-vfs.service - tags: start-vf-service + tags: + - start-vf-service - name: Update GRUB command: update-grub - tags: update-grub + tags: + - update-grub - name: Reboot server reboot: reboot_timeout: 3600 - tags: reboot-server - -- name: Wait for server to restart - wait_for: - host: '{{ inventory_hostname }}' - search_regex: OpenSSH - port: 22 - delay: 60 - timeout: 3600 - tags: reboot-server + tags: + - reboot-server diff --git a/resources/tools/testbed-setup/ansible/roles/vpp_device/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/vpp_device/tasks/main.yaml index 46ca1d746b..6180300d74 100644 --- a/resources/tools/testbed-setup/ansible/roles/vpp_device/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/vpp_device/tasks/main.yaml @@ -1,68 +1,72 @@ --- # file: roles/vpp_device/tasks/main.yaml -- name: Load vfio-pci by default +- name: VPP_device - Load Kernel Modules By Default lineinfile: - path: '/etc/modules' - state: 'present' - line: 'vfio-pci' - tags: load-vfio-pci + path: "/etc/modules" + state: "present" + line: "{{ item }}" + with_items: + - "vfio-pci" + tags: + - load-kernel-modules -- name: Copy csit-initialize-vfs.sh +- name: VPP_device - Copy csit-initialize-vfs.sh copy: - src: 'files/csit-initialize-vfs.sh' - dest: '/usr/local/bin/' - owner: 'root' - group: 'root' - mode: '744' - tags: copy-vf-script + src: "files/csit-initialize-vfs.sh" + dest: "/usr/local/bin/" + owner: "root" + group: "root" + mode: "744" + tags: + - copy-vf-script -- name: Copy csit-initialize-vfs-data.sh +- name: VPP_device - Copy csit-initialize-vfs-data.sh copy: - src: 'files/{{ vfs_data_file }}' - dest: '/usr/local/bin/csit-initialize-vfs-data.sh' - owner: 'root' - group: 'root' - mode: '744' + src: "files/{{ vfs_data_file }}" + dest: "/usr/local/bin/csit-initialize-vfs-data.sh" + owner: "root" + group: "root" + mode: "744" tags: copy-vf-data-script - when: vfs_data_file is defined + when: + - vfs_data_file is defined -- name: Copy default csit-initialize-vfs-data.sh +- name: VPP_device - Copy default csit-initialize-vfs-data.sh copy: - src: 'files/csit-initialize-vfs-default.sh' - dest: '/usr/local/bin/csit-initialize-vfs-data.sh' - owner: 'root' - group: 'root' - mode: '744' + src: "files/csit-initialize-vfs-default.sh" + dest: "/usr/local/bin/csit-initialize-vfs-data.sh" + owner: "root" + group: "root" + mode: "744" tags: copy-vf-data-script - when: vfs_data_file is not defined + when: + - vfs_data_file is not defined -- name: Start csit-initialize-vfs.service +- name: VPP_device - Start csit-initialize-vfs.service copy: - src: 'files/csit-initialize-vfs.service' - dest: '/etc/systemd/system/' - owner: 'root' - group: 'root' - mode: '644' + src: "files/csit-initialize-vfs.service" + dest: "/etc/systemd/system/" + owner: "root" + group: "root" + mode: "644" notify: - - 'Start csit-initialize-vfs.service' - tags: start-vf-service + - "Start csit-initialize-vfs.service" + tags: + - start-vf-service - meta: flush_handlers -- name: Set hugepages in GRUB +- name: VPP_device - Set hugepages in GRUB lineinfile: - path: '/etc/default/grub' - state: 'present' - regexp: '^GRUB_CMDLINE_LINUX=' + path: "/etc/default/grub" + state: "present" + regexp: "^GRUB_CMDLINE_LINUX=" line: 'GRUB_CMDLINE_LINUX="hugepagesz=2M hugepages={{ grub.nr_hugepages }}"' notify: - - 'Update GRUB' - - 'Reboot server' - tags: set-grub + - "Update GRUB" + - "Reboot server" + tags: + - set-grub - meta: flush_handlers - -- name: Kernel VM install - include_tasks: '../../common/tasks/kernel_install.yaml' - tags: install-kernel-image diff --git a/resources/tools/testbed-setup/ansible/roles/wrk/defaults/main.yaml b/resources/tools/testbed-setup/ansible/roles/wrk/defaults/main.yaml new file mode 100644 index 0000000000..d40ea6a9ce --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/wrk/defaults/main.yaml @@ -0,0 +1,20 @@ +--- +# file: roles/wrk/defaults/main.yaml + +packages: "{{ packages_base + packages_by_distro[ansible_distribution | lower] + packages_by_arch[ansible_machine] }}" + +packages_base: + - [] + +packages_by_distro: + ubuntu: + - "build-essential" + +packages_by_arch: + aarch64: + - [] + x86_64: + - [] + +wrk_target_dir: "/opt" +wrk_version: "4.0.2" diff --git a/resources/tools/testbed-setup/ansible/roles/wrk/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/wrk/tasks/main.yaml new file mode 100644 index 0000000000..d8d06145db --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/wrk/tasks/main.yaml @@ -0,0 +1,53 @@ +--- +# file: roles/wrk/tasks/main.yaml + +- name: WRK Install - Install Distribution - Release - Machine Prerequisites + package: + name: "{{ packages | flatten(levels=1) }}" + state: latest + update_cache: true + tags: + - install-dependencies + +- name: WRK Install - Get Release Archive + get_url: + url: "https://github.com/wg/wrk/archive/{{ wrk_version }}.tar.gz" + dest: "{{ wrk_target_dir }}/{{ wrk_version }}.tar.gz" + mode: 0644 + register: wrk_downloaded + tags: + - install-wrk + +- name: WRK Install - Ensure Directory Exists + file: + path: "{{ wrk_target_dir }}/wrk-{{ wrk_version }}" + state: "directory" + register: wrk_dir_created + tags: + - install-wrk + +- name: WRK Install - Extract Release Archive + unarchive: + remote_src: true + src: "{{ wrk_target_dir }}/{{ wrk_version }}.tar.gz" + dest: "{{ wrk_target_dir }}/" + creates: "{{ wrk_target_dir }}/wrk-{{ wrk_version }}/src" + when: wrk_dir_created + register: wrk_extracted + tags: + - install-wrk + +- name: WRK Install - Compile Release + command: "make" + args: + chdir: "{{ wrk_target_dir }}/wrk-{{ wrk_version }}" + when: wrk_extracted + register: wrk_compiled + tags: + - install-wrk + +- name: WRK Install - Move Binary + command: "mv {{ wrk_target_dir }}/wrk-{{ wrk_version }}/wrk /usr/local/bin/" + when: wrk_compiled + tags: + - install-wrk |