Forge Home


Installs and configures discus.


45,723 latest version

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

Version information

  • 0.0.7 (latest)
  • 0.0.6
  • 0.0.5
  • 0.0.4
  • 0.0.3 (deleted)
  • 0.0.2 (deleted)
  • 0.0.1 (deleted)
released Jan 28th 2018
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.0.0 < 6.0.0
  • ,

Start using this module

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

Add this module to your Puppetfile:

mod 'kb-discus', '0.0.7'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add kb-discus
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install kb-discus --version 0.0.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.

Tags: hdd, disk, discus, space


kb/discus — version 0.0.7 Jan 28th 2018


table of contents

  1. overview
  2. module description – what the module does and why it is useful
  3. setup – the basics of getting started with discus
  4. usage – configuration options and additional functionality
  5. reference – an under-the-hood peek at what the module is doing and how
  6. limitations – OS compatibility, etc.
  7. development – guide for contributing to the module


This module installs and configures discus(1) – a prettier df(1).

module description

This module installs discus.


what discus affects

  • installs discus package
  • overwrite /etc/discusrc

setup requirements

This module requires the future parser. (future for PP 3.8 users).

The default template uses $server_facts[environment]. In Puppet 4.x you had to enable trusted_server_facts.

beginning with discus

Just installing discus and overwrite /etc/discusrc with default values.

    class some_tools {
        class { 'discus'


This is how I set up my discus(1):

    class some_tools {
        class { 'discus':
            latest_instead_of_present     => true,
            discusrc_akabytes             => ['KiB', 'MiB', 'GiB', 'TiB', 'PiB'],
            discusrc_graph_char           => '#',
            discusrc_graph_fill           => '.',
            # unfortunately discus(1) does not exclude tmpfs and alike by itself
            discusrc_skip_list            => [
            discusrc_stat_prog            => '/usr/bin/stat -ft',
            discusrc_color_header         => 'magenta',
            discusrc_color_safe           => 'cyan',
            discusrc_color_warning        => 'bold + yellow',
            discusrc_color_danger         => 'reverse + bold + red',
            discusrc_author               => 'Kai Burghardt <kburgha at>',

Since discusrc can't hold unicode characters, a block display graph can be achieved by the following:

    discusrc_graph_char           => ' ',
    discusrc_graph_fill           => '_',
    discusrc_color_safe           => 'on_green',
    # the asterisk '*' as eighth character is hard coded
    # -> make it _visually_ disappear
    discusrc_color_warning        => 'yellow + on_yellow',
    discusrc_color_danger         => 'on_red'

Note: The graph looks stupid once colors are disabled by -c command line flag.

Both examples are included in examples/.



public classes

  • discus: holds the class parameter types and contains the other classes
  • discus::params: holds default values (there are also data() and params() functions)

private classes

  • discus::install: installs the discus package
  • discus::config: distributes the configuration file



  • abstract: whether packages installed by this module are latest instead of just present

  • behavior: Package['discus'] is present by default. Set this parameter to true, to ensure it's latest.

  • allowed values: false, true

  • default value: false


  • abstract: Where the discusrc goes.

  • allowed values: a string the underlying file resource accepts

  • default: '/etc/discusrc'


  • abstract: Optionally what file mode the global discusrc has.

  • allowed values: a mode the underlying file resource accepts

  • default value: '0644'


  • abstract: Optionally whom the discusrc belongs to.

  • allowed values: a owner string the underlying file resource accepts

  • default value: 'root'


  • abstract: Optionally which group the discusrc belongs to.

  • allowed values: a group string the underlying file resource accepts

  • default value: 'root'


  • abstract: What template to use to render a discusrc

  • allowed values: a string

  • default: 'discus/discusrc.erb'


  • abstract: An array of strings to label kilo-, mega-, and gigabytes and beyond.

  • allowed values: a non-empty array of non-empty strings

  • default: ['KB', 'MB', 'GB', 'TB', 'PB', 'EB']


  • abstract: Whether to use colors.

  • allowed values: false, true

  • default value: true


  • abstract: The exponent determing the divisor if smart formatting (dynamically chosing a divisor) is disabled.

  • allowed values: a non-negative integer

  • default: 1


  • abstract: Whether to visualize disk usage by a bar graph (true) or to show mount points instead (false).

  • allowed values: false, true

  • default value: true


  • abstract: The character to print symbolizing used space.

  • allowed values: a character

  • default: '*'


  • abstract: The character to print for free space.

  • allowed values: a character

  • default: '-'


  • abstract: Where mtab is located at.

  • allowed values: a string

  • default: '/etc/mtab'


  • abstract: The number of post decimal point places to show.

  • allowed values: an integer

  • default value: 2


  • abstract: This is an internal setting.


  • abstract: Which mounts to ignore.

  • allowed values: an array of non-empty strings

  • default: ['/dev/pts', '/proc', '/dev', '/proc/usb', '/sys']


  • abstract: Dynamically choose prefix.

  • allowed values: false, true

  • default: true


  • abstract: What program to use if Python's statvfs module's absent.

  • allowed values: a string

  • default: 'stat -ft'


„Takes into account even the reserved space to root; it will be counted in percentage and in available columns only (used is for real used space).“ This is an internal setting (it was not provided by the discusrc sample).


  • abstract: The color for the table header.

  • allowed values: a string

  • default value: 'blue'


  • abstract: The default color to print everything what's not colored by other terms.

  • allowed values: a string

  • default value: 'normal'


  • abstract: The color used to print safe amount of used space.

  • allowed value: a string

  • default value: 'normal'


  • abstract: The color used to print the two characters before the last ones indiciting a disk with less space.

  • allowed values: a string

  • default value: 'bold + yellow'


  • abstract: The color used to print the last two characters indicating a pretty full disk.

  • allowed values: a string

  • default value: 'bold + red'


  • abstract: What to print as author comment in the discusrc. It says auth[or] but it's generally considered as a responsibility tag.

  • allowed values: a string

  • default value: 'Kai Burghardt <wiz at>'


  • This module's been used with stable Debian and Ubuntu releases.
  • It can't uninstall discus(1) or its changes.
  • Unfortunately /etc/discusrc can't hold unicode characters since discus treats it as an ASCII file (I've tried PEP0263).
  • discus(1) does not color the whole graph bar in one color but only the last few characters once it “realizes” the disk's full (compare /usr/bin/discus [a Python script] itself).
  • discus(1) itself does not hold fall-back configuration values. All values originate from discusrc. So ensure those are valid.
  • For coloring ANSI coloring escape sequences are used. You cannot change them with this module though the discusrc gives the opportunity.


Drop me a line Kai Burghardt <wiz?> (GnuPG usage advised). This module is primarily targeted for already packaged stable open source Puppet versions.