X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Ftestbed-setup%2Fansible%2Froles%2Fcalibration%2Ftasks%2Fmain.yaml;h=696f1c92651fa0eb0844edcf22ca87e0543aad1b;hp=eb97f0beb18cd5dbb61d15482ea6c6babc91b04a;hb=8018da98e0f362bc69fc9600fac222a86fd46b5e;hpb=dd5cd790b4fe977c9ba5fd9fe73d173a01065594 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 eb97f0beb1..696f1c9265 100644 --- a/resources/tools/testbed-setup/ansible/roles/calibration/tasks/main.yaml +++ b/resources/tools/testbed-setup/ansible/roles/calibration/tasks/main.yaml @@ -1,15 +1,60 @@ --- # file: roles/calibration/tasks/main.yaml -- name: Calibration - Install Distribution - Release - Machine Prerequisites +- name: Inst - Update Package Cache (APT) + apt: + update_cache: yes + cache_valid_time: 3600 + when: + - ansible_distribution|lower == 'ubuntu' + tags: + - calibration-inst-prerequisites + +- name: Inst - Prerequisites package: name: "{{ packages | flatten(levels=1) }}" state: latest - update_cache: true tags: - - install-dependencies + - calibration-inst-prerequisites + +- name: Check CPU Power States + shell: "lscpu" + register: current_lscpu + changed_when: false + tags: + - check-cpu-frequency + +- name: Check CPU Power States + assert: + that: + - "'CPU min MHz' not in current_lscpu.stdout or 'Intel(R) Xeon(R)' not in ansible_processor" + fail_msg: "CPU configuration!" + success_msg: "CPU configuration match." + tags: + - check-cpu-frequency + +- name: Check Kernel Parameters + assert: + that: + - item in ansible_cmdline and grub[item] == ansible_cmdline[item] + fail_msg: "Kernel parameters!" + success_msg: "Kernel parameters match." + loop: "{{ grub.keys()|sort }}" + when: + - grub is defined + tags: + - check-kernel-params + +- name: Check Kernel Version + assert: + that: + - ansible_kernel not in kernel_version_by_distro_by_arch + fail_msg: "Kernel version!" + success_msg: "Kernel version match." + tags: + - check-kernel-version -- name: Calibration - Get Spectre Meltdown Checker +- name: Get Spectre Meltdown Checker get_url: url: "https://meltdown.ovh" dest: "/opt/spectre-meltdown-checker.sh" @@ -17,33 +62,22 @@ tags: - check-spectre-meltdown -- name: Calibration - Run Spectre Meltdown Checker +- name: Run Spectre Meltdown Checker shell: "/opt/spectre-meltdown-checker.sh --no-color || true" async: 60 poll: 0 - ignore_errors: yes + ignore_errors: true register: spectre_meltdown_async tags: - check-spectre-meltdown -- name: Calibration - {{ ansible_machine }} Specific +- name: "{{ ansible_machine }} Specific" include_tasks: "{{ ansible_machine }}.yaml" tags: - check-machine-specific - check-jitter-tool -- name: Calibration - Get BIOS info - shell: "dmidecode -t bios" - ignore_errors: yes - register: dmidecode_bios - tags: - - check-bios - -- debug: var=dmidecode_bios.stdout_lines - tags: - - check-bios - -- name: Check sync status +- name: Check Sync Status async_status: jid: "{{ spectre_meltdown_async.ansible_job_id }}" register: "spectre_meltdown_poll_results"