Forge Home

windows_disk_facts

Disk related facts for Windows

31,102 downloads

2,457 latest version

5.0 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.

Version information

  • 0.2.7 (latest)
  • 0.2.5
  • 0.2.4
  • 0.2.3
  • 0.2.1
  • 0.2.0
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Feb 16th 2021
This version is compatible with:
  • Puppet Enterprise >= 3.3.0
  • Puppet >= 3.3.0

Start using this module

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

Add this module to your Puppetfile:

mod 'dylanratcliffe-windows_disk_facts', '0.2.7'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add dylanratcliffe-windows_disk_facts
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install dylanratcliffe-windows_disk_facts --version 0.2.7

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

dylanratcliffe/windows_disk_facts — version 0.2.7 Feb 16th 2021

windows_disk_facts

Table of Contents

  1. Description
  2. Usage

Description

This module adds the following facts on Windows:

$::disks

The output of the Powershell Get-Disk command, but in a more Puppet-friendly format

$::drives

The output of the Powershell Get-PSDrive -PSProvider 'FileSystem' command, but in a more Puppet-friendly format + additional drive type information ('Fixed' = local hard drive, 'Removable' = removable devices like floppy and usb, 'CD-ROM' = optical drives)

$::partitions

The output of the Powershell Get-Partition command, but in a more Puppet-friendly format

Usage

# Loop over all of the partitions and find the one that is mounted to C:\
$::partitions.each |$partition| {
  if $partition['drive_letter'] == 'C' {
    # Do something here
  }
}

# Get the free size of C:\
notice($::drives['C']['free_bytes'])

Testing

This module is tested using Litmus. Here ere the steps:

bundle exec rake 'litmus:provision_list[vagrant]'
bundle exec rake 'litmus:install_agent'
bundle exec rake 'litmus:install_module'
bundle exec rake 'litmus:acceptance:parallel'
bundle exec rake 'litmus:tear_down'

Contributors