Forge Home


Add colors to your bash prompt


4,630 latest version

4.9 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

  • 2.1.3 (latest)
released Nov 14th 2019
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >=3.0.0 < 7.0.0
  • RedHat, CentOS, OracleLinux, Fedora, Debian, Ubuntu

Start using this module

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

Add this module to your Puppetfile:

mod 'denver-colorprompt', '2.1.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add denver-colorprompt
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install denver-colorprompt --version 2.1.3

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.



denver/colorprompt — version 2.1.3 Nov 14th 2019



Build Status Code Coverage Puppet Forge Puppet Forge - downloads Puppet Forge - scores

The colorprompt module. Colors your bash prompt.

This is a fork of v2.1.2, original credit goes to the matainer(s) of sgnl05-colorprompt.

Module Description

The colorprompt module creates /etc/profile.d/, which sets a colored prompt. Different colors can be set for (all and specific) users, server name and environment tag.


All interaction with the colorprompt module can be done through the main colorprompt class.

I just want a colored prompt, what's the minimum I need?

include 'colorprompt'

I want a prompt for my production server with customised colors.

class { 'colorprompt':
   env_name          => 'PROD',
   env_color         => ['white', 'bg_red'],
   server_color      => 'red',
   default_usercolor => 'cyan',
   custom_usercolors => {
     'root' => 'magenta',

Great! What colors are available?

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white

A background color can also be defined by using bg_(color). Foreground and background colors can be combined by using arrays instead of strings (see env_color in example above).



Public Classes

  • colorprompt: Main and only class.



String. Ensure if file /etc/profile.d/ is present or absent. Defaults to present.


String or array. Sets the color for all users. Specific user colors can be overrided by 'custom_usercolors'. Defaults to 'cyan'.


Hash. Sets the color for specific users. Example: custom_usercolors => { 'apache' => 'blue', 'tomcat' => 'yellow' } Default is { 'root' => 'magenta' }


String or array. Sets the color for the server name. Defaults to unset.


String: Names an environment tag. Examples: 'PROD', 'QA', 'TEST', 'DEV'. Defaults to unset.


String or array. Sets the color for of the environment tag. Defaults to unset


String. Sets the final PS1 variable. This is an advanced setting, and should probably be left untouched unless you know what you're doing. :) Default varies with osfamily.


Boolean. Comments out PS1 variables in /etc/skel/.bashrc Default varies with osfamily.


Boolean. Comments out PS1 variables in /root/.bashrc Default varies with osfamily


This module has been tested against Puppet 3.0 and higher.

The module has been tested on:

  • RedHat & CentOS 5/6/7
  • Ubuntu 12.04 & 14.04
  • Debian 6/7/8
  • Fedora 22/23

Ubuntu and Debian need modification to existing user ~/.bashrc files (comment out PS1 variables).


To execute acceptance tests...

PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_set=docker/centos-7 bundle exec rake beaker
PUPPET_INSTALL_TYPE=agent BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_set=docker/ubuntu-18.04 bundle exec rake beaker

For this to work you must have docker installed and running locally


Please use the issue tracker ( for any type of contribution.