- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with bash
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
This module installs and configures the Bash package.
This module handles installing and configuring Bash across a range of operating systems and distributions.
- bash package.
- bash configuration file.
- Puppet >= 3.0
- Facter >= 1.6
- Extlib module
- Stdlib module
Install bash with the default parameters (No configuration files will be changed).
class { 'bash': }
Install bash with the recommended parameters.
class { 'bash':
config_file_template => "bash/${::lsbdistcodename}/etc/skel/bashrc.erb",
config_file_hash => {
'.bash_aliases_skel' => {
config_file_path => '/etc/skel/.bash_aliases',
config_file_source => 'puppet:///modules/bash/common/etc/skel/bash_aliases',
},
'.bash_aliases_root' => {
config_file_path => '/root/.bash_aliases',
config_file_source => 'puppet:///modules/bash/common/etc/skel/bash_aliases',
},
'.bashrc' => {
config_file_path => '/root/.bashrc',
config_file_template => "bash/${::lsbdistcodename}/etc/skel/bashrc.erb",
},
},
}
Update the bash package.
class { 'bash':
package_ensure => 'latest',
}
Remove the bash package.
class { 'bash':
package_ensure => 'absent',
}
Purge the bash package (All configuration files will be removed).
class { 'bash':
package_ensure => 'purged',
}
Deploy the configuration files from source directory.
class { 'bash':
config_dir_source => "puppet:///modules/bash/${::lsbdistcodename}/etc/skel",
}
Deploy the configuration files from source directory (Unmanaged configuration files will be removed).
class { 'bash':
config_dir_purge => true,
config_dir_source => "puppet:///modules/bash/${::lsbdistcodename}/etc/skel",
}
Deploy the configuration file from source.
class { 'bash':
config_file_source => "puppet:///modules/bash/${::lsbdistcodename}/etc/skel/bashrc",
}
Deploy the configuration file from string.
class { 'bash':
config_file_string => '# THIS FILE IS MANAGED BY PUPPET',
}
Deploy the configuration file from template.
class { 'bash':
config_file_template => "bash/${::lsbdistcodename}/etc/skel/bashrc.erb",
}
Deploy the configuration file from custom template (Additional parameters can be defined).
class { 'bash':
config_file_template => "bash/${::lsbdistcodename}/etc/skel/bashrc.erb",
config_file_options_hash => {
'key' => 'value',
},
}
Deploy additional configuration files from source, string or template.
class { 'bash':
config_file_hash => {
'bashrc.2nd.conf' => {
config_file_path => '/etc/skel/bashrc.2nd.conf',
config_file_source => "puppet:///modules/bash/${::lsbdistcodename}/etc/skel/bashrc.2nd.conf",
},
'bashrc.3rd.conf' => {
config_file_path => '/etc/skel/bashrc.3rd.conf',
config_file_string => '# THIS FILE IS MANAGED BY PUPPET',
},
'bashrc.4th.conf' => {
config_file_path => '/etc/skel/bashrc.4th.conf',
config_file_template => "bash/${::lsbdistcodename}/etc/skel/bashrc.4th.conf.erb",
},
},
}
- bash: Main class, includes all other classes.
- bash::install: Handles the packages.
- bash::config: Handles the configuration file.
Determines if the package should be installed. Valid values are 'present', 'latest', 'absent' and 'purged'. Defaults to 'present'.
Determines the name of package to manage. Defaults to 'bash'.
Determines if additional packages should be managed. Defaults to '['bash-completion']'.
Determines if the configuration directory should be present. Valid values are 'absent' and 'directory'. Defaults to 'directory'.
Determines if the configuration directory should be managed. Defaults to '/etc/skel'
Determines if unmanaged configuration files should be removed. Valid values are 'true' and 'false'. Defaults to 'false'.
Determines if the configuration directory should be recursively managed. Valid values are 'true' and 'false'. Defaults to 'true'.
Determines the source of a configuration directory. Defaults to 'undef'.
Determines if the configuration file should be present. Valid values are 'absent' and 'present'. Defaults to 'present'.
Determines if the configuration file should be managed. Defaults to '/etc/skel/.bashrc'
Determines which user should own the configuration file. Defaults to 'root'.
Determines which group should own the configuration file. Defaults to 'root'.
Determines the desired permissions mode of the configuration file. Defaults to '0644'.
Determines the source of a configuration file. Defaults to 'undef'.
Determines the content of a configuration file. Defaults to 'undef'.
Determines the content of a configuration file. Defaults to 'undef'.
Determines which package a configuration file depends on. Defaults to 'Package[bash]'.
Determines which configuration files should be managed via bash::define
.
Defaults to '{}'.
Determines which parameters should be passed to an ERB template. Defaults to '{}'.
Determines which color (prompt) should be used. Defaults to '[\033[01;32m]'.
- '[\033[01;30m]' # grey
- '[\033[01;31m]' # red
- '[\033[01;32m]' # green
- '[\033[01;33m]' # yellow
- '[\033[01;34m]' # blue
- '[\033[01;35m]' # magenta
- '[\033[01;36m]' # cyan
- '[\033[01;37m]' # white
Determines which hostname (prompt) should be used. Defaults to '\h'.
This module has been tested on:
- Debian 6/7/8
- Ubuntu 12.04/14.04/16.04
If you find a bug, have trouble following the documentation or have a question about this module - please create an issue.
If you are able to patch the bug or add the feature yourself - please make a pull request.
The list of contributors can be found at: https://github.com/dhoppe/puppet-bash/graphs/contributors