Ansible: More telemetry
[csit.git] / resources / tools / testbed-setup / ansible / roles / calibration / tasks / main.yaml
index b70694a..eb97f0b 100644 (file)
@@ -1,33 +1,55 @@
 ---
 # file: roles/calibration/tasks/main.yaml
 
-- name: Ubuntu specific
-  import_tasks: ubuntu.yaml
-  when: ansible_distribution|lower == 'ubuntu'
-
-- name: Run Spectre Meltdown checker
-  raw: 'spectre-meltdown-checker --no-color'
-  register: spectre_meltdown_output
-  tags: run-spectre-meltdown-checker
-
-- debug: var=spectre_meltdown_output.stdout_lines
-  tags: run-spectre-meltdown-checker
-
-- name: Clone Jitter tool
-  git:
-    repo: 'https://gerrit.fd.io/r/pma_tools'
-    dest: '{{ jitter.directory }}'
-  tags: run-jitter-tool
-
-- name: Compile Jitter tool
-  raw: 'cd {{ jitter.directory }}/jitter && make'
-  tags: run-jitter-tool
-
-- name: Run Jitter tool
-  raw: '{{ jitter.directory }}/jitter/jitter -c {{ jitter.core }} -i {{ jitter.iterations }} -f'
-  become: yes
-  register: jitter_output
-  tags: run-jitter-tool
-
-- debug: var=jitter_output.stdout_lines
-  tags: run-jitter-tool
+- name: Calibration - Install Distribution - Release - Machine Prerequisites
+  package:
+    name: "{{ packages | flatten(levels=1) }}"
+    state: latest
+    update_cache: true
+  tags:
+    - install-dependencies
+
+- 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: yes
+  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: 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
+  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