aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks
diff options
context:
space:
mode:
authorStanislav Chlebec <stanislav.chlebec@pantheon.tech>2019-01-16 15:42:36 +0100
committerPeter Mikus <pmikus@cisco.com>2019-02-19 15:44:25 +0000
commitab596c32fdda48aa8140f428710b98d47baf9cae (patch)
tree103093102eb82f40a583643067dcadf114e5e369 /resources/tools/testbed-setup/ansible/roles/tg_sut/tasks
parentd1589ad74e515757fb12cf8a5f976282924afe13 (diff)
Ansible testbed setup for Taishan testbed
Change-Id: I4b42aa5bf7635ade95f81c0c92a6ff1bf43d3fa0 Signed-off-by: Stanislav Chlebec <stanislav.chlebec@pantheon.tech> Signed-off-by: juraj.linkes <juraj.linkes@pantheon.tech>
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles/tg_sut/tasks')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/aarch64.yaml12
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml59
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/skylake.yaml17
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu.yaml (renamed from resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu_x86_64.yaml)26
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/x86_64.yaml18
5 files changed, 74 insertions, 58 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/aarch64.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/aarch64.yaml
new file mode 100644
index 0000000000..afaf5cd06b
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/aarch64.yaml
@@ -0,0 +1,12 @@
+---
+# file: roles/tg_sut/tasks/aarch64.yaml
+
+- name: Configure aarch64 kernel parameters
+ lineinfile:
+ path: '/etc/default/grub'
+ state: 'present'
+ regexp: '^GRUB_CMDLINE_LINUX='
+ line: 'GRUB_CMDLINE_LINUX="isolcpus={{ isolcpus }} nohz_full={{ isolcpus }} rcu_nocbs={{ isolcpus }} 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/tg_sut/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml
index ea779c07da..e5da2fc72d 100644
--- a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml
@@ -2,19 +2,31 @@
# file: roles/tg_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: Copy interfaces file
+- name: x86 specific
+ import_tasks: x86_64.yaml
+ when: ansible_machine == 'x86_64'
+
+- name: skylake specific
+ import_tasks: skylake.yaml
+ when: ("skylake" in groups) and inventory_hostname in groups['skylake']
+
+- name: aarch specific
+ import_tasks: aarch64.yaml
+ when: ansible_machine == 'aarch64'
+
+- name: Copy netplan network config file
template:
- src: 'files/interfaces_physical'
- dest: '/etc/network/interfaces'
+ src: 'files/netplan_config'
+ dest: '/etc/netplan/01-netcfg.yaml'
owner: 'root'
group: 'root'
mode: '0644'
tags: copy-interface-file
-- name: Copy sysctl file
+- name: Copy CSIT sysctl file
template:
src: 'files/90-csit'
dest: '/etc/sysctl.d/90-csit.conf'
@@ -47,15 +59,6 @@
dest: '/tmp/requirements.txt'
tags: copy-pip
-- name: Set isolcpus and pstate parameter
- lineinfile:
- path: '/etc/default/grub'
- state: 'present'
- regexp: '^GRUB_CMDLINE_LINUX='
- line: 'GRUB_CMDLINE_LINUX="isolcpus={{ isolcpus }} nohz_full={{ isolcpus }} rcu_nocbs={{ isolcpus }} 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']
- tags: set-grub
-
- name: Set ondemand service to disable
service:
name: 'ondemand'
@@ -73,29 +76,3 @@
state: 'present'
line: 'vfio-pci'
tags: load-vfio-pci
-
-- name: Load msr by default
- lineinfile:
- path: '/etc/modules'
- state: 'present'
- line: 'msr'
- tags: disable-turbo-boost
-
-- name: Disable Turbo-Boost by service
- copy:
- src: 'files/disable-turbo-boost.service'
- dest: '/etc/systemd/system/disable-turbo-boost.service'
- owner: 'root'
- group: 'root'
- mode: '0644'
- when: >
- inventory_hostname in groups['skylake']
- tags: disable-turbo-boost
-
-- name: Disable Turbo-Boost by service on startup
- service:
- name: disable-turbo-boost
- enabled: yes
- when: >
- inventory_hostname in groups['skylake']
- tags: disable-turbo-boost
diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/skylake.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/skylake.yaml
new file mode 100644
index 0000000000..03b4714d3e
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/skylake.yaml
@@ -0,0 +1,17 @@
+---
+# file: roles/tg_sut/tasks/skylake.yaml
+
+- name: Disable Skylake Turbo-Boost by service
+ copy:
+ src: 'files/disable-turbo-boost.service'
+ dest: '/etc/systemd/system/disable-turbo-boost.service'
+ owner: 'root'
+ group: 'root'
+ mode: '0644'
+ tags: disable-turbo-boost
+
+- name: Disable Skylake Turbo-Boost by service on startup
+ service:
+ name: disable-turbo-boost
+ enabled: yes
+ tags: disable-turbo-boost
diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu_x86_64.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu.yaml
index 76af5be7fd..8604185aa2 100644
--- a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu_x86_64.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/ubuntu.yaml
@@ -1,5 +1,5 @@
---
-# file: roles/tg_sut/tasks/ubuntu_x86_64.yaml
+# file: roles/tg_sut/tasks/ubuntu.yaml
- name: Install python-dev
apt:
@@ -69,17 +69,13 @@
- "cron"
tags: install-docker
-- name: Install upstream APT GPG key
+- name: Install Docker APT GPG key
apt_key:
- id: "{{ docker_apt_key }}"
- keyserver: "{{ ansible_local.core.keyserver
- if (ansible_local|d() and ansible_local.core|d() and
- ansible_local.core.keyserver)
- else 'hkp://pool.sks-keyservers.net' }}"
+ url: https://download.docker.com/linux/ubuntu/gpg
state: "present"
tags: install-docker
-- name: Install upstream APT repository
+- name: Install Docker APT repository
apt_repository:
repo: "{{ docker_repository }}"
state: "present"
@@ -95,7 +91,7 @@
cache_valid_time: "{{ apt_cache_time }}"
tags: install-docker
-- name: Remove Upstart config file
+- name: Remove Upstart docker config file
file:
path: "/etc/default/docker"
state: "absent"
@@ -110,7 +106,7 @@
mode: "0755"
tags: ensure-docker
-- name: Copy systemd unit file
+- name: Copy systemd docker unit file
template:
src: "templates/docker.service.j2"
dest: "/etc/systemd/system/docker.service"
@@ -136,17 +132,13 @@
when: docker_users
tags: set-docker
-- name: Install upstream APT GPG key
+- name: Install kubernetes APT GPG key
apt_key:
- id: "{{ kubernetes_apt_key }}"
- keyserver: "{{ ansible_local.core.keyserver
- if (ansible_local|d() and ansible_local.core|d() and
- ansible_local.core.keyserver)
- else 'hkp://pool.sks-keyservers.net' }}"
+ url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
state: "present"
tags: install-kubernetes
-- name: Install upstream APT repository
+- name: Install kubernetes APT repository
apt_repository:
repo: "{{ kubernetes_repository }}"
state: "present"
diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/x86_64.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/x86_64.yaml
new file mode 100644
index 0000000000..5c7110e289
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/x86_64.yaml
@@ -0,0 +1,18 @@
+---
+# file: roles/tg_sut/tasks/x86_64.yaml
+
+- name: Configure x86_64 kernel parameters
+ lineinfile:
+ path: '/etc/default/grub'
+ state: 'present'
+ regexp: '^GRUB_CMDLINE_LINUX='
+ line: 'GRUB_CMDLINE_LINUX="isolcpus={{ isolcpus }} nohz_full={{ isolcpus }} rcu_nocbs={{ isolcpus }} 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']
+ tags: set-grub
+
+- name: Load msr by default
+ lineinfile:
+ path: '/etc/modules'
+ state: 'present'
+ line: 'msr'
+ tags: disable-turbo-boost