From ab596c32fdda48aa8140f428710b98d47baf9cae Mon Sep 17 00:00:00 2001 From: Stanislav Chlebec Date: Wed, 16 Jan 2019 15:42:36 +0100 Subject: Ansible testbed setup for Taishan testbed Change-Id: I4b42aa5bf7635ade95f81c0c92a6ff1bf43d3fa0 Signed-off-by: Stanislav Chlebec Signed-off-by: juraj.linkes --- .../roles/sut/files/taishan_workaround.service | 11 +++ .../ansible/roles/sut/tasks/main.yaml | 8 +- .../roles/sut/tasks/taishan_workaround.yaml | 30 ++++++ .../ansible/roles/sut/tasks/ubuntu.yaml | 106 +++++++++++++++++++++ .../ansible/roles/sut/tasks/ubuntu_x86_64.yaml | 106 --------------------- 5 files changed, 153 insertions(+), 108 deletions(-) create mode 100644 resources/tools/testbed-setup/ansible/roles/sut/files/taishan_workaround.service create mode 100644 resources/tools/testbed-setup/ansible/roles/sut/tasks/taishan_workaround.yaml create mode 100644 resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu.yaml delete mode 100644 resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_x86_64.yaml (limited to 'resources/tools/testbed-setup/ansible/roles/sut') diff --git a/resources/tools/testbed-setup/ansible/roles/sut/files/taishan_workaround.service b/resources/tools/testbed-setup/ansible/roles/sut/files/taishan_workaround.service new file mode 100644 index 0000000000..05f865f407 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/sut/files/taishan_workaround.service @@ -0,0 +1,11 @@ +[Unit] +Description=Numa node workaround configuration + +[Service] +ExecStart=/bin/sh -c 'echo 1 > /sys/bus/pci/devices/000a:11:00.0/numa_node' +ExecStart=/bin/sh -c 'echo 1 > /sys/bus/pci/devices/000a:11:00.1/numa_node' +Type=oneshot +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target \ No newline at end of file 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 0ecdcdba3b..f5a2dd86ad 100644 --- a/resources/tools/testbed-setup/ansible/roles/sut/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/sut/tasks/main.yaml @@ -2,8 +2,12 @@ # file: roles/sut/tasks/main.yaml - name: Ubuntu specific - import_tasks: ubuntu_x86_64.yaml - when: ansible_distribution|lower == 'ubuntu' and ansible_machine == 'x86_64' + import_tasks: ubuntu.yaml + when: ansible_distribution|lower == 'ubuntu' + +- name: Taishan aarch64 specific + import_tasks: taishan_workaround.yaml + when: taishan_workaround is defined - name: Copy 80-vpp.conf file: diff --git a/resources/tools/testbed-setup/ansible/roles/sut/tasks/taishan_workaround.yaml b/resources/tools/testbed-setup/ansible/roles/sut/tasks/taishan_workaround.yaml new file mode 100644 index 0000000000..e262e7288b --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/sut/tasks/taishan_workaround.yaml @@ -0,0 +1,30 @@ +--- +# file: roles/sut/tasks/taishan_workaround.yaml + +- name: Ensure systemd directory exists + file: + path: "/etc/systemd/system" + state: "directory" + owner: "root" + group: "root" + mode: "0755" + tags: taishan-workaround + +- name: Copy systemd numa config unit file + template: + src: "files/taishan_workaround.service" + dest: "/etc/systemd/system/nic-numa-config.service" + owner: "root" + group: "root" + mode: "0644" + register: numa_config_service + tags: taishan-workaround + +- name: Reload systemd daemon + command: "systemctl daemon-reload" + when: (numa_config_service and numa_config_service is changed) + tags: taishan-workaround + +- name: Enable numa config service + command: "systemctl enable nic-numa-config.service" + tags: taishan-workaround diff --git a/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu.yaml b/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu.yaml new file mode 100644 index 0000000000..824f0926b5 --- /dev/null +++ b/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu.yaml @@ -0,0 +1,106 @@ +--- +# file: roles/sut/tasks/ubuntu.yaml + +- name: Install DKMS + apt: + name: 'dkms' + state: 'present' + update_cache: True + become: yes + tags: install-dkms + +- name: Install pkg-config + apt: + name: 'pkg-config' + state: 'present' + update_cache: True + become: yes + tags: install-pkg-config + +- name: Install libglib2.0-dev + apt: + name: 'libglib2.0-dev' + state: 'present' + update_cache: True + become: yes + tags: install-libglib2.0-dev + +- name: Install autoconf + apt: + name: 'autoconf' + state: 'present' + update_cache: True + become: yes + tags: install-autoconf + +- name: Install libtool + apt: + name: 'libtool' + state: 'present' + update_cache: True + become: yes + tags: install-libtool + +- name: Install screen + apt: + name: 'screen' + state: 'present' + update_cache: True + become: yes + tags: install-screen + +- name: Install libmbedcrypto1 + apt: + name: 'libmbedcrypto1' + state: 'present' + update_cache: True + become: yes + tags: install-libmbedcrypto1 + +- name: Install libmbedtls10 + apt: + name: 'libmbedtls10' + state: 'present' + update_cache: True + become: yes + tags: install-libmbedtls10 + +- name: Install libmbedx509-0 + apt: + name: 'libmbedx509-0' + state: 'present' + update_cache: True + become: yes + tags: install-libmbedx509-0 + +- name: Install lxc + apt: + name: 'lxc' + state: 'present' + update_cache: True + become: yes + tags: install-lxc + +- name: Install java + apt: + name: 'openjdk-8-jdk' + state: 'present' + update_cache: True + become: yes + tags: install-java + +- name: Install Pixman (Qemu-dep) + apt: + name: 'libpixman-1-dev' + state: 'present' + update_cache: True + become: yes + tags: install-pixman + +- name: Install python-cffi + apt: + name: 'python-cffi' + state: 'present' + update_cache: True + become: yes + tags: install-python-cffi diff --git a/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_x86_64.yaml b/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_x86_64.yaml deleted file mode 100644 index 38946b6bbb..0000000000 --- a/resources/tools/testbed-setup/ansible/roles/sut/tasks/ubuntu_x86_64.yaml +++ /dev/null @@ -1,106 +0,0 @@ ---- -# file: roles/sut/tasks/ubuntu_x86_64.yaml - -- name: Install DKMS - apt: - name: 'dkms' - state: 'present' - update_cache: True - become: yes - tags: install-dkms - -- name: Install pkg-config - apt: - name: 'pkg-config' - state: 'present' - update_cache: True - become: yes - tags: install-pkg-config - -- name: Install libglib2.0-dev - apt: - name: 'libglib2.0-dev' - state: 'present' - update_cache: True - become: yes - tags: install-libglib2.0-dev - -- name: Install autoconf - apt: - name: 'autoconf' - state: 'present' - update_cache: True - become: yes - tags: install-autoconf - -- name: Install libtool - apt: - name: 'libtool' - state: 'present' - update_cache: True - become: yes - tags: install-libtool - -- name: Install screen - apt: - name: 'screen' - state: 'present' - update_cache: True - become: yes - tags: install-screen - -- name: Install libmbedcrypto1 - apt: - name: 'libmbedcrypto1' - state: 'present' - update_cache: True - become: yes - tags: install-libmbedcrypto1 - -- name: Install libmbedtls10 - apt: - name: 'libmbedtls10' - state: 'present' - update_cache: True - become: yes - tags: install-libmbedtls10 - -- name: Install libmbedx509-0 - apt: - name: 'libmbedx509-0' - state: 'present' - update_cache: True - become: yes - tags: install-libmbedx509-0 - -- name: Install lxc - apt: - name: 'lxc' - state: 'present' - update_cache: True - become: yes - tags: install-lxc - -- name: Install java - apt: - name: 'openjdk-8-jdk' - state: 'present' - update_cache: True - become: yes - tags: install-java - -- name: Install Pixman (Qemu-dep) - apt: - name: 'libpixman-1-dev' - state: 'present' - update_cache: True - become: yes - tags: install-pixman - -- name: Install python-cffi - apt: - name: 'python-cffi' - state: 'present' - update_cache: True - become: yes - tags: install-python-cffi -- cgit 1.2.3-korg