aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles/calibration/tasks/main.yaml
blob: 02a9ef3d00638fedf326ca6333eb4dedcb4a52d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
---
# file: roles/calibration/tasks/main.yaml

- name: Calibration - Install Distribution - Release - Machine Prerequisites
  package:
    name: "{{ packages | flatten(levels=1) }}"
    state: latest
    update_cache: true
  tags:
    - install-dependencies

- name: Calibration - Check CPU Power States
  shell: "lscpu"
  register: current_lscpu
  changed_when: false
  failed_when: |
    'CPU min MHz' in current_lscpu.stdout and
    'Intel(R) Xeon(R)' in current_lscpu.stdout
  tags:
    - check-cpu-frequency

- name: Calibration - Check Kernel Version of "{{ kernel_version }}"
  shell: "uname -r"
  register: current_kernel_version
  changed_when: false
  failed_when: |
    kernel_version not in current_kernel_version.stdout
  tags:
    - check-kernel-version

- name: Calibration - Check Kernel Parameters
  shell: "cat /proc/cmdline"
  register: current_kernel_parameters
  changed_when: false
  failed_when: |
    'isolcpus' not in current_kernel_parameters.stdout or
    'nohz_full' not in current_kernel_parameters.stdout or
    'rcu_nocbs' not in current_kernel_parameters.stdout or
    'processor.max_cstate=1' not in current_kernel_parameters.stdout or
    'nmi_watchdog=0' not in current_kernel_parameters.stdout or
    'intel_iommu=on' not in current_kernel_parameters.stdout or
    'nosoftlockup' not in current_kernel_parameters.stdout
  tags:
    - check-cmdline

- name: Calibration - Get Spectre Meltdown Checker
  get_url:
    url: "https://meltdown.ovh"
    dest: "/opt/spectre-meltdown-checker.sh"
    mode: "744"
  tags:
    - check-spectre-meltdown

- name: Calibration - Run Spectre Meltdown Checker
  shell: "/opt/spectre-meltdown-checker.sh --no-color || true"
  async: 60
  poll: 0
  ignore_errors: true
  register: spectre_meltdown_async
  tags:
    - check-spectre-meltdown

- name: Calibration - {{ ansible_machine }} Specific
  include_tasks: "{{ ansible_machine }}.yaml"
  tags:
    - check-machine-specific
    - check-jitter-tool

- name: Check sync status
  async_status:
    jid: "{{ spectre_meltdown_async.ansible_job_id }}"
  register: "spectre_meltdown_poll_results"
  until: spectre_meltdown_poll_results.finished
  retries: 30

- debug: var=spectre_meltdown_poll_results.stdout_lines
  tags:
    - check-spectre-meltdown