Forge Home

pci_devices_fact

Provide a fact with PCI device identifiers

7,912 downloads

7,912 latest version

4.1 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.0.1 (latest)
released Feb 19th 2016

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'olavmrk-pci_devices_fact', '0.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add olavmrk-pci_devices_fact
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install olavmrk-pci_devices_fact --version 0.0.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

olavmrk/pci_devices_fact — version 0.0.1 Feb 19th 2016

pci_devices_fact

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

Description

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

Setup Requirements

This module requires pushing a new fact to the node, and therefore requires Plugincync to be enabled. 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:

notice($::pci_devices)

Usage

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 in the precense of one of their WiFi adapters:

if '10ec:8176' in $::pci_devices {
  ensure_packages('firmware-realtek')
}

Reference

This module provides a single fact:

pci_devices

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

pci_devices => [
  '10ec:8168',
  '10ec:8176',
  '1b21:1142',
  '8086:0154',
  '8086:0156',
  '8086:1e03',
  '8086:1e10',
  '8086:1e12',
  '8086:1e14',
  '8086:1e16',
  '8086:1e20',
  '8086:1e22',
  '8086:1e26',
  '8086:1e2d',
  '8086:1e3a',
  '8086:1e5f',
]

Limitations

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

Development

This module is hosted in a Git repository at GitHub.