core.facts_gather#
Gather facts about a target#
Records what a target is and has under ‘targets.<target>’ in the facts: its operating system, kernel, CPUs and memory, PCI functions and NVMe controllers. The target is reached through its transport, so it may be a QEMU guest or hardware alike, and the facts have the same layout whatever its OS:
os: family, id, version_id, name, pretty_name
kernel: name, release, machine
system: cpus, memory_kib
pci: a list of bdf, vendor, device, class, driver, by bdf; a list, as a bdf has a dot, which a dotted key cannot hold
nvme.<controller>: bdf, serial, namespaces [{bdev and/or cdev, and nsid where the kernel or nvme-cli gives it}]
gpu: a list of the PCI functions of class display or accelerator, each with its ‘render’ nodes on Linux
nic: a list of the PCI functions of class network, each with its ‘netdevs’ and, on Linux, its ‘rdma’ devices
The OS is found by probing the target, ‘uname -s’, or PowerShell where there is no ‘uname’. Before each section, the tools it runs on that OS are checked, as core.tools_check does, and recorded as facts; a section whose tools the target lacks, or that its OS has no way of gathering here, is left out, with a log line, so one task gathers what each target offers. A section that was gathered and found nothing, such as no NVMe controllers, is empty. ‘sections’ picks the sections to gather and ‘skip’ leaves some out. Other packages add sections of their own the same way, with cijoe.facts.target().set().
A task reads the facts as ‘{{ target.os.id }}’, for the step’s target, or as ‘{{ facts.targets.<name>.os.id }}’. The gathering is cijoe.core.facts.gather(), for a script that gathers facts of its own.
Retargetable: True#
- cijoe.core.scripts.facts_gather.main(args, cijoe)#
Gather the facts about the target
CLI arguments#
--sections SECTIONSComma-separated sections to gather; default: os,kernel,system,pci,nvme,gpu,nic. (default: os,kernel,system,pci,nvme,gpu,nic)
--skip SKIPComma-separated sections to leave out of those gathered. (default: )