Browse Source

Adding customer fact script for gathering host inventory

Signed-off-by: Lucas A. Wilson <luke.wilson@dell.com>
Lucas A. Wilson 4 years ago
parent
commit
7b20a65f17
1 changed files with 18 additions and 0 deletions
  1. 18 0
      roles/common/files/inventory.fact

+ 18 - 0
roles/common/files/inventory.fact

@@ -0,0 +1,18 @@
+#!/bin/bash
+INVENTORY=$(mktemp lspci.XXXXXXXX)
+
+lspci > $INVENTORY
+
+NVIDIA_GPU=$(cat $INVENTORY | grep -i nvidia | wc -l)
+XILINX_FPGA=$(cat $INVENTORY | grep "Processing accelerators: Xilinx Corporation Device" | wc -l)
+INTEL_A10_FPGA=$(cat $INVENTORY | grep "Processing accelerators: Intel Corporation Device" | wc -l)
+
+cat << EOF
+{
+     "xilinx_fpga"    : "$XILINX_FPGA"
+     "nvidia_gpu"     : "$NVIDIA_GPU"
+     "intel_a10_fpga" : "$INTEL_A10_FPGA"
+}
+EOF
+
+rm -f $INVENTORY