Skip to content
Puppet fact with list of PCI device identifiers
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/facter Sort the returned device list. Feb 16, 2016
spec Add comments describing how our unit test works. Feb 17, 2016
.travis.yml Set up automatic release from Travis CI. Feb 19, 2016 Add changelog. Feb 19, 2016
Rakefile Set up automatic release from Travis CI. Feb 19, 2016


Table of Contents

  1. Description
  2. Setup - The basics of getting started with pci_devices_fact
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module


This module provides the pci_devices-fact, which contains an array of PCI IDs for the node.

The pci_devices fact can then be used to check available hardware on the node from within Puppet manifests.


Setup Requirements

This module requires pushing a new fact to the node, and therefore requires pluginsync to be enabled on the Puppet agent. The fact is returned as an array, so if you are running Puppet 3.8 or older, you need to verify that the stringify_facts option is set to false.

Beginning with pci_devices_fact

Once the module is installed, you can access the pci_devices fact from manifests:



The pci_devices fact can be used to test for specific hardware in Puppet manifests. The simplest way is to use the in-operator to check for the precence of one element in the array.

For example, to install the Realtek firmware if the machine has one of their WiFi adapters:

if '10ec:8176' in $::pci_devices {
  # RTL8188CE 802.11b/g/n WiFi Adapter

To list the PCI IDs of the devices on the node, you can use the lspci utility with the -nn argument:

$ lspci -nn
01:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. RTL8188CE 802.11b/g/n WiFi Adapter [10ec:8176] (rev 01)

The PCI ID is printed in the square brackets towards the end of the line.


This module provides a single fact:


An array of PCI device identifiers for devices in the node. For example:

pci_devices => [


This module retrieves the device list by enumerating the PCI devices found in sysfs on Linux. As such, only Linux is supported, and sysfs must be available to the Puppet agent.


This module is hosted in a Git repository at GitHub.

You can’t perform that action at this time.