From cabf813daa526172399dea5639d1fa52fe87232c Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Wed, 8 Mar 2023 13:35:56 +0100 Subject: [PATCH] Add crude storage benchmark --- .../common/roles/disks/tasks/main.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ansible/roles/firstboot/files/ansible_payload/common/roles/disks/tasks/main.yml b/ansible/roles/firstboot/files/ansible_payload/common/roles/disks/tasks/main.yml index 12c7c9d..60bf059 100644 --- a/ansible/roles/firstboot/files/ansible_payload/common/roles/disks/tasks/main.yml +++ b/ansible/roles/firstboot/files/ansible_payload/common/roles/disks/tasks/main.yml @@ -11,11 +11,25 @@ lv: longhorn_lv size: 100%VG +- name: Store begin timestamp + ansible.builtin.set_fact: + start_time: "{{ lookup('pipe', 'date +%s') }}" + - name: Create filesystem community.general.filesystem: dev: /dev/mapper/longhorn_vg-longhorn_lv fstype: ext4 +- name: Store end timestamp + ansible.builtin.set_fact: + end_time: "{{ lookup('pipe', 'date +%s') }}" + +- name: Calculate crude storage benchmark + ansible.builtin.set_fact: + storage_benchmark: "{{ (end_time | int - start_time | int) }}" +- debug: + var: storage_benchmark + - name: Mount dynamic disk ansible.posix.mount: path: /mnt/blockstorage